odex25_standard/odex25_ensan/odex_benefit/views/family_members.xml

309 lines
20 KiB
XML

<odoo>
<data>
<record id="family_member_form" model="ir.ui.view">
<field name="name">family.member.form</field>
<field name="model">family.member</field>
<field name="arch" type="xml">
<form string="Family Member" create="false">
<header>
<!-- Suspend -->
<button name="action_suspend" type="object"
string="Temporarily Suspended" class="oe_highlight"
attrs="{'invisible': ['|',('state','not in',['second_approve']),('is_member_workflow','=',True)]}"
confirm="Are you sure you want to move to Temporarily Suspended ?"/>
<button name="action_suspend_first_accept" type="object"
string="First Approve" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve'])]}"
/>
<button name="action_suspend_second_accept" type="object"
string="Second Approve" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['first_approve'])]}"
/>
<button name="action_suspend_refuse" type="object"
string="Suspend Refuse" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve','first_approve','suspended_second_approve'])]}"
/>
<!-- Exception -->
<button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight"
confirm="Are you sure you want to move to Temporarily Exception ?"
attrs="{'invisible': [('state','not in',['suspended_second_approve'])]}"/>
<button name="action_exception_first_accept" type="object"
string="Exception First Approve" class="oe_highlight"
groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state','not in',['waiting_approve'])]}"/>
<button name="action_exception_second_accept" type="object"
string="Exception Second Approve" class="oe_highlight"
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['first_approve'])]}"
/>
<button name="action_exception_final_accept" type="object"
string="Exception Final Approve" class="oe_highlight"
attrs="{'invisible': [('state','not in',['exception_second_approve'])]}"
groups="odex_benefit.group_benefit_manager"/>
<button name="action_exception_refuse" type="object"
string="Exception Refuse" class="oe_highlight"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','exception_second_approve'])]}"
/>
<field name="state" widget="statusbar"
statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"/>
<field name="state_a" widget="statusbar"
statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"
invisible="1"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button icon="fa-file" name="action_open_related_member_service_requests" type="object">
<field name="total_member_service_requests" string="Service Requests"
widget="statinfo"/>
</button>
</div>
<field name="is_member_workflow" invisible="1"/>
<widget name="web_ribbon" title="Non Benefit Member" bg_color="bg-danger"
attrs="{'invisible': ['|',('member_status', '=', False),('member_status', '!=', 'non_benefit')]}"/>
<widget name="web_ribbon" title="Benefit Member" bg_color="bg-success"
attrs="{'invisible': ['|',('member_status', '=', False),('member_status', '!=', 'benefit')]}"/>
<h1>
<field placeholder="Name" name="name" class="oe_inline" readonly="1"
force_save="1"/>
</h1>
<group>
<label for="relationn" string="Relation"/>
<div>
<field name="relationn" class="oe_inline" nolabel="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}" required="1"
options='{"no_open": True,"no_create_edit": True}'/>
</div>
</group>
<group>
<group>
<label for="member_first_name" string="Member Name"/>
<div class="o_row">
<field name="member_first_name" required="1" nolabel="1" placeholder="First Name"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_second_name" force_save="1" nolabel="1"
placeholder="Second Name" required="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_third_name" required="1" nolabel="1" placeholder="Third Name"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_family_name" force_save="1" nolabel="1"
placeholder="Famil yname" required="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
</div>
</group>
<group/>
</group>
<group>
<group>
<field name="birth_date"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
required="1"/>
<field name="member_location"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
invisible="1"/>
<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'])]}"/>
</group>
<group>
<field name="age" readonly="1" required="1" force_save="1"/>
<field name="age_status"
attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
<field name="member_id_number"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
required="1"/>
<field name="action_type" readonly="1"/>
</group>
</group>
<group>
<group>
<field name="is_mother" invisible="1"/>
<field name="is_dead"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="death_certificate" widget="many2many_attachment_preview"
attrs="{'invisible':[('is_dead','=',False)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="minor_siblings" readonly="1" force_save="1"
attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
<field name="is_married"
attrs="{'invisible':[('is_mother','=',True)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="marriage_certificate" widget="many2many_attachment_preview"
attrs="{'readonly':[('state','not in',['draft','complete_info'])],'invisible':['|',('is_mother','=',True),('is_married','=',False)]}"
/>
<field name="mother_location" invisible="1"/>
<field name="mother_marital_conf"
attrs="{'invisible':[('relationn_type','not in',('mother','replacement_mother'))]}"/>
<field name="education_status"/>
<field name="benefit_id" attrs="{'readonly': [('state','!=','draft')]}" force_save="1"
required="1"/>
</group>
<group>
<field name="is_work"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="member_income"
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':[('is_work','=',False)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
</group>
</group>
<group>
<group>
<field name="sponsor_related_id"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
invisible="1"/>
<field name="sponsor_id"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
invisible="1"/>
<field name="sponsorship_id" invisible="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="is_excluded_suspension" invisible="1" readonly="1" force_save="1"/>
</group>
<group>
<field name="member_status" invisible="1" readonly="1" widget="badge"
decoration-success="member_status == 'benefit'"
decoration-danger="member_status == 'non_benefit'"/>
</group>
</group>
<notebook>
<page string="Hobbies">
<field name="hobbies_attachment_ids" widget="one2many_list">
<tree editable="bottom">
<field name="name"/>
<field name="hobbies_id" required="1"/>
<field name="datas" string="File content"/>
<!-- <field name="attach_status"/>-->
<field name="member_id" invisible="1"/>
</tree>
</field>
</page>
<page string="Diseases">
<field name="diseases_attachment_ids" widget="one2many_list">
<tree editable="bottom">
<field name="name"/>
<field name="diseases_id" required="1"/>
<field name="datas" string="File content"/>
<field name="expiration_date"/>
<field name="attach_status"/>
<field name="member_id" invisible="1"/>
</tree>
</field>
</page>
<page string="Disabilities">
<field name="disabilities_attachment_ids" widget="one2many_list">
<tree editable="bottom">
<field name="name"/>
<field name="disabilities_id" required="1"/>
<field name="datas" string="File content"/>
<field name="expiration_date"/>
<field name="attach_status"/>
<field name="member_id" invisible="1"/>
</tree>
</field>
</page>
<page string="Education Status"
attrs="{'invisible': [('education_status', '!=', 'educated')]}">
<field name="member_education_status_ids" mode="tree,form"/>
</page>
<page string="Suspend Reason"
attrs="{'invisible': [('action_type','not in',['suspended','exception'])]}">
<group>
<group>
<field name="suspend_reason"/>
<field name="suspend_description"/>
</group>
<group>
<field name="suspend_attachment"/>
<field name="suspend_type"/>
<field name="suspend_method" readonly="1" force_save="1"/>
</group>
</group>
</page>
<page string="Exception"
attrs="{'invisible': [('action_type','not in',['exception'])]}">
<group>
<group>
<field name="exception_start_date"/>
<field name="exception_description"/>
<field name="exception_type"/>
</group>
<group>
<field name="exception_end_date"/>
<field name="exception_attachment"/>
</group>
</group>
</page>
<page string="Attachments">
<field name="attachment_ids" mode="tree" options="{'no_open': True}"
widget="one2many_list">
<tree editable="bottom">
<field name="name" string="Attachment Name"/>
<field name="datas" string="File content"
attrs="{'readonly':[('parent.state','not in',['draft','complete_info'])]}"/>
<button name="action_preview_attachment" type="object" icon="fa-search-plus"
attrs="{'invisible': [('file_size', '=', 0)]}"/>
<field name="expiration_date"
attrs="{'readonly':[('parent.state','not in',['draft','complete_info'])]}"/>
<field name="attach_status"
attrs="{'readonly':[('parent.state','not in',['draft','complete_info'])]}"/>
<field name="member_id" invisible="1"/>
<field name="file_size" invisible="1"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="family_member_tree" model="ir.ui.view">
<field name="name">family.member.tree</field>
<field name="model">family.member</field>
<field name="arch" type="xml">
<tree string="Family Members" create="false">
<field name="name" force_save="1"/>
<field name="relationn"/>
<field name="member_location_conf"/>
<field name="member_status" string="Is Benefit?"/>
<field name="age"/>
<field name="benefit_id"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="family_member_search" model="ir.ui.view">
<field name="name">family.member.search</field>
<field name="model">family.member</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="member_first_name"/>
<field name="member_second_name"/>
<field name="member_third_name"/>
<field name="member_family_name"/>
<field name="benefit_id"/>
<group string="Group By">
<filter string="State" name="state" context="{'group_by': 'state'}"/>
<filter string="Benefit" name="benefit_id" context="{'group_by': 'benefit_id'}"/>
</group>
<separator/>
<searchpanel>
<field name="state" enable_counters="1"/>
</searchpanel>
</search>
</field>
</record>
<!-- Action for family members -->
<record model="ir.actions.act_window" id="family_member_action">
<field name="name">Family Members</field>
<field name="res_model">family.member</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create the Member
</p>
</field>
</record>
</data>
</odoo>