[FIX] dev_membership: exclude other contacts from constrain

This commit is contained in:
Abdurrahman Saber 2025-11-02 10:36:28 +02:00
parent 284cfb440e
commit a78d5e8128
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ class Partner(models.Model):
@api.constrains('mobile','is_member')
def _check_mobile_required_if_member(self):
for record in self:
if record.is_member and not record.mobile:
if record.is_member and not record.mobile and record.parent_id == False:
raise ValidationError(_("Mobile number is required for members."))