mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms_api_rest: fix comparation vat len in partners without vat
This commit is contained in:
@@ -91,7 +91,11 @@ class PmsCheckinPartner(models.Model):
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
if partner and len(partner.vat) - len(document_number) > 2:
|
||||
if (
|
||||
partner
|
||||
and partner.vat
|
||||
and len(partner.vat) - len(document_number) > 2
|
||||
):
|
||||
# The country code length is 2, so if the difference is greater than 2
|
||||
# the partner is not the same
|
||||
# TODO: this method need pass country code to search
|
||||
|
||||
Reference in New Issue
Block a user