From 988fa60a83ba55f289316be4e14fabf684209def Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Tue, 30 May 2023 09:17:51 +0000 Subject: [PATCH] [FIX] stock: check correct field name during import Forward port: https://github.com/odoo/odoo/pull/120965 added in a check to prevent setting a reserved qty when using an import file. Unfortunately this field was renamed in saas-15.2 during https://github.com/odoo/odoo/pull/80434/ Therefore this fix ensures that we check the new field name. closes odoo/odoo#123287 X-original-commit: d86d5e0515dec8991452ba218bd9367b4ed71ef6 Signed-off-by: Tiffany Chang --- addons/stock/models/stock_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move_line.py b/addons/stock/models/stock_move_line.py index 8e1dd863138..c9dbb991a34 100644 --- a/addons/stock/models/stock_move_line.py +++ b/addons/stock/models/stock_move_line.py @@ -302,7 +302,7 @@ class StockMoveLine(models.Model): vals['company_id'] = self.env['stock.picking'].browse(vals['picking_id']).company_id.id if vals.get('quant_id'): vals.update(self._copy_quant_info(vals)) - if self.env.context.get('import_file') and vals.get('product_uom_qty'): + if self.env.context.get('import_file') and vals.get('reserved_uom_qty'): raise UserError(_("It is not allowed to import reserved quantity, you have to use the quantity directly.")) mls = super().create(vals_list)