parent
23ce751860
commit
35e2fe0283
|
@ -74,6 +74,10 @@ msgctxt "model:ir.message,text:msg_move_date_in_the_future"
|
|||
msgid "The moves of the unit load cannot be done because have date in future."
|
||||
msgstr "Los movimientos de la unidad de carga no se pueden finalizar porque tienen fecha en el futuro."
|
||||
|
||||
msgctxt "model:ir.message,text:msg_stock_unit_load_missing_at_warehouse"
|
||||
msgid "Cannot drop UL \"%(unit_load)s\" without have warehouse at date."
|
||||
msgstr "No se puede volcar UdC \"%(unit_load)s\" sin tener almacén a fecha."
|
||||
|
||||
msgctxt "field:stock.configuration,unit_load_sequence:"
|
||||
msgid "Load unit Sequence"
|
||||
msgstr "Secuencia de unidad de carga"
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
<record model="ir.message" id="msg_move_date_in_the_future">
|
||||
<field name="text">The moves of the unit load cannot be done because have date in future.</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_stock_unit_load_missing_at_warehouse">
|
||||
<field name="text">Cannot drop UL "%(unit_load)s" without have warehouse at date.</field>
|
||||
</record>
|
||||
|
||||
<!-- stock.unit_load.do_drop -->
|
||||
<record model="ir.message" id="msg_stock_unit_load_do_drop_invalid_ul">
|
||||
|
|
13
unit_load.py
13
unit_load.py
|
@ -452,6 +452,14 @@ class UnitLoad(ModelSQL, ModelView):
|
|||
'stock_unit_load.msg_stock_unit_load_ul_not_available',
|
||||
unit_load=record.rec_name))
|
||||
|
||||
@classmethod
|
||||
def _check_at_warehouse(cls, records):
|
||||
for record in records:
|
||||
if not record.at_warehouse:
|
||||
raise UserError(gettext(
|
||||
'stock_unit_load.msg_stock_unit_load_missing_at_warehouse',
|
||||
unit_load=record.rec_name))
|
||||
|
||||
def get_rec_name(self, name):
|
||||
if Transaction().context.get('ul_extended_rec_name', False):
|
||||
cases_string = self.fields_get(fields_names=['cases_quantity'])[
|
||||
|
@ -1522,6 +1530,7 @@ class UnitLoad(ModelSQL, ModelView):
|
|||
records = PYSONDecoder.decode(records)
|
||||
if not isinstance(records[0], Model):
|
||||
records = cls.search(records)
|
||||
cls._check_at_warehouse(records)
|
||||
|
||||
to_do = []
|
||||
for record in records:
|
||||
|
@ -2533,7 +2542,11 @@ class BatchDropUnitLoad(Wizard):
|
|||
do_ = StateTransition()
|
||||
|
||||
def transition_start(self):
|
||||
pool = Pool()
|
||||
UnitLoad = pool.get('stock.unit_load')
|
||||
|
||||
uls = self._get_unit_loads()
|
||||
UnitLoad._check_at_warehouse(uls)
|
||||
for ul in uls:
|
||||
if not ul.available:
|
||||
raise UserError(gettext(
|
||||
|
|
Loading…
Reference in New Issue