commit
879f54d3de
|
|
@ -18535,4 +18535,68 @@ msgstr "الجنسيات المسموح بها"
|
|||
msgid ""
|
||||
"Countries where this service is available. Leave empty to allow all "
|
||||
"countries."
|
||||
msgstr "الجنسيات التي تتوفر فيها هذه الخدمة. اتركها فارغة للسماح بجميع الجنسيات."
|
||||
msgstr "الجنسيات التي تتوفر فيها هذه الخدمة. اتركها فارغة للسماح بجميع الجنسيات."
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:res.groups,name:odex_benefit.group_family_member_exception
|
||||
msgid "Family Member Exception"
|
||||
msgstr "استثناء أفراد الأسرة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#, python-format
|
||||
msgid "Non-Saudi mothers and fathers cannot register."
|
||||
msgstr "الأمهات والآباء غير السعوديين."
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__full_age
|
||||
msgid "Full Age"
|
||||
msgstr "العمر"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "%s years"
|
||||
msgstr "%s سنة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "0 years, 0 months, 0 days"
|
||||
msgstr "0 سنة، 0 شهر، 0 يوم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "%s months"
|
||||
msgstr "%s شهر"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "%s day(s)"
|
||||
msgstr "%s يوم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "%s days"
|
||||
msgstr "%s يوم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "%s month(s)"
|
||||
msgstr "%s شهر"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "%s year(s)"
|
||||
msgstr "%s سنة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_members.py:0
|
||||
#, python-format
|
||||
msgid "0 days"
|
||||
msgstr "0 يوم"
|
||||
|
|
@ -2321,7 +2321,7 @@ class GrantBenefitProfile(models.Model):
|
|||
income = family_income
|
||||
ben.member_income = round(income, 0)
|
||||
|
||||
@api.depends("member_income")
|
||||
@api.depends("member_income", "benefit_member_count")
|
||||
def get_benefit_category(self):
|
||||
default_category = self.env['benefit.category'].sudo().search(
|
||||
[('is_benefit', '=', False)], limit=1
|
||||
|
|
@ -2698,9 +2698,9 @@ class GrantBenefitProfile(models.Model):
|
|||
def update_data_automatically(self):
|
||||
obj = self.env["grant.benefit"].search([])
|
||||
for member in obj.member_ids:
|
||||
# member._compute_get_age_date()
|
||||
member._compute_get_age_date()
|
||||
member.check_member_status()
|
||||
self.action_auto_suspend()
|
||||
#self.action_auto_suspend()
|
||||
|
||||
|
||||
class BenefitFollowers(models.Model):
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ class FamilyMemberProfile(models.Model):
|
|||
# member_location = fields.Many2one('member.location', string="Member Location")
|
||||
birth_date = fields.Date(string="Birth Date")
|
||||
age = fields.Integer(string="Age", compute='_compute_get_age_date', store=True)
|
||||
full_age = fields.Char(string="Full Age",compute='_compute_get_age_date',store=True)
|
||||
age_status = fields.Selection(
|
||||
[('minor', 'Minor'), ('non_minor', 'Non-Minor')],
|
||||
string='Age Status',
|
||||
|
|
@ -702,20 +703,20 @@ class FamilyMemberProfile(models.Model):
|
|||
_("Over %s years old and not enrolled in a scientific or vocational specialization.")
|
||||
% exceptional_age_scientific_specialty
|
||||
)
|
||||
if rec.is_work:
|
||||
if rec.member_income > max_income_for_benefit:
|
||||
rec.member_status = 'non_benefit'
|
||||
reasons.append(_("He is employed with a salary exceeding %s.") % max_income_for_benefit)
|
||||
if not rec.is_married and rec.education_status in ['illiterate']:
|
||||
rec.member_status = 'non_benefit'
|
||||
reasons.append(
|
||||
_("He is over %s years of age and not enrolled in an educational institution.") % male_benefit_age)
|
||||
if not rec.is_married and rec.education_status in [
|
||||
'educated'] and rec.case_study in [
|
||||
'graduate', 'intermittent']:
|
||||
rec.member_status = 'non_benefit'
|
||||
reasons.append(
|
||||
_("He is over %s years of age and has completed his education.") % male_benefit_age)
|
||||
if rec.is_work:
|
||||
if rec.member_income > max_income_for_benefit:
|
||||
rec.member_status = 'non_benefit'
|
||||
reasons.append(_("He is employed with a salary exceeding %s.") % max_income_for_benefit)
|
||||
if not rec.is_married and rec.education_status in ['illiterate']:
|
||||
rec.member_status = 'non_benefit'
|
||||
reasons.append(
|
||||
_("He is over %s years of age and not enrolled in an educational institution.") % male_benefit_age)
|
||||
if not rec.is_married and rec.education_status in [
|
||||
'educated'] and rec.case_study in [
|
||||
'graduate', 'intermittent']:
|
||||
rec.member_status = 'non_benefit'
|
||||
reasons.append(
|
||||
_("He is over %s years of age and has completed his education.") % male_benefit_age)
|
||||
if not rec.member_location_conf.is_benefit:
|
||||
rec.member_status = 'non_benefit'
|
||||
reasons.append(_("He does not reside with his family."))
|
||||
|
|
@ -871,14 +872,26 @@ class FamilyMemberProfile(models.Model):
|
|||
|
||||
@api.depends('birth_date')
|
||||
def _compute_get_age_date(self):
|
||||
today = date.today()
|
||||
for rec in self:
|
||||
if rec.birth_date:
|
||||
today = date.today()
|
||||
day = datetime.strptime(str(rec.birth_date), DEFAULT_SERVER_DATE_FORMAT)
|
||||
age = rd(today, day)
|
||||
rec.age = age.years
|
||||
else:
|
||||
if not rec.birth_date:
|
||||
rec.age = 0
|
||||
rec.full_age = _("0 years, 0 months, 0 days")
|
||||
continue
|
||||
birth = fields.Date.from_string(rec.birth_date)
|
||||
delta = rd(today, birth)
|
||||
|
||||
years = delta.years
|
||||
months = delta.months
|
||||
days = delta.days
|
||||
|
||||
rec.age = years
|
||||
parts = []
|
||||
parts.append(_("%s year(s)") % years if years == 1 else _("%s years") % years)
|
||||
parts.append(_("%s month(s)") % months if months == 1 else _("%s months") % months)
|
||||
parts.append(_("%s day(s)") % days if days == 1 else _("%s days") % days)
|
||||
|
||||
rec.full_age = ", ".join(parts) if parts else _("0 days")
|
||||
|
||||
@api.onchange("member_id_number")
|
||||
def onchange_member_id_number(self):
|
||||
|
|
|
|||
|
|
@ -67,6 +67,12 @@
|
|||
<field name="implied_ids" eval="[(4, ref('group_benefit_researcher'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="group_family_member_exception" model="res.groups">
|
||||
<field name="name">Family Member Exception</field>
|
||||
<field name="category_id" ref="module_category_benefit"/>
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="group_benefit_woman_commitee" model="res.groups">
|
||||
<field name="name">Head of the Women's Committee</field>
|
||||
<field name="category_id" ref="module_category_benefit"/>
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@
|
|||
<button name="action_exception" type="object"
|
||||
string="Temporarily Exception" class="oe_highlight"
|
||||
confirm="Are you sure you want to move to Temporarily Exception ?"
|
||||
groups="!odex_benefit.group_benefit_supervisor"
|
||||
groups="!odex_benefit.group_family_member_exception"
|
||||
attrs="{'invisible': ['|',('member_status','=','benefit'),('can_request_temporary_exception','=',False)]}"/>
|
||||
<button name="action_exception" type="object"
|
||||
string="Temporarily Exception" class="oe_highlight"
|
||||
confirm="Are you sure you want to move to Temporarily Exception ?"
|
||||
groups="odex_benefit.group_benefit_supervisor"
|
||||
groups="odex_benefit.group_family_member_exception"
|
||||
attrs="{'invisible': [('member_status','=','benefit')]}"/>
|
||||
<button name="action_exception_first_accept" type="object"
|
||||
string="Exception First Approve" class="oe_highlight"
|
||||
|
|
@ -150,7 +150,8 @@
|
|||
<field name="exit_benefit_date" readonly="1" force_save="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="age" readonly="1" required="1" force_save="1"/>
|
||||
<field name="age" invisible="1" readonly="1" required="1" force_save="1"/>
|
||||
<field name="full_age" force_save="1"/>
|
||||
<field name="age_status"
|
||||
attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
|
||||
<field name="member_id_number"
|
||||
|
|
@ -365,7 +366,8 @@
|
|||
<field name="last_education_levels" optional="hide"/>
|
||||
<field name="case_study" optional="show"/>
|
||||
<field name="is_excluded_suspension"/>
|
||||
<field name="age"/>
|
||||
<field name="age" optional="hide"/>
|
||||
<field name="full_age"/>
|
||||
<field name="benefit_id" optional="hide"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="state" widget="badge" decoration-success="state in ['first_approve', 'second_approve']"
|
||||
|
|
|
|||
Loading…
Reference in New Issue