Merge pull request #4731 from expsa/younes_dev_odex25_ensan
IMP benefit
This commit is contained in:
commit
ab62c42987
|
|
@ -177,9 +177,9 @@
|
|||
attrs="{'invisible':[('is_dead','=',False)]}"/>
|
||||
<!-- <field name="gender" required="1"/>-->
|
||||
<field name="member_location" force_save="1" invisible="1"/>
|
||||
<field name="member_location_conf"
|
||||
options="{'no_create': True, 'no_create_edit': True}"
|
||||
attrs="{'required':[('is_mother','=',False)]}"/>
|
||||
<field name="relationn_type" invisible="1"/>
|
||||
<field name="member_location_conf" required="1" domain="[('location_type', '=', relationn_type in ['mother','replacement_mother'] and 'mother_location' or 'member')]"
|
||||
options="{'no_create': True, 'no_create_edit': True}"/>
|
||||
<field name="is_work" attrs="{'invisible':[('age','<',18)]}"/>
|
||||
<field name="member_income"
|
||||
attrs="{'invisible':['|',('age','<',18),('is_work','=',False)], 'required':[('is_work','=',True)]}"/>
|
||||
|
|
|
|||
|
|
@ -425,9 +425,9 @@
|
|||
attrs="{'invisible':[('is_dead','=',False)]}"/>
|
||||
<!-- <field name="gender" required="1"/>-->
|
||||
<field name="member_location" force_save="1" invisible="1"/>
|
||||
<field name="member_location_conf"
|
||||
options="{'no_create': True, 'no_create_edit': True}"
|
||||
attrs="{'required':[('is_mother','=',False)]}"/>
|
||||
<field name="relationn_type" invisible="1"/>
|
||||
<field name="member_location_conf" required="1" domain="[('location_type', '=', relationn_type in ['mother','replacement_mother'] and 'mother_location' or 'member')]"
|
||||
options="{'no_create': True, 'no_create_edit': True}"/>
|
||||
<field name="is_work" attrs="{'invisible':[('age','<',18)]}"/>
|
||||
<field name="member_income"
|
||||
attrs="{'invisible':['|',('age','<',18),('is_work','=',False)], 'required':[('is_work','=',True)]}"/>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
'data/server_actions.xml',
|
||||
'data/email_temps.xml',
|
||||
'data/visits_types_data.xml',
|
||||
|
||||
'views/template.xml',
|
||||
'views/benefit_view.xml',
|
||||
'views/users_inherit.xml',
|
||||
'views/committees_view.xml',
|
||||
|
|
|
|||
|
|
@ -2263,11 +2263,6 @@ msgstr "فرد مستفيد"
|
|||
msgid "Benefit Member count"
|
||||
msgstr "عدد المستفيدين"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Benefit Members Count"
|
||||
msgstr "عدد أفراد الأسرة المستفيدين"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Benefit Mother"
|
||||
|
|
@ -8331,7 +8326,6 @@ msgid "MotherFamily Name"
|
|||
msgstr "اسم عائلة الأم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid "Move Lines"
|
||||
msgstr "المستحقات الشهرية للأسرة"
|
||||
|
|
@ -8713,11 +8707,6 @@ msgstr "الأم غير مستفيدة"
|
|||
msgid "Non Benefit Replacement Mother"
|
||||
msgstr "غير مستفيدة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Non Benfit Members Count"
|
||||
msgstr "عدد أفراد الأسرة الغير المستفيدين"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#, python-format
|
||||
|
|
@ -15602,4 +15591,23 @@ msgstr ""
|
|||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#, python-format
|
||||
msgid "Short Number must be 4 letters followed by 4 digits (e.g., ABCD1234)."
|
||||
msgstr "يجب أن يتكون الرمز المختصر من 4 أحرف تليها 4 أرقام (مثال: ABCD1234)."
|
||||
msgstr "يجب أن يتكون الرمز المختصر من 4 أحرف تليها 4 أرقام (مثال: ABCD1234)."
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
#, python-format
|
||||
msgid "Benefit Members"
|
||||
msgstr "الأفراد المستفيدين"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
#, python-format
|
||||
msgid "Non Benefit Members"
|
||||
msgstr "الأفراد غير المستفيدين"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "<span class=\"o_stat_text\">Monthly expense</span>"
|
||||
msgstr "<span class=\"o_stat_text\">المصروف الشهري</span>"
|
||||
|
|
@ -844,6 +844,29 @@ class GrantBenefitProfile(models.Model):
|
|||
'total_move_lines': self.env['account.move.line'].search_count([('benefit_family_id', '=', rec.id)])
|
||||
})
|
||||
|
||||
def action_view_benefit_members(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Benefit Members'),
|
||||
'res_model': 'family.member',
|
||||
'view_mode': 'tree,form',
|
||||
'domain': [('id', 'in', self.member_ids.filtered(lambda m: m.member_status == 'benefit').ids)],
|
||||
'target': 'current',
|
||||
}
|
||||
|
||||
def action_view_non_benefit_members(self):
|
||||
self.ensure_one()
|
||||
action = {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Non Benefit Members'),
|
||||
'res_model': 'family.member',
|
||||
'view_mode': 'tree,form',
|
||||
'domain': [('id', 'in', self.member_ids.filtered(lambda m: m.member_status == 'non_benefit').ids)],
|
||||
'target': 'current',
|
||||
}
|
||||
return action
|
||||
|
||||
def action_open_related_move_line_records(self):
|
||||
""" Opens a tree view with related records filtered by a dynamic domain """
|
||||
move_lines = self.env['account.move.line'].search([
|
||||
|
|
@ -1790,6 +1813,8 @@ class GrantBenefitProfile(models.Model):
|
|||
'mother_status',
|
||||
'replacement_mother_income',
|
||||
'replacement_mother_status',
|
||||
'mother_income',
|
||||
'mother_status',
|
||||
'salary_ids.salary_amount',
|
||||
'salary_ids.approved',
|
||||
)
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class FamilyMemberProfile(models.Model):
|
|||
('suspended_second_approve', 'Suspended Second Approved'),
|
||||
('exception_second_approve', 'Waiting for General Manager'),
|
||||
('black_list', 'Black List'),
|
||||
], string='state', tracking=True,compute='_get_state',store = True)
|
||||
], string='state', tracking=True,compute='_get_state',store = True, group_expand='_expand_states')
|
||||
state_a = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('new', 'Researcher Assignment'),
|
||||
|
|
@ -262,13 +262,8 @@ class FamilyMemberProfile(models.Model):
|
|||
# )
|
||||
# return super(FamilyMemberProfile, self).write(vals)
|
||||
|
||||
|
||||
@api.onchange('relationn_type')
|
||||
def _onchange_relationn_type(self):
|
||||
if self.relationn_type in ['mother', 'replacement_mother']:
|
||||
return {'domain': {'member_location_conf': [('location_type', '=', 'mother_location')]}}
|
||||
else:
|
||||
return {'domain': {'member_location_conf': [('location_type', '=', 'member')]}}
|
||||
def _expand_states(self, states, domain, order):
|
||||
return [key for key, val in type(self).state.selection]
|
||||
|
||||
@api.onchange('age')
|
||||
def _check_son_daughter_age(self):
|
||||
|
|
@ -288,7 +283,7 @@ class FamilyMemberProfile(models.Model):
|
|||
def _compute_minor_siblings(self):
|
||||
for member in self:
|
||||
member.minor_siblings = any(
|
||||
m.age_status == 'minor' and not m.is_dead
|
||||
m.age_status == 'minor' and m.member_status == 'benefit'
|
||||
for m in member.benefit_id.member_ids
|
||||
)
|
||||
|
||||
|
|
@ -490,6 +485,7 @@ class FamilyMemberProfile(models.Model):
|
|||
male_benefit_age = validation_setting.male_benefit_age
|
||||
exceptional_age_scientific_specialty = validation_setting.exceptional_age_scientific_specialty
|
||||
exceptional_age_medical_specialty = validation_setting.exceptional_age_medical_specialty
|
||||
exceptional_age_has_disabilities = validation_setting.exceptional_age_has_disabilities
|
||||
minor_siblings_age = validation_setting.minor_siblings_age
|
||||
max_income_for_benefit = validation_setting.max_income_for_benefit
|
||||
rec.member_status = 'benefit' # Default to benefit
|
||||
|
|
@ -509,7 +505,9 @@ class FamilyMemberProfile(models.Model):
|
|||
# Gender-specific checks
|
||||
elif rec.relationn.relation_type == 'son':
|
||||
if rec.age > male_benefit_age:
|
||||
if current_education_status_id.specialization_ids.is_scientific_specialty and rec.age > exceptional_age_scientific_specialty and not rec.minor_siblings :
|
||||
if rec.age > exceptional_age_has_disabilities and rec.disabilities_attachment_ids:
|
||||
rec.member_status = 'non_benefit'
|
||||
elif current_education_status_id.specialization_ids.is_scientific_specialty and rec.age > exceptional_age_scientific_specialty and not rec.minor_siblings :
|
||||
rec.member_status = 'non_benefit'
|
||||
elif current_education_status_id.specialization_ids.is_medical_specialty and rec.age > exceptional_age_medical_specialty and not rec.minor_siblings:
|
||||
rec.member_status = 'non_benefit'
|
||||
|
|
@ -520,9 +518,9 @@ class FamilyMemberProfile(models.Model):
|
|||
if rec.is_work:
|
||||
if rec.member_income > max_income_for_benefit:
|
||||
rec.member_status = 'non_benefit'
|
||||
if not rec.is_married and current_education_status_id.education_status in ['illiterate']:
|
||||
if not rec.is_married and rec.education_status in ['illiterate']:
|
||||
rec.member_status = 'non_benefit'
|
||||
if not rec.is_married and current_education_status_id.education_status in ['educated'] and current_education_status_id.case_study in [
|
||||
if not rec.is_married and rec.education_status in ['educated'] and current_education_status_id.case_study in [
|
||||
'graduate', 'intermittent']:
|
||||
rec.member_status = 'non_benefit'
|
||||
if not rec.member_location_conf.is_benefit:
|
||||
|
|
@ -532,7 +530,7 @@ class FamilyMemberProfile(models.Model):
|
|||
elif rec.relationn.relation_type == 'daughter':
|
||||
if rec.age < female_benefit_age and rec.is_married:
|
||||
rec.member_status = 'non_benefit'
|
||||
if rec.age < female_benefit_age and rec.is_work and current_education_status_id.education_status not in ['educated'] and current_education_status_id.case_study != 'continuous':
|
||||
if rec.age < female_benefit_age and rec.is_work and rec.education_status not in ['educated'] and current_education_status_id.case_study != 'continuous':
|
||||
rec.member_status = 'non_benefit'
|
||||
if rec.age > female_benefit_age:
|
||||
if rec.age > minor_siblings_age and not rec.minor_siblings:
|
||||
|
|
@ -548,11 +546,11 @@ class FamilyMemberProfile(models.Model):
|
|||
rec.member_status = 'non_benefit'
|
||||
# elif not rec.minor_siblings:
|
||||
# rec.member_status = 'non_benefit'
|
||||
if rec.is_work and rec.member_income > max_income_for_benefit and current_education_status_id.education_status in ['educated'] and current_education_status_id.case_study == 'continuous':
|
||||
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':
|
||||
rec.member_status = 'non_benefit'
|
||||
if rec.is_work and current_education_status_id.education_status in ['illiterate'] :
|
||||
if rec.is_work and rec.education_status in ['illiterate'] :
|
||||
rec.member_status = 'non_benefit'
|
||||
if rec.is_work and current_education_status_id.education_status in ['educated'] and current_education_status_id.case_study in [
|
||||
if rec.is_work and rec.education_status in ['educated'] and current_education_status_id.case_study in [
|
||||
'graduate', 'intermittent']:
|
||||
rec.member_status = 'non_benefit'
|
||||
if not rec.member_location_conf.is_benefit:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
.custom_stat_value .o_stat_value {
|
||||
color: #FF0000 !important;
|
||||
}
|
||||
|
|
@ -223,15 +223,24 @@
|
|||
<button class="oe_stat_button" name="view_attachments" type="object" icon="fa-file-text-o">
|
||||
<field string="Documents" name="doc_count" widget="statinfo"/>
|
||||
</button>
|
||||
<button icon="fa-users">
|
||||
<field string="Benefit Members Count" name="benefit_member_count" widget="statinfo"/>
|
||||
<button name="action_view_benefit_members" type="object" icon="fa-users">
|
||||
<field string="Benefit Members" name="benefit_member_count" widget="statinfo"/>
|
||||
</button>
|
||||
|
||||
<button icon="fa-users">
|
||||
<field string="Non Benfit Members Count" name="non_member_count" widget="statinfo"/>
|
||||
<button name="action_view_non_benefit_members" type="object" icon="fa-users">
|
||||
<field string="Non Benefit Members" name="non_member_count" class="custom_stat_value"
|
||||
widget="statinfo"/>
|
||||
</button>
|
||||
<button icon="fa-usd" name="action_open_related_move_line_records" type="object">
|
||||
<field name="total_move_lines" string="Move Lines" widget="statinfo"/>
|
||||
<button icon="fa-list-ul" name="action_open_related_move_line_records" type="object">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<div class="oe_inline">
|
||||
<span class="o_stat_value">
|
||||
<field name="total_expenses" nolabel="1" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
</div>
|
||||
<span class="o_stat_text">Monthly expense</span>
|
||||
</div>
|
||||
</button>
|
||||
<button type="object" name="action_open_visit_location" icon="fa-calendar">
|
||||
<field name="visit_location_count" widget="statinfo" string="Visit location"/>
|
||||
|
|
@ -782,8 +791,8 @@
|
|||
<field name="member_phone"
|
||||
attrs="{'invisible':[('is_mother','=',True)]}"/>
|
||||
<field name="member_location" force_save="1" invisible="1"/>
|
||||
<field name="member_location_conf"
|
||||
attrs="{'required':[('is_mother','=',False)]}"
|
||||
<field name="member_location_conf" required="1"
|
||||
domain="[('location_type', '=', relationn_type in ['mother','replacement_mother'] and 'mother_location' or 'member')]"
|
||||
options="{'no_create': True, 'no_create_edit': True}"
|
||||
/>
|
||||
</group>
|
||||
|
|
|
|||
|
|
@ -104,8 +104,9 @@
|
|||
<field name="member_phone"
|
||||
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
|
||||
<field name="relationn_type" invisible="1"/>
|
||||
<field name="member_location_conf"
|
||||
attrs="{'required':[('relationn_type','not in',('mother','replacement_mother'))],'readonly':[('state','not in',['draft','complete_info'])]}"/>
|
||||
<field name="member_location_conf" required="1" domain="[('location_type', '=', relationn_type in ['mother','replacement_mother'] and 'mother_location' or 'member')]"
|
||||
options="{'no_create': True, 'no_create_edit': True}"
|
||||
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="age" readonly="1" required="1" force_save="1"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<template id="custom_assets_backend" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" type="text/scss" href="/odex_benefit/static/src/scss/custom_style.scss"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Loading…
Reference in New Issue