Search tax identifier from the invoice party identifiers

Closes #13265
(grafted from 9742f2dd913d44c9fd92049cdc130bfe486fad5c)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2024-05-20 14:26:21 +02:00
1 parent 2e1bf05ff7
commit 69df56a44d
1 file changed
+2 -2
+2 -2
View File
@@ -87,9 +87,9 @@ class IncomingSupplierInvoice(metaclass=PoolMeta):
invoice_data = self.ocr_service.get_supplier_invoice(self)
tax_identifier = invoice_data.get('tax_identifier')
if tax_identifier:
if tax_identifier and invoice.party:
tax_identifier_types = Party.tax_identifier_types()
for identifier in self.party.identifiers:
for identifier in invoice.party.identifiers:
if (identifier.type in tax_identifier_types
and identifier.code == tax_identifier):
invoice.party_tax_identifier = identifier