diff --git a/odex25_benefit/odex_benefit/i18n/ar_001.po b/odex25_benefit/odex_benefit/i18n/ar_001.po
index 330cfca57..37743d6c2 100644
--- a/odex25_benefit/odex_benefit/i18n/ar_001.po
+++ b/odex25_benefit/odex_benefit/i18n/ar_001.po
@@ -18094,11 +18094,15 @@ msgid "Resume Approval by Family Services Manager"
msgstr "اعتماد مديرة خدمات المستفيدين للإعادة"
#. module: odex_benefit
-#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Resume Family Service"
msgstr "إعادة الأسرة للخدمة"
+#. module: odex_benefit
+#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
+msgid "Resume Member Service"
+msgstr "إعادة الفرد للخدمة"
+
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
diff --git a/odex25_benefit/odex_benefit/models/family_members.py b/odex25_benefit/odex_benefit/models/family_members.py
index a34409bd2..e2ecf2073 100644
--- a/odex25_benefit/odex_benefit/models/family_members.py
+++ b/odex25_benefit/odex_benefit/models/family_members.py
@@ -567,6 +567,7 @@ class FamilyMemberProfile(models.Model):
'member_location_conf',
'state',
'is_dead',
+ 'is_work',
'benefit_id.member_ids.member_status',
)
def check_member_status(self):
@@ -698,8 +699,7 @@ class FamilyMemberProfile(models.Model):
elif rec.minor_siblings and rec.age > minor_siblings_age:
rec.member_status = 'non_benefit'
reasons.append(_("She is over %s years of age.") % minor_siblings_age)
- if rec.is_work and rec.member_income > max_income_for_benefit and rec.education_status in [
- 'educated'] and current_education_status_id.case_study == 'continuous':
+ if rec.is_work and rec.member_income > max_income_for_benefit:
rec.member_status = 'non_benefit'
reasons.append(_("She works with a salary greater than %s.") % max_income_for_benefit)
if rec.is_work and rec.education_status in ['illiterate']:
@@ -892,6 +892,11 @@ class FamilyMemberProfile(models.Model):
# Member Suspend Manual
def action_suspend(self):
+ ctx = dict(self.env.context or {})
+ ctx.update({
+ 'active_model': 'family.member',
+ 'active_id': self.id,
+ })
return {
'name': _('Suspend Reason Wizard'),
'view_mode': 'form',
@@ -900,11 +905,17 @@ class FamilyMemberProfile(models.Model):
'res_model': 'suspend.reason.wizard',
'view_id': self.env.ref('odex_benefit.view_suspend_member_reason_wizard_form').id,
'target': 'new',
+ 'context': ctx,
}
def action_resume_member(self):
ctx = dict(self.env.context or {})
- ctx['resume_family'] = True
+ #ctx['resume_family'] = True
+ ctx.update({
+ 'resume_family': True,
+ 'active_model': 'family.member',
+ 'active_id': self.id,
+ })
return {
'name': _('Resume Reason Wizard'),
'view_mode': 'form',
@@ -951,6 +962,7 @@ class FamilyMemberProfile(models.Model):
rec.state_a = 'family_services_manager'
else:
rec.state_a = 'second_approve'
+ rec.is_member_workflow = False
rec.action_type = 'approved'
def action_suspend_third_accept(self):
@@ -963,6 +975,7 @@ class FamilyMemberProfile(models.Model):
def action_resume_third_accept(self):
for rec in self:
rec.state_a = 'second_approve'
+ rec.is_member_workflow = False
rec.action_type = 'approved'
def action_suspend_refuse(self):
@@ -1136,28 +1149,28 @@ class FamilyMemberProfile(models.Model):
for record in self:
if not record.member_phone:
continue
-
+
phone = record.member_phone
-
+
# Remove +966 prefix if present
if phone.startswith('+966'):
phone = phone[4:]
record.member_phone = phone
-
+
# Validate Saudi mobile pattern
if re.match(SAUDI_MOBILE_PATTERN, phone) is None:
raise ValidationError(
_('Enter a valid Saudi mobile number'))
-
+
# Check phone against family's main phones
if record.benefit_id and phone in [
- record.benefit_id.phone,
- record.benefit_id.phone2,
+ record.benefit_id.phone,
+ record.benefit_id.phone2,
record.benefit_id.sms_phone
]:
raise ValidationError(
_("Phone number cannot be the same in The Family"))
-
+
# Check for duplicate phone in other members (excluding current record)
exist = self.search([
('member_phone', '=', phone),
@@ -1166,7 +1179,7 @@ class FamilyMemberProfile(models.Model):
if exist:
raise ValidationError(
_("The phone Number already exists in Family with code %s") % exist.benefit_id.code)
-
+
# Check if phone exists in grant.benefit
exist_in_family = self.env["grant.benefit"].search([
'|', '|',
diff --git a/odex25_benefit/odex_benefit/views/family_members.xml b/odex25_benefit/odex_benefit/views/family_members.xml
index e62bd76b1..28578e741 100644
--- a/odex25_benefit/odex_benefit/views/family_members.xml
+++ b/odex25_benefit/odex_benefit/views/family_members.xml
@@ -13,44 +13,44 @@
confirm="Are you sure you want to move to Temporarily Suspended ?"/>
+ attrs="{'invisible': ['|','|',('action_type','!=','suspended'),('state', 'not in', ['family_services_manager']),('is_member_workflow','=',False)]}"/>
+ attrs="{'invisible': ['|','|',('action_type','not in',['resume_from_final','resume_from_temporary']),('state', 'not in', ['first_approve']),('is_member_workflow','=',False)]}"/>
-
+