summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-02-13 13:41:44 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-02-28 08:49:12 +0000
commite3cd416dde3925e45223cab7aabded777497e112 (patch)
tree2e1bdbd21b5306b0fefd8d163f289a9b4b50760a
parent2c7a5840d3982bdb042f644a26b17f14c3f78e69 (diff)
[FIX] account: fix automatic fiscal position detection
Create a demo fiscal position with automatic detection enabled and country group assigned (ex. Europe). Create a new Vendor with such fiscal position assigned. Create a product in which the product category has an account which can be mapped with the demo fiscal position Create a new Vendor Bill, select the partner, create an invoice line, fill in the product: no fiscal position will apply In the process of auto detecting fiscal position the company_id may be enforced by the context and this would conflict when the fiscal position company is unset. Adding a default False condition fix the issue opw-2192733 closes odoo/odoo#46508 X-original-commit: 57a4038554b00a487bf7b176dd780192654b136a Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
-rw-r--r--addons/account/models/partner.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py
index 6914ec80d41..82934631012 100644
--- a/addons/account/models/partner.py
+++ b/addons/account/models/partner.py
@@ -119,7 +119,7 @@ class AccountFiscalPosition(models.Model):
base_domain = [
('auto_apply', '=', True),
('vat_required', '=', vat_required),
- ('company_id', '=', self.env.company.id),
+ ('company_id', 'in', [self.env.company.id, False]),
]
null_state_dom = state_domain = [('state_ids', '=', False)]
null_zip_dom = zip_domain = [('zip_from', '=', False), ('zip_to', '=', False)]