diff options
| author | Victor Feyens <vfe@odoo.com> | 2019-09-14 13:11:16 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2019-11-18 12:25:05 +0000 |
| commit | 57b999d40ad89a80dd4ae40433d928c0f0d57b09 (patch) | |
| tree | 5aa5834b98c30cf3fcd3167326db8aea41201912 /addons/sale_purchase | |
| parent | 48b887618ccdd2950b504c8e12b77c712f4cb4c5 (diff) | |
[FIX] sale,account,purchase_requisition: multi-company
Use correct company to get fiscal positions and properties
Ensure company used to fetch fiscal positions is always the correct one
when coming from a company restricted model (company_id required, or
related.required).
NB: if the company_id isn't defined, with_company doesn't change the
environment.
purchase: get_fiscal_position doesn't consider company_id ctxt key
others: properties were accessed with potentially the wrong company.
Diffstat (limited to 'addons/sale_purchase')
| -rw-r--r-- | addons/sale_purchase/models/sale_order.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_purchase/models/sale_order.py b/addons/sale_purchase/models/sale_order.py index d2244ad66f2..fe54c2670c2 100644 --- a/addons/sale_purchase/models/sale_order.py +++ b/addons/sale_purchase/models/sale_order.py @@ -175,7 +175,7 @@ class SaleOrderLine(models.Model): :rtype: dict """ self.ensure_one() - self = self.with_context(force_company=self.company_id.id) + self = self.with_company(self.company_id) partner_supplier = supplierinfo.name fiscal_position_id = self.env['account.fiscal.position'].sudo().get_fiscal_position(partner_supplier.id) date_order = self._purchase_get_date_order(supplierinfo) |
