IMP benefit

This commit is contained in:
younes 2025-09-21 13:41:38 +01:00
parent 3bd8c8fcc7
commit 729ed1b5d4
7 changed files with 101 additions and 74 deletions

View File

@ -177,8 +177,9 @@
attrs="{'invisible':[('is_dead','=',False)]}"/> attrs="{'invisible':[('is_dead','=',False)]}"/>
<!-- <field name="gender" required="1"/>--> <!-- <field name="gender" required="1"/>-->
<field name="member_location" force_save="1" invisible="1"/> <field name="member_location" force_save="1" invisible="1"/>
<field name="member_location_conf" force_save="1" <field name="member_location_conf"
attrs="{'required':[('is_mother','=',False)],'invisible':[('is_mother','=',True)]}"/> options="{'no_create': True, 'no_create_edit': True}"
attrs="{'required':[('is_mother','=',False)]}"/>
<field name="is_work" attrs="{'invisible':[('age','&lt;',18)]}"/> <field name="is_work" attrs="{'invisible':[('age','&lt;',18)]}"/>
<field name="member_income" <field name="member_income"
attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)], 'required':[('is_work','=',True)]}"/> attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)], 'required':[('is_work','=',True)]}"/>
@ -215,10 +216,6 @@
options="{'no_create': True, 'no_create_edit': True}" options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/> groups="!odex_benefit.group_benefit_manager"/>
<field name="mother_location" invisible="1"/> <field name="mother_location" invisible="1"/>
<field name="mother_location_conf"
attrs="{'invisible':[('is_mother','=',False)]}"
options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/>
</group> </group>
</group> </group>
<notebook> <notebook>

View File

@ -425,8 +425,9 @@
attrs="{'invisible':[('is_dead','=',False)]}"/> attrs="{'invisible':[('is_dead','=',False)]}"/>
<!-- <field name="gender" required="1"/>--> <!-- <field name="gender" required="1"/>-->
<field name="member_location" force_save="1" invisible="1"/> <field name="member_location" force_save="1" invisible="1"/>
<field name="member_location_conf" force_save="1" <field name="member_location_conf"
attrs="{'required':[('is_mother','=',False)],'invisible':[('is_mother','=',True)]}"/> options="{'no_create': True, 'no_create_edit': True}"
attrs="{'required':[('is_mother','=',False)]}"/>
<field name="is_work" attrs="{'invisible':[('age','&lt;',18)]}"/> <field name="is_work" attrs="{'invisible':[('age','&lt;',18)]}"/>
<field name="member_income" <field name="member_income"
attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)], 'required':[('is_work','=',True)]}"/> attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)], 'required':[('is_work','=',True)]}"/>
@ -468,10 +469,6 @@
options="{'no_create': True, 'no_create_edit': True}" options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/> groups="!odex_benefit.group_benefit_manager"/>
<field name="mother_location" invisible="1"/> <field name="mother_location" invisible="1"/>
<field name="mother_location_conf"
attrs="{'invisible':[('is_mother','=',False)]}"
options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/>
</group> </group>
</group> </group>
<notebook> <notebook>

View File

@ -1512,12 +1512,14 @@ msgstr "موافقة"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__approved #: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__approved
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__action_type__approved
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Approved" msgid "Approved"
msgstr "معتمد" msgstr "معتمد"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__suspended #: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__suspended
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__action_type__suspended
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Suspended" msgid "Suspended"
msgstr "ايقاف" msgstr "ايقاف"
@ -4589,6 +4591,7 @@ msgstr "بانتظار الاسرة"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_sms_configuration__state__edit_info #: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_sms_configuration__state__edit_info
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__action_type__edit_info
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__edit_info #: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__edit_info
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Edit Information" msgid "Edit Information"
@ -4892,6 +4895,7 @@ msgstr "استثنائية"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__exception #: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__exception
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__action_type__exception
msgid "Exception" msgid "Exception"
msgstr "استثناء" msgstr "استثناء"
@ -8242,7 +8246,6 @@ msgstr "دخل الأم"
#. module: odex_benefit #. module: odex_benefit
#: code:addons/odex_benefit/models/benefit_config.py:0 #: code:addons/odex_benefit/models/benefit_config.py:0
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__mother_location #: model:ir.model.fields,field_description:odex_benefit.field_family_member__mother_location
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__mother_location_conf
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__mother_location #: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__mother_location
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__mother_location_conf #: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__mother_location_conf
#: model:ir.model.fields.selection,name:odex_benefit.selection__location_settings__location_type__mother_location #: model:ir.model.fields.selection,name:odex_benefit.selection__location_settings__location_type__mother_location
@ -12256,6 +12259,7 @@ msgstr "اسناد الاخصائي"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__new #: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__new
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__action_type__new
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
#, python-format #, python-format
msgid "New" msgid "New"
@ -14832,6 +14836,7 @@ msgstr ""
"%s يجب أن يحتوي فقط على الأحرف الأبجدية والمسافات. الأرقام والرموز الخاصة غير مسموح بها." "%s يجب أن يحتوي فقط على الأحرف الأبجدية والمسافات. الأرقام والرموز الخاصة غير مسموح بها."
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__action_type
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__action_type #: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__action_type
msgid "Action Type" msgid "Action Type"
msgstr "نوع الإجراء" msgstr "نوع الإجراء"
@ -15547,3 +15552,8 @@ msgstr ""
"</div>\n" "</div>\n"
" " " "
#. module: odex_benefit
#: 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)."

View File

@ -1872,7 +1872,7 @@ class GrantBenefitProfile(models.Model):
'gender': 'female', 'gender': 'female',
'relationn': Relation.id, 'relationn': Relation.id,
'mother_marital_conf': rec.mother_marital_conf.id, 'mother_marital_conf': rec.mother_marital_conf.id,
'mother_location_conf': rec.mother_location_conf.id, 'member_location_conf': rec.mother_location_conf.id,
'age': rec.mother_age, 'age': rec.mother_age,
'is_work': rec.is_mother_work, 'is_work': rec.is_mother_work,
'member_income': rec.mother_income, 'member_income': rec.mother_income,
@ -1909,7 +1909,7 @@ class GrantBenefitProfile(models.Model):
'gender': 'female', 'gender': 'female',
'relationn': rec.replacement_mother_relation.id, 'relationn': rec.replacement_mother_relation.id,
'mother_marital_conf': rec.replacement_mother_marital_conf.id, 'mother_marital_conf': rec.replacement_mother_marital_conf.id,
'mother_location_conf': rec.replacement_mother_location_conf.id, 'member_location_conf': rec.replacement_mother_location_conf.id,
'age': rec.replacement_mother_age, 'age': rec.replacement_mother_age,
'is_work': rec.replacement_is_mother_work, 'is_work': rec.replacement_is_mother_work,
'member_income': rec.replacement_mother_income, 'member_income': rec.replacement_mother_income,

View File

@ -42,7 +42,7 @@ class FamilyMemberProfile(models.Model):
('study_inside_saudi_arabia', 'Study Inside Saudi Arabia'),('study_outside_saudi_arabia', 'Study Outside Saudi Arabia'), ('study_inside_saudi_arabia', 'Study Inside Saudi Arabia'),('study_outside_saudi_arabia', 'Study Outside Saudi Arabia'),
('rehabilitation_center_for_the_disabled', 'Rehabilitation center for the disabled'),('house_of_social_observations', 'House of Social Observations'), ('rehabilitation_center_for_the_disabled', 'Rehabilitation center for the disabled'),('house_of_social_observations', 'House of Social Observations'),
('girls_home','Girls Home'),('university_housing','University Housing'),('with_husband','With_husband'),('work_inside_saudi_arabia','Work Inside Saudi Arabia')], string="Member Location") ('girls_home','Girls Home'),('university_housing','University Housing'),('with_husband','With_husband'),('work_inside_saudi_arabia','Work Inside Saudi Arabia')], string="Member Location")
member_location_conf = fields.Many2one('location.settings',string='Member Location',domain="[('location_type','=','member')]") member_location_conf = fields.Many2one('location.settings',string='Member Location')
# member_location = fields.Many2one('member.location', string="Member Location") # member_location = fields.Many2one('member.location', string="Member Location")
birth_date = fields.Date(string="Birth Date") birth_date = fields.Date(string="Birth Date")
age = fields.Integer(string="Age", compute='_compute_get_age_date',store=True) age = fields.Integer(string="Age", compute='_compute_get_age_date',store=True)
@ -59,6 +59,7 @@ class FamilyMemberProfile(models.Model):
is_married = fields.Boolean('Is Married?') is_married = fields.Boolean('Is Married?')
marriage_certificate = fields.Many2many('ir.attachment','member_marriage_cert_rel','member_id','attachment_id',string="Marriage Certificate") marriage_certificate = fields.Many2many('ir.attachment','member_marriage_cert_rel','member_id','attachment_id',string="Marriage Certificate")
relationn = fields.Many2one('relation.settings',domain="['|',('relation_type','=','son'),('relation_type','=','daughter')]",string="Relation") relationn = fields.Many2one('relation.settings',domain="['|',('relation_type','=','son'),('relation_type','=','daughter')]",string="Relation")
relationn_type = fields.Selection(related="relationn.relation_type")
relation = fields.Selection( relation = fields.Selection(
[('son', _('Son')), ('daughter', _('Daughter'))]) [('son', _('Son')), ('daughter', _('Daughter'))])
mother_marital = fields.Selection( mother_marital = fields.Selection(
@ -69,7 +70,6 @@ class FamilyMemberProfile(models.Model):
mother_location = fields.Selection( mother_location = fields.Selection(
[('with_husband_and_children', _('With Husband And Children')), ('with_children', _('With Children')), [('with_husband_and_children', _('With Husband And Children')), ('with_children', _('With Children')),
('not_live_with_children', _('Not live with children'))], string='Mother Location') ('not_live_with_children', _('Not live with children'))], string='Mother Location')
mother_location_conf = fields.Many2one('location.settings',string='Mother Location',domain="[('location_type','=','mother_location')]")
attachment_ids = fields.One2many("ir.attachment",'member_id',domain=[('hobbies_id', '=', False),('diseases_id', '=', False),('disabilities_id', '=', False)]) attachment_ids = fields.One2many("ir.attachment",'member_id',domain=[('hobbies_id', '=', False),('diseases_id', '=', False),('disabilities_id', '=', False)])
hobbies_attachment_ids = fields.One2many('ir.attachment', 'member_id', string='Hobbies Attachments',domain=[('hobbies_id', '!=', False)]) hobbies_attachment_ids = fields.One2many('ir.attachment', 'member_id', string='Hobbies Attachments',domain=[('hobbies_id', '!=', False)])
diseases_attachment_ids = fields.One2many('ir.attachment', 'member_id', string='Diseases Attachments',domain=[('diseases_id', '!=', False)]) diseases_attachment_ids = fields.One2many('ir.attachment', 'member_id', string='Diseases Attachments',domain=[('diseases_id', '!=', False)])
@ -204,7 +204,6 @@ class FamilyMemberProfile(models.Model):
('first_refusal', 'First Refusal'), ('first_refusal', 'First Refusal'),
('second_approve', 'Second Approved'), ('second_approve', 'Second Approved'),
('refused', 'Refused'), ('refused', 'Refused'),
('suspended_second_approve', 'Suspended Second Approved'), ('suspended_second_approve', 'Suspended Second Approved'),
('exception_second_approve', 'Waiting for General Manager'), ('exception_second_approve', 'Waiting for General Manager'),
('black_list', 'Black List'), ('black_list', 'Black List'),
@ -262,6 +261,13 @@ class FamilyMemberProfile(models.Model):
# _("You should at least insert one current/previous education status!") # _("You should at least insert one current/previous education status!")
# ) # )
# return super(FamilyMemberProfile, self).write(vals) # 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')]}}
@api.depends('age_status', 'is_dead','benefit_id.member_ids.age_status','benefit_id.member_ids.is_dead') @api.depends('age_status', 'is_dead','benefit_id.member_ids.age_status','benefit_id.member_ids.is_dead')
def _compute_minor_siblings(self): def _compute_minor_siblings(self):

View File

@ -430,11 +430,14 @@
<div class="o_row"> <div class="o_row">
<field name="mother_name" nolabel="1" placeholder="First Name" required="1" <field name="mother_name" nolabel="1" placeholder="First Name" required="1"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="mother_second_name" nolabel="1" placeholder="Second Name" required="1" <field name="mother_second_name" nolabel="1" placeholder="Second Name"
required="1"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="mother_third_name" nolabel="1" placeholder="Third Name" required="1" <field name="mother_third_name" nolabel="1" placeholder="Third Name"
required="1"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="mother_family_name" nolabel="1" placeholder="Family Name" required="1" <field name="mother_family_name" nolabel="1" placeholder="Family Name"
required="1"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
</div> </div>
</group> </group>
@ -512,8 +515,8 @@
<field name="is_mother_work" <field name="is_mother_work"
attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="mother_salary_certificate" <field name="mother_salary_certificate"
widget="many2many_attachment_preview" widget="many2many_attachment_preview"
attrs="{'invisible':[('is_mother_work','=',False)]}"/> attrs="{'invisible':[('is_mother_work','=',False)]}"/>
<field name="mother_has_disabilities" invisible="1"/> <field name="mother_has_disabilities" invisible="1"/>
<field name="mother_income" widget="monetary" <field name="mother_income" widget="monetary"
options="{'currency_field': 'currency_id', 'field_digits': False}" options="{'currency_field': 'currency_id', 'field_digits': False}"
@ -569,9 +572,11 @@
</page> </page>
<page string="Replacement Mother" <page string="Replacement Mother"
attrs="{'invisible':[('add_replacement_mother','=',False)]}"> attrs="{'invisible':[('add_replacement_mother','=',False)]}">
<widget invisible="1" name="web_ribbon" title="Non Benefit Replacement Mother" bg_color="bg-danger" <widget invisible="1" name="web_ribbon" title="Non Benefit Replacement Mother"
bg_color="bg-danger"
attrs="{'invisible': [('replacement_mother_status', '!=', 'non_benefit')]}"/> attrs="{'invisible': [('replacement_mother_status', '!=', 'non_benefit')]}"/>
<widget invisible="1" name="web_ribbon" title="Benefit Replacement Mother" bg_color="bg-success" <widget invisible="1" name="web_ribbon" title="Benefit Replacement Mother"
bg_color="bg-success"
attrs="{'invisible': [('replacement_mother_status', '!=', 'benefit')]}"/> attrs="{'invisible': [('replacement_mother_status', '!=', 'benefit')]}"/>
<group> <group>
<group> <group>
@ -668,8 +673,8 @@
<field name="replacement_is_mother_work" <field name="replacement_is_mother_work"
attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="replacement_mother_salary_certificate" <field name="replacement_mother_salary_certificate"
widget="many2many_attachment_preview" widget="many2many_attachment_preview"
attrs="{'invisible':[('replacement_is_mother_work','=',False)]}"/> attrs="{'invisible':[('replacement_is_mother_work','=',False)]}"/>
<field name="replacement_mother_has_disabilities" <field name="replacement_mother_has_disabilities"
attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="replacement_mother_income" <field name="replacement_mother_income"
@ -733,7 +738,9 @@
<widget name="web_ribbon" title="Benefit Member" bg_color="bg-success" <widget name="web_ribbon" title="Benefit Member" bg_color="bg-success"
attrs="{'invisible': [('member_status', '!=', 'benefit')]}"/> attrs="{'invisible': [('member_status', '!=', 'benefit')]}"/>
<group> <group>
<field name="relationn_type" invisible="1"/>
<label for="relationn" string="Relation"/> <label for="relationn" string="Relation"/>
<div> <div>
<field name="relationn" class="oe_inline" nolabel="1" <field name="relationn" class="oe_inline" nolabel="1"
attrs="{'readonly':[('parent.state','not in',['draft','new','complete_info'])]}" attrs="{'readonly':[('parent.state','not in',['draft','new','complete_info'])]}"
@ -775,8 +782,10 @@
<field name="member_phone" <field name="member_phone"
attrs="{'invisible':[('is_mother','=',True)]}"/> attrs="{'invisible':[('is_mother','=',True)]}"/>
<field name="member_location" force_save="1" invisible="1"/> <field name="member_location" force_save="1" invisible="1"/>
<field name="member_location_conf" force_save="1" <field name="member_location_conf"
attrs="{'required':[('is_mother','=',False)],'invisible':[('is_mother','=',True)]}"/> attrs="{'required':[('is_mother','=',False)]}"
options="{'no_create': True, 'no_create_edit': True}"
/>
</group> </group>
<group> <group>
<field name="mother_second_name" force_save="1" <field name="mother_second_name" force_save="1"
@ -784,7 +793,8 @@
<field name="mother_family_name" force_save="1" <field name="mother_family_name" force_save="1"
attrs="{'invisible':[('is_mother','=',False)],'required':[('is_mother','=',True)]}"/> attrs="{'invisible':[('is_mother','=',False)],'required':[('is_mother','=',True)]}"/>
<field name="age" required="1"/> <field name="age" required="1"/>
<field name="age_status"/> <field name="age_status"
attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
<field name="member_id_number" required="1"/> <field name="member_id_number" required="1"/>
</group> </group>
</group> </group>
@ -794,31 +804,28 @@
<field name="death_certificate" <field name="death_certificate"
widget="many2many_attachment_preview" widget="many2many_attachment_preview"
attrs="{'invisible':[('is_dead','=',False)]}"/> attrs="{'invisible':[('is_dead','=',False)]}"/>
<field name="minor_siblings" readonly="1" force_save="1"/> <field name="minor_siblings"
<!--<field name="gender" required="1"/>--> attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"
readonly="1" force_save="1"/>
<field name="is_married" <field name="is_married"
attrs="{'invisible':[('is_mother','=',True)]}"/> attrs="{'invisible':[('is_mother','=',True)]}"/>
<field name="marriage_certificate" <field name="marriage_certificate"
widget="many2many_attachment_preview" widget="many2many_attachment_preview"
attrs="{'invisible':['|',('is_mother','=',True),('is_married','=',False)]}"/> attrs="{'invisible':['|',('is_mother','=',True),('is_married','=',False)]}"/>
<field name="mother_marital_conf" <field name="mother_marital_conf"
attrs="{'invisible':[('is_mother','=',False)]}" attrs="{'invisible':[('relationn_type','not in',('mother','replacement_mother'))]}"
options="{'no_create': True, 'no_create_edit': True}" options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/> groups="!odex_benefit.group_benefit_manager"/>
<field name="mother_location" invisible="1"/> <field name="mother_location" invisible="1"/>
<field name="mother_location_conf"
attrs="{'invisible':[('is_mother','=',False)]}"
options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/>
<field name="education_status"/> <field name="education_status"/>
</group> </group>
<group> <group>
<field name="is_work" attrs="{'invisible':[('age','&lt;',18)]}"/> <field name="is_work"/>
<field name="member_income" <field name="member_income"
attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)], 'required':[('is_work','=',True)]}"/> attrs="{'invisible':[('is_work','=',False)], 'required':[('is_work','=',True)]}"/>
<field name="salary_certificate" <field name="salary_certificate"
widget="many2many_attachment_preview" widget="many2many_attachment_preview"
attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)]}"/> attrs="{'invisible':[('is_work','=',False)]}"/>
</group> </group>
</group> </group>
<group> <group>
@ -930,12 +937,14 @@
</form> </form>
<tree string="Family Members"> <tree string="Family Members">
<field name="name" force_save="1"/> <field name="name" force_save="1"/>
<!-- <field name="gender" required="1"/>-->
<field name="relationn"/> <field name="relationn"/>
<field name="member_location_conf"/>
<field name="member_status"/>
<field name="age"/> <field name="age"/>
<field name="benefit_id"/> <field name="member_location_conf"/>
<field name="education_status"/>
<field name="member_status" widget="badge"
decoration-success="member_status == 'benefit'"
decoration-danger="member_status == 'non_benefit'"/>
<field name="benefit_id" invisible="1"/>
<field name="state"/> <field name="state"/>
</tree> </tree>
</field> </field>

View File

@ -4,7 +4,7 @@
<field name="name">family.member.form</field> <field name="name">family.member.form</field>
<field name="model">family.member</field> <field name="model">family.member</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Family Member"> <form string="Family Member" create="false">
<header> <header>
<!-- Suspend --> <!-- Suspend -->
<button name="action_suspend" type="object" <button name="action_suspend" type="object"
@ -13,16 +13,16 @@
confirm="Are you sure you want to move to Temporarily Suspended ?"/> confirm="Are you sure you want to move to Temporarily Suspended ?"/>
<button name="action_suspend_first_accept" type="object" <button name="action_suspend_first_accept" type="object"
string="First Approve" class="oe_highlight" string="First Approve" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve'])]}"
/> />
<button name="action_suspend_second_accept" type="object" <button name="action_suspend_second_accept" type="object"
string="Second Approve" class="oe_highlight" string="Second Approve" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['first_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['first_approve'])]}"
/> />
<button name="action_suspend_refuse" type="object" <button name="action_suspend_refuse" type="object"
string="Suspend Refuse" class="oe_highlight" string="Suspend Refuse" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve','first_approve','suspended_second_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve','first_approve','suspended_second_approve'])]}"
/> />
<!-- Exception --> <!-- Exception -->
<button name="action_exception" type="object" <button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight" string="Temporarily Exception" class="oe_highlight"
@ -36,7 +36,7 @@
string="Exception Second Approve" class="oe_highlight" string="Exception Second Approve" class="oe_highlight"
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['first_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['first_approve'])]}"
/> />
<button name="action_exception_final_accept" type="object" <button name="action_exception_final_accept" type="object"
string="Exception Final Approve" class="oe_highlight" string="Exception Final Approve" class="oe_highlight"
attrs="{'invisible': [('state','not in',['exception_second_approve'])]}" attrs="{'invisible': [('state','not in',['exception_second_approve'])]}"
@ -44,7 +44,7 @@
<button name="action_exception_refuse" type="object" <button name="action_exception_refuse" type="object"
string="Exception Refuse" class="oe_highlight" string="Exception Refuse" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','exception_second_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','exception_second_approve'])]}"
/> />
<field name="state" widget="statusbar" <field name="state" widget="statusbar"
statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"/> statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"/>
<field name="state_a" widget="statusbar" <field name="state_a" widget="statusbar"
@ -85,7 +85,7 @@
placeholder="Second Name" required="1" placeholder="Second Name" required="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_third_name" required="1" nolabel="1" placeholder="Third Name" <field name="member_third_name" required="1" nolabel="1" placeholder="Third Name"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_family_name" force_save="1" nolabel="1" <field name="member_family_name" force_save="1" nolabel="1"
placeholder="Famil yname" required="1" placeholder="Famil yname" required="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
@ -103,16 +103,18 @@
invisible="1"/> invisible="1"/>
<field name="member_phone" <field name="member_phone"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_location_conf" required="1" <field name="relationn_type" invisible="1"/>
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> <field name="member_location_conf"
attrs="{'required':[('relationn_type','not in',('mother','replacement_mother'))],'readonly':[('state','not in',['draft','complete_info'])]}"/>
</group> </group>
<group> <group>
<field name="age" readonly="1" required="1" force_save="1"/> <field name="age" readonly="1" required="1" force_save="1"/>
<field name="age_status"/> <field name="age_status"
attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
<field name="member_id_number" <field name="member_id_number"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}" attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
required="1"/> required="1"/>
<field name="action_type"/> <field name="action_type" readonly="1"/>
</group> </group>
</group> </group>
<group> <group>
@ -123,41 +125,41 @@
<field name="death_certificate" widget="many2many_attachment_preview" <field name="death_certificate" widget="many2many_attachment_preview"
attrs="{'invisible':[('is_dead','=',False)],'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'invisible':[('is_dead','=',False)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="minor_siblings" readonly="1" force_save="1" <field name="minor_siblings" readonly="1" force_save="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
<field name="is_married" <field name="is_married"
attrs="{'invisible':[('is_mother','=',True)],'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'invisible':[('is_mother','=',True)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="marriage_certificate" widget="many2many_attachment_preview" <field name="marriage_certificate" widget="many2many_attachment_preview"
attrs="{'readonly':[('state','not in',['draft','complete_info'])],'invisible':['|',('is_mother','=',True),('is_married','=',False)]}" attrs="{'readonly':[('state','not in',['draft','complete_info'])],'invisible':['|',('is_mother','=',True),('is_married','=',False)]}"
/> />
<field name="mother_location_conf"
attrs="{'invisible':['|',('relationn','=','mother'),('relationn','=','replacement_mother')]}"/>
<field name="mother_location" invisible="1"/> <field name="mother_location" invisible="1"/>
<field name="mother_marital_conf" <field name="mother_marital_conf"
attrs="{'invisible':['|',('relationn','=','mother'),('relationn','=','replacement_mother')]}"/> attrs="{'invisible':[('relationn_type','not in',('mother','replacement_mother'))]}"/>
<field name="education_status"/> <field name="education_status"/>
<field name="benefit_id" attrs="{'readonly': [('state','!=','draft')]}" force_save="1"
required="1"/>
</group> </group>
<group> <group>
<field name="is_work" <field name="is_work"
attrs="{'invisible':[('age','&lt;',18)],'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_income" <field name="member_income"
attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)],'required':[('is_work','=',True)],'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'invisible':[('is_work','=',False)],'required':[('is_work','=',True)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="salary_certificate" widget="many2many_attachment_preview" attrs="{'invisible':['|',('age','&lt;',18),('is_work','=',False)],'readonly':[('state','not in',['draft','complete_info'])]}"/> <field name="salary_certificate" widget="many2many_attachment_preview"
attrs="{'invisible':[('is_work','=',False)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
</group> </group>
</group> </group>
<group> <group>
<group> <group>
<field name="sponsor_related_id" <field name="sponsor_related_id"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}" invisible="1"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
invisible="1"/>
<field name="sponsor_id" <field name="sponsor_id"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}" attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
invisible="1"/> invisible="1"/>
<field name="sponsorship_id" <field name="sponsorship_id" invisible="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="is_excluded_suspension" invisible="1" readonly="1" force_save="1"/> <field name="is_excluded_suspension" invisible="1" readonly="1" force_save="1"/>
</group> </group>
<group> <group>
<field name="benefit_id" attrs="{'readonly': [('state','!=','draft')]}" force_save="1"
required="1"/>
<field name="member_status" invisible="1" readonly="1" widget="badge" <field name="member_status" invisible="1" readonly="1" widget="badge"
decoration-success="member_status == 'benefit'" decoration-success="member_status == 'benefit'"
decoration-danger="member_status == 'non_benefit'"/> decoration-danger="member_status == 'non_benefit'"/>
@ -170,7 +172,7 @@
<field name="name"/> <field name="name"/>
<field name="hobbies_id" required="1"/> <field name="hobbies_id" required="1"/>
<field name="datas" string="File content"/> <field name="datas" string="File content"/>
<!-- <field name="attach_status"/>--> <!-- <field name="attach_status"/>-->
<field name="member_id" invisible="1"/> <field name="member_id" invisible="1"/>
</tree> </tree>
</field> </field>
@ -199,10 +201,12 @@
</tree> </tree>
</field> </field>
</page> </page>
<page string="Education Status" attrs="{'invisible': [('education_status', '!=', 'educated')]}"> <page string="Education Status"
attrs="{'invisible': [('education_status', '!=', 'educated')]}">
<field name="member_education_status_ids" mode="tree,form"/> <field name="member_education_status_ids" mode="tree,form"/>
</page> </page>
<page string="Suspend Reason" attrs="{'invisible': [('action_type','not in',['suspended','exception'])]}"> <page string="Suspend Reason"
attrs="{'invisible': [('action_type','not in',['suspended','exception'])]}">
<group> <group>
<group> <group>
<field name="suspend_reason"/> <field name="suspend_reason"/>
@ -216,7 +220,7 @@
</group> </group>
</page> </page>
<page string="Exception" <page string="Exception"
attrs="{'invisible': [('action_type','not in',['exception'])]}"> attrs="{'invisible': [('action_type','not in',['exception'])]}">
<group> <group>
<group> <group>
<field name="exception_start_date"/> <field name="exception_start_date"/>
@ -230,7 +234,8 @@
</group> </group>
</page> </page>
<page string="Attachments"> <page string="Attachments">
<field name="attachment_ids" mode="tree" options="{'no_open': True}" widget="one2many_list"> <field name="attachment_ids" mode="tree" options="{'no_open': True}"
widget="one2many_list">
<tree editable="bottom"> <tree editable="bottom">
<field name="name" string="Attachment Name"/> <field name="name" string="Attachment Name"/>
<field name="datas" string="File content" <field name="datas" string="File content"
@ -257,7 +262,6 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Family Members" create="false"> <tree string="Family Members" create="false">
<field name="name" force_save="1"/> <field name="name" force_save="1"/>
<!-- <field name="gender" required="1"/>-->
<field name="relationn"/> <field name="relationn"/>
<field name="member_location_conf"/> <field name="member_location_conf"/>
<field name="member_status" string="Is Benefit?"/> <field name="member_status" string="Is Benefit?"/>
@ -283,6 +287,10 @@
<filter string="State" name="state" context="{'group_by': 'state'}"/> <filter string="State" name="state" context="{'group_by': 'state'}"/>
<filter string="Benefit" name="benefit_id" context="{'group_by': 'benefit_id'}"/> <filter string="Benefit" name="benefit_id" context="{'group_by': 'benefit_id'}"/>
</group> </group>
<separator/>
<searchpanel>
<field name="state" enable_counters="1"/>
</searchpanel>
</search> </search>
</field> </field>
</record> </record>