mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[16.0][FIX] stock_secondary_unit: use @api.model_create_multi in create method
This commit is contained in:
committed by
Rocío Vega
parent
613c3bb16c
commit
2976bdf15e
@@ -50,12 +50,13 @@ class StockMoveLine(models.Model):
|
|||||||
store=True, readonly=False, compute="_compute_qty_done", precompute=True
|
store=True, readonly=False, compute="_compute_qty_done", precompute=True
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
|
for vals in vals_list:
|
||||||
move = self.env["stock.move"].browse(vals.get("move_id", False))
|
move = self.env["stock.move"].browse(vals.get("move_id", False))
|
||||||
if move.secondary_uom_id:
|
if move.secondary_uom_id:
|
||||||
vals["secondary_uom_id"] = move.secondary_uom_id.id
|
vals["secondary_uom_id"] = move.secondary_uom_id.id
|
||||||
return super().create(vals)
|
return super().create(vals_list)
|
||||||
|
|
||||||
@api.depends("secondary_uom_id", "secondary_uom_qty")
|
@api.depends("secondary_uom_id", "secondary_uom_qty")
|
||||||
def _compute_qty_done(self):
|
def _compute_qty_done(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user