Check loaded ULs.

This commit is contained in:
Sergio Morillo 2016-04-13 08:55:20 +02:00
parent 485d8756f8
commit af20629393
2 changed files with 8 additions and 1 deletions

View File

@ -79,7 +79,8 @@ class LoadOrder:
'draft_ul': 'Cannot change state to Draft for load order "%s" because it has loaded ULs.',
'pending_uls': 'You have loaded less ULs (%s) than expected (%s).',
'sale_confirmed': 'Cannot force loading ULs because sale "%s" is confirmed.',
'unload_cancel': 'Cannot force unloading all ULs. Load order "%s" must be cancelled completely.'
'unload_cancel': 'Cannot force unloading all ULs. Load order "%s" must be cancelled completely.',
'no_uls': 'Load order "%s" must have some UL to be finished.'
})
@classmethod
@ -267,6 +268,8 @@ class LoadOrder:
@classmethod
def _check_loaded_quantity(cls, records):
for record in records:
if not record.unit_loads:
cls.raise_user_error('no_uls', record.rec_name)
if record.ul_quantity > len(record.unit_loads):
cls.raise_user_warning('pending_uls_%s' % record.id, 'pending_uls',
(len(record.unit_loads), int(record.ul_quantity)))

View File

@ -50,6 +50,10 @@ msgctxt "error:carrier.load.order:"
msgid "Cannot force loading ULs because sale \"%s\" is confirmed."
msgstr "No puede forzar la carga de UdCs porque la Venta asociada \"%s\" está confirmada."
msgctxt "error:carrier.load.order:"
msgid "Load order \"%s\" must have some UL to be finished."
msgstr "La Orden de carga \"%s\" debe contener alguna UdC para poder finalizarse."
msgctxt "error:carrier.load_uls:"
msgid "Cannot find Unit load \"%s\"."
msgstr "No se ha podido encontrar la UdC \"%s\"."