Skip to content
Snippets Groups Projects
Commit bbbccbfc authored by Nicolás Mac Rouillon's avatar Nicolás Mac Rouillon Committed by Josse Colpaert
Browse files

[FIX] l10n_ar: Previous verify for the partner property fpos then use auto_apply.


The problem here is before this changes, the fiscal position only take into account if them has "auto_apply" True, and for the cases that the partner has their property fiscal position configurate for a company this is not taking into account.

After this changes we evaluate for the property fiscal position for the partner and then if non result we seek a fiscal position with the auto apply and the responsability of afip.
So this the same as the original method do.

closes odoo/odoo#59864

X-original-commit: 5ddcad3cb1d6063b7be89e4f0bd35b89885f746b
Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
parent 81a00e34
Branches
Tags
No related merge requests found
......@@ -16,6 +16,18 @@ class AccountFiscalPosition(models.Model):
""" Take into account the partner afip responsibility in order to auto-detect the fiscal position """
company = self.env.company
if company.country_id == self.env.ref('base.ar'):
PartnerObj = self.env['res.partner']
partner = PartnerObj.browse(partner_id)
# if no delivery use invoicing
if delivery_id:
delivery = PartnerObj.browse(delivery_id)
else:
delivery = partner
# partner manually set fiscal position always win
if delivery.property_account_position_id or partner.property_account_position_id:
return delivery.property_account_position_id or partner.property_account_position_id
domain = [
('auto_apply', '=', True),
('l10n_ar_afip_responsibility_type_ids', '=', self.env['res.partner'].browse(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment