[TMP]pms: avoid document restriction in partners updated technical fields

This commit is contained in:
Darío Lodeiros
2022-11-21 20:35:23 +01:00
parent 174d5bec54
commit 826b0115a3

View File

@@ -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