From 826b0115a3a46bf0ae26c92d23398daff98402fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Mon, 21 Nov 2022 20:35:23 +0100 Subject: [PATCH] [TMP]pms: avoid document restriction in partners updated technical fields --- pms/models/res_partner.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pms/models/res_partner.py b/pms/models/res_partner.py index 2cfea1be2..be1a4b707 100644 --- a/pms/models/res_partner.py +++ b/pms/models/res_partner.py @@ -892,7 +892,14 @@ class ResPartner(models.Model): vals, partners=self ) if check_missing_document: - raise ValidationError(_("A document identification is required")) + # REVIEW: Deactivate this check for now, because it can generate problems + # with other modules that update technical partner fields + _logger.warning( + _("Partner without document identification, update vals %s"), vals + ) + # We only check if the vat or document_number is updated + if "vat" in vals or "document_number" in vals: + raise ValidationError(_("A document identification is required")) return super().write(vals) @api.model