From 3076ac620fc61c093aabb1e7e4b380bfaf80c5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 6 Dec 2020 00:33:19 +0100 Subject: [PATCH] Include be_vat identifier to VAT customer issue9891 review318961002 --- account.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/account.py b/account.py index a3085a20d2..f3434d8165 100644 --- a/account.py +++ b/account.py @@ -93,10 +93,12 @@ class BEVATCustomer(ModelSQL, ModelView): where = ((invoice.company == context.get('company')) & (period.fiscalyear == context.get('fiscalyear'))) where &= invoice.type == 'out' - where &= (company_identifier.code.ilike('BE%') - & (company_identifier.type == 'eu_vat')) - where &= (party_identifier.code.ilike('BE%') - & (party_identifier.type == 'eu_vat')) + where &= ((company_identifier.code.ilike('BE%') + & (company_identifier.type == 'eu_vat')) + | (company_identifier.type == 'be_vat')) + where &= ((party_identifier.code.ilike('BE%') + & (party_identifier.type == 'eu_vat')) + | (party_identifier.type == 'be_vat')) where &= tax.group.in_(groups) return (invoice_tax .join(invoice,