diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2019-03-27 11:31:19 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2019-03-27 11:43:51 +0000 |
| commit | b2b395467fec9daa6b8f1e97cacd3a739e48defe (patch) | |
| tree | 276754613b956ce952f818dbfb3473b9c33790d3 /addons/delivery/models/stock_picking.py | |
| parent | e2e27b41ad2b132595836f9b03ae9a25a4951c66 (diff) | |
[FIX] delivery: picking weight not updated sometime
The delivery lines (move_lines) have two way to be displayed in a view:
- with move_lines (all move line of a stock.picking)
- with move_ids_without_package (same but removing packages)
But so if we write directly on move_ids_without_package we would not
trigger the stock.picking @api.depends('move_lines') _cal_weight method
thus the picking weight was not updated in some instances.
With this changeset, we adds the move_ids_without_package as depends so
on move_ids_without_package onchange the total weight should be set to
the correct weight or 0 (if move_lines is not in the view) and on write
the correct weight should be computed.
opw-1959523
closes #32157
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/delivery/models/stock_picking.py')
| -rw-r--r-- | addons/delivery/models/stock_picking.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py index e8a1344cb08..583bdb16398 100644 --- a/addons/delivery/models/stock_picking.py +++ b/addons/delivery/models/stock_picking.py @@ -101,7 +101,7 @@ class StockPicking(models.Model): for picking in self: picking.weight_uom_id = weight_uom_id - @api.depends('move_lines') + @api.depends('move_lines', 'move_ids_without_package') def _cal_weight(self): for picking in self: picking.weight = sum(move.weight for move in picking.move_lines if move.state != 'cancel') |
