mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms: doc_type and doc_number search in get_partner_by_document
This commit is contained in:
@@ -519,8 +519,8 @@ class PmsCheckinPartner(models.Model):
|
||||
.env["res.partner.id_number"]
|
||||
.search(
|
||||
[
|
||||
("name", "=", self.document_number),
|
||||
("category_id", "=", self.document_type.id),
|
||||
("name", "=", document_number),
|
||||
("category_id", "=", document_type.id),
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -73,6 +73,7 @@ class PmsCheckinPartner(models.Model):
|
||||
)
|
||||
document_number = re.sub(r"[^a-zA-Z0-9]", "", document_number).upper()
|
||||
if not partner and document_number and document_type:
|
||||
search_field_name = False
|
||||
if document_type.aeat_identification_type in ["03", "05", "06"]:
|
||||
search_field_name = "aeat_identification"
|
||||
search_comparison = "="
|
||||
|
||||
Reference in New Issue
Block a user