From 252ae54c593f007e7d2abe5d0bea85eccf7920b3 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Thu, 10 Oct 2019 14:31:39 +0000 Subject: [PATCH] [FIX] l10n_ar: Properly compute fiscal position for Argentinian companies. We revert the change we apply in order to let the user to define their own fiscal positions, now the fiscal position will be set depending on the afip responsability. With this change we fix the error that the fiscal position is properly setted for the customers that are of type "Responsable Inscription" and "Consumidor Final". Before this change the "Compras / Ventas en el Exterior" fiscal position was wrongly seted, now the fiscal position is leave empty so the related invoice taxes are properly matched closes odoo/odoo#38830 X-original-commit: 74f172041351e03f60b1aff0f0eb925e896cd1fa Signed-off-by: Josse Colpaert --- addons/l10n_ar/models/account_fiscal_position.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/l10n_ar/models/account_fiscal_position.py b/addons/l10n_ar/models/account_fiscal_position.py index e00005ac62b..78ffee7ab2a 100644 --- a/addons/l10n_ar/models/account_fiscal_position.py +++ b/addons/l10n_ar/models/account_fiscal_position.py @@ -22,9 +22,7 @@ class AccountFiscalPosition(models.Model): ] if self.env.context.get('force_company'): domain.append(('company_id', '=', self.env.context.get('force_company'))) - fp = self.search(domain, limit=1).id - if fp: - return fp + return self.search(domain, limit=1).id return super().get_fiscal_position(partner_id, delivery_id=delivery_id) @api.onchange('l10n_ar_afip_responsibility_type_ids', 'country_group_id', 'country_id', 'zip_from', 'zip_to')