diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 0ffc3d245cf..10ce708554b 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -574,7 +574,7 @@ class StockQuant(models.Model): 'product_id': self.product_id.id, 'product_uom': self.product_uom_id.id, 'product_uom_qty': qty, - 'company_id': self.company_id.id or self.env.user.company_id.id, + 'company_id': self.company_id.id or self.env.company.id, 'state': 'confirmed', 'location_id': location_id.id, 'location_dest_id': location_dest_id.id, @@ -584,7 +584,7 @@ class StockQuant(models.Model): 'qty_done': qty, 'location_id': location_id.id, 'location_dest_id': location_dest_id.id, - 'company_id': self.company_id.id or self.env.user.company_id.id, + 'company_id': self.company_id.id or self.env.company.id, 'lot_id': self.lot_id.id, 'package_id': out and self.package_id.id or False, 'result_package_id': (not out) and self.package_id.id or False,