[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#59875 X-original-commit: 5ddcad3cb1d6063b7be89e4f0bd35b89885f746b Signed-off-by: Josse Colpaert <jco@openerp.com>
This commit is contained in:
committed by
Josse Colpaert
parent
885977da13
commit
f3014587e7
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user