diff options
| author | Simon Lejeune <sle@openerp.com> | 2018-03-22 17:28:49 +0100 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2018-03-23 13:28:36 +0100 |
| commit | 132c7e75e57321c77aac9250a2587c74c5da7857 (patch) | |
| tree | 3bc341afda7958ac8c724af29d1fe1355561dc4a | |
| parent | e3a0d926d6e7d13a54537e1fb3d3a29f6922159b (diff) | |
[FIX] stock: date field on move line after `_action_done`
We make the date field behaves similarly to the date field on the stock
move line: before `_action_done` is called, it is the created date,
after, it is the date done.
Note that this field is only used in a report of the stock move lines.
Fixes #23725
| -rw-r--r-- | addons/stock/models/stock_move_line.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/stock/models/stock_move_line.py b/addons/stock/models/stock_move_line.py index 82df0bef736..ba192f4b8a5 100644 --- a/addons/stock/models/stock_move_line.py +++ b/addons/stock/models/stock_move_line.py @@ -431,7 +431,10 @@ class StockMoveLine(models.Model): Quant._update_available_quantity(ml.product_id, ml.location_id, taken_from_untracked_qty, lot_id=ml.lot_id, package_id=ml.package_id, owner_id=ml.owner_id) Quant._update_available_quantity(ml.product_id, ml.location_dest_id, quantity, lot_id=ml.lot_id, package_id=ml.result_package_id, owner_id=ml.owner_id, in_date=in_date) # Reset the reserved quantity as we just moved it to the destination location. - (self - ml_to_delete).with_context(bypass_reservation_update=True).write({'product_uom_qty': 0.00}) + (self - ml_to_delete).with_context(bypass_reservation_update=True).write({ + 'product_uom_qty': 0.00, + 'date': fields.Datetime.now(), + }) def _log_message(self, record, move, template, vals): data = vals.copy() |
