[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 <tic@odoo.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user