diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py index c744638bcff..c9ae09db69a 100644 --- a/addons/stock_account/models/stock.py +++ b/addons/stock_account/models/stock.py @@ -680,8 +680,8 @@ class StockMove(models.Model): location_from = self.location_id location_to = self.location_dest_id - company_from = self._is_out() and self.mapped('move_line_ids.location_id.company_id') or False - company_to = self._is_in() and self.mapped('move_line_ids.location_dest_id.company_id') or False + company_from = self.mapped('move_line_ids.location_id.company_id') if self._is_out() else False + company_to = self.mapped('move_line_ids.location_dest_id.company_id') if self._is_in() else False # Create Journal Entry for products arriving in the company; in case of routes making the link between several # warehouse of the same company, the transit location belongs to this company, so we don't need to create accounting entries