commit
3b98973e2a
|
|
@ -341,26 +341,26 @@ class FamilyMemberProfile(models.Model):
|
|||
"Death Certificate is required for member '%s' when marked as deceased."
|
||||
) % rec.name)
|
||||
|
||||
@api.constrains('is_work', 'age', 'member_income', 'salary_certificate')
|
||||
def _check_salary_certificate_required(self):
|
||||
for rec in self:
|
||||
if rec.age >= 18 and rec.is_work:
|
||||
if rec.member_income <= 0:
|
||||
raise ValidationError(_(
|
||||
"Income must be greater than 0 for member '%s' when working and age is greater than or equal to 18."
|
||||
) % rec.name)
|
||||
if not rec.salary_certificate:
|
||||
raise ValidationError(_(
|
||||
"Salary Certificate is required for member '%s' when working and age is greater than or equal to 18."
|
||||
) % rec.name)
|
||||
|
||||
@api.constrains('is_mother', 'is_married', 'marriage_certificate')
|
||||
def _check_marriage_certificate_required(self):
|
||||
for rec in self:
|
||||
if not rec.is_mother and rec.is_married and not rec.marriage_certificate:
|
||||
raise ValidationError(_(
|
||||
"Marriage Certificate is required for member '%s' when marked as married and not a mother."
|
||||
) % rec.name)
|
||||
# @api.constrains('is_work', 'age', 'member_income', 'salary_certificate')
|
||||
# def _check_salary_certificate_required(self):
|
||||
# for rec in self:
|
||||
# if rec.age >= 18 and rec.is_work:
|
||||
# if rec.member_income <= 0:
|
||||
# raise ValidationError(_(
|
||||
# "Income must be greater than 0 for member '%s' when working and age is greater than or equal to 18."
|
||||
# ) % rec.name)
|
||||
# if not rec.salary_certificate:
|
||||
# raise ValidationError(_(
|
||||
# "Salary Certificate is required for member '%s' when working and age is greater than or equal to 18."
|
||||
# ) % rec.name)
|
||||
#
|
||||
# @api.constrains('is_mother', 'is_married', 'marriage_certificate')
|
||||
# def _check_marriage_certificate_required(self):
|
||||
# for rec in self:
|
||||
# if not rec.is_mother and rec.is_married and not rec.marriage_certificate:
|
||||
# raise ValidationError(_(
|
||||
# "Marriage Certificate is required for member '%s' when marked as married and not a mother."
|
||||
# ) % rec.name)
|
||||
|
||||
@api.constrains('member_first_name')
|
||||
def _check_names_alphabetic(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue