[FIX] stock_picking_report_custom_description: singleton error

It isn't very common to write the name in batch. Anyway it would lead to
errors in it's current shape.

TT52171
This commit is contained in:
David
2024-12-12 13:31:26 +01:00
committed by juancarlosonate-tecnativa
parent 6cc3371118
commit 4d0a42e7c7

View File

@@ -10,7 +10,5 @@ class SaleOrderLine(models.Model):
def write(self, vals):
res = super().write(vals)
if vals.get("name"):
moves = self.env["stock.move"].search([("sale_line_id", "=", self.id)])
if moves:
moves.write({"description_picking": vals["name"]})
self.move_ids.description_picking = vals["name"]
return res