Skip to content

Commit 19be84b

Browse files
committed
[FIX] l10n_it_edi_extension: when importing an XML with DatiRitenuta or DatiCassaPrevidenziale
get TypeError: AccountMoveInherit._l10n_it_edi_search_tax_for_import() got an unexpected keyword argument 'vat_only' The vat_only parameter has been in l10n_it_edi_withholding since the beginning of Odoo 18. Importing invoices that have withholding/pension fund taxes has never worked with l10n_it_edi_extension installed. The error only triggers when the imported XML contains DatiRitenuta or DatiCassaPrevidenziale sections (withholding or pension fund data), because that's when l10n_it_edi_withholding calls the method with vat_only=False. Regular invoices without those sections work fine since the base module never passes vat_only. When l10n_it_edi_withholding._l10n_it_edi_get_extra_info() calls self._l10n_it_edi_search_tax_for_import(..., vat_only=False), Python dispatches to the most derived override — which is l10n_it_edi_extension's version. But that version doesn't accept vat_only, hence the TypeError.
1 parent 2a49142 commit 19be84b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

l10n_it_edi_extension/models/account_move.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,12 @@ def _l10n_it_edi_update_partner(self, xml_tree, role, partner):
420420
return partner
421421

422422
def _l10n_it_edi_search_tax_for_import(
423-
self, company, percentage, extra_domain=None, l10n_it_exempt_reason=None
423+
self,
424+
company,
425+
percentage,
426+
extra_domain=None,
427+
l10n_it_exempt_reason=None,
428+
**kwargs,
424429
):
425430
# Check if a tax of the default product fits what is requested
426431
partner_default_product = self.partner_id.l10n_it_edi_ext_default_product_id
@@ -438,20 +443,23 @@ def _l10n_it_edi_search_tax_for_import(
438443
percentage,
439444
product_extra_domain,
440445
l10n_it_exempt_reason=l10n_it_exempt_reason,
446+
**kwargs,
441447
)
442448
if not tax:
443449
tax = super()._l10n_it_edi_search_tax_for_import(
444450
company,
445451
percentage,
446452
extra_domain,
447453
l10n_it_exempt_reason=l10n_it_exempt_reason,
454+
**kwargs,
448455
)
449456
else:
450457
tax = super()._l10n_it_edi_search_tax_for_import(
451458
company,
452459
percentage,
453460
extra_domain,
454461
l10n_it_exempt_reason=l10n_it_exempt_reason,
462+
**kwargs,
455463
)
456464
return tax
457465

0 commit comments

Comments
 (0)