summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorStéphane Bidoul <stephane.bidoul@acsone.eu>2016-02-23 17:05:37 +0100
committerDenis Ledoux <dle@odoo.com>2016-02-23 17:25:42 +0100
commit4162b8f5fa31cd76fa79c7e810f49b38733a16d4 (patch)
tree9e970b84272efe006d8d03235658ff4b57451af5 /addons
parent68f9f99ed3b8434f7ba621479bce215dce05bdc2 (diff)
[FIX] account: fiscal position in multi-company environments
Properties depends on with which companies the records are browsed. When retrieving the fiscal position as sudo, the company must therefore be enforced within the context, to make sure to get the properties from the right company. This method can totally be accessed as sudo, within the crons for instance. Before this revision, the recurring invoices cron could retrieve properties from the wrong company, and therefore retrieve the fiscal position of another company. Closes #11039
Diffstat (limited to 'addons')
-rw-r--r--addons/account/partner.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/account/partner.py b/addons/account/partner.py
index f60b37fe862..6684222a46e 100644
--- a/addons/account/partner.py
+++ b/addons/account/partner.py
@@ -109,6 +109,7 @@ class account_fiscal_position(osv.osv):
def get_fiscal_position(self, cr, uid, company_id, partner_id, delivery_id=None, context=None):
if not partner_id:
return False
+ context = dict(context or {}, company_id=company_id, force_company=company_id)
# This can be easily overriden to apply more complex fiscal rules
part_obj = self.pool['res.partner']
partner = part_obj.browse(cr, uid, partner_id, context=context)