Skip to content

Commit

Permalink
Merge PR #2177 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rousseldenis
  • Loading branch information
OCA-git-bot committed Oct 17, 2024
2 parents d311024 + 4b7c76b commit 77d0a1c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions stock_secondary_unit/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ class StockMoveLine(models.Model):
store=True, readonly=False, compute="_compute_qty_done", precompute=True
)

@api.model
def create(self, vals):
move = self.env["stock.move"].browse(vals.get("move_id", False))
if move.secondary_uom_id:
vals["secondary_uom_id"] = move.secondary_uom_id.id
return super().create(vals)
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
move = self.env["stock.move"].browse(vals.get("move_id", False))
if move.secondary_uom_id:
vals["secondary_uom_id"] = move.secondary_uom_id.id
return super().create(vals_list)

@api.depends("secondary_uom_id", "secondary_uom_qty")
def _compute_qty_done(self):
Expand Down

0 comments on commit 77d0a1c

Please sign in to comment.