diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 7f348c16a60..fdb4d83bf8c 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -9117,6 +9117,13 @@ msgid "" "in order to reverse the moves which took place." msgstr "" +#. module: stock +#. odoo-python +#: code:addons/stock/models/stock_move.py:0 +#, python-format +msgid "You cannot change a cancelled stock move, create a new line instead." +msgstr "" + #. module: stock #. odoo-python #: code:addons/stock/models/stock_picking.py:0 diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index dc40c2b9a68..29b1e0ebd97 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -669,6 +669,8 @@ Please change the quantity done or the rounding precision of your unit of measur # messages according to the state of the stock.move records. receipt_moves_to_reassign = self.env['stock.move'] move_to_recompute_state = self.env['stock.move'] + if 'quantity_done' in vals and any(move.state == 'cancel' for move in self): + raise UserError(_('You cannot change a cancelled stock move, create a new line instead.')) if 'product_uom' in vals and any(move.state == 'done' for move in self): raise UserError(_('You cannot change the UoM for a stock move that has been set to \'Done\'.')) if 'product_uom_qty' in vals: