Skip to content

Commit

Permalink
[UPD] Hide useless pages in res.partner form view
Browse files Browse the repository at this point in the history
Hide useless pages for publoc and position profiles
  • Loading branch information
Stéphan Sainléger authored and njeudy committed May 8, 2022
1 parent bc832be commit 5b7cadc
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions lcc_members/views/res_partner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,14 @@
<xpath expr="//field[@name='associate_member']" position="attributes">
<attribute name='invisible'>1</attribute>
</xpath>
<xpath expr="//field[@name='free_member']/../.." position='attributes'>
<attribute name='attrs'>{'invisible': [('contact_id','!=',False)]}</attribute>
</xpath>
<xpath expr="//field[@name='member_lines']" position='attributes'>
<attribute name='attrs'>{'invisible': [('contact_id','!=',False)]}</attribute>
<attribute name='readonly'>0</attribute>
</xpath>
<xpath expr="//field[@name='member_lines']/form/group/group/field[@name='membership_id']" position='attributes'>
<attribute name='readonly'>1</attribute>
</xpath>
<xpath expr="//field[@name='member_lines']/form/group/group/field[@name='member_price']" position='attributes'>
<attribute name='readonly'>1</attribute>
</xpath>
<xpath expr="//field[@name='member_lines']" position='after'>
<p attrs="{'invisible': [('contact_id','=',False)]}">
To see membership information about this contact, please
go to to the this person form:
<field name="contact_id" class="oe_inline" domain="[('contact_type','!=','attached')]" context="{'show_address': 1}" options="{'always_reload': True}" />
</p>
<xpath expr="//field[@name='member_lines']/.." position='attributes'>
<attribute name='attrs'>{'invisible': [('is_main_profile','=',False)]}</attribute>
</xpath>

<!-- page Contacts & Adresses -->
Expand All @@ -132,6 +121,7 @@
<xpath expr="//field[@name='child_ids']/form/sheet//field[@name='firstname']" position="attributes">
<attribute name="attrs">{'invisible': [('type', 'in', ['invoice','delivery','other'])]}</attribute>
</xpath>

<!-- page Other Positions -->
<xpath expr="//page[@name='other_position']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('contact_id','!=',False), ('is_company','=',True)]}</attribute>
Expand All @@ -150,16 +140,22 @@
<field name="edit_structure_public_profile" attrs="{'invisible': [('is_position_profile','=',False)]}" />
</xpath>

<!-- page Invoicing -->
<xpath expr="//page[@name='accounting']" position='attributes'>
<attribute name='attrs'>{'invisible': [('is_main_profile','=',False)]}</attribute>
</xpath>
<xpath expr="//page[@name='accounting_disabled']" position='attributes'>
<attribute name='invisible'>1</attribute>
</xpath>

<!-- page Sales & Purchases -->
<xpath expr="//page[@name='sales_purchases']/group[@name='container_row_2']" position='attributes'>
<attribute name='attrs'>{'invisible': [('contact_id','!=',False)]}</attribute>
<xpath expr="//page[@name='sales_purchases']" position='attributes'>
<attribute name='attrs'>{'invisible': [('is_main_profile','=',False)]}</attribute>
</xpath>
<xpath expr="//page[@name='sales_purchases']/group[@name='container_row_2']" position='after'>
<p attrs="{'invisible': [('contact_id','=',False)]}">
To see Sales and Purchases an information about this contact, please
go to to the this person form:
<field name="contact_id" class="oe_inline" domain="[('contact_type','!=','attached')]" context="{'show_address': 1}" options="{'always_reload': True}" />
</p>

<!-- page Personnal Information -->
<xpath expr="//page[@name='personal_information_page']" position='attributes'>
<attribute name='attrs'>{'invisible': [('is_main_profile','=',False)]}</attribute>
</xpath>

<!-- ################## -->
Expand Down

0 comments on commit 5b7cadc

Please sign in to comment.