bemade-addons/bemade_sethy_configuration/views/res_partner_views.xml
Benoît Vézina 2081f149ee sethy final
2024-03-21 13:16:15 -04:00

193 lines
No EOL
8.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="open_partner_form" model="ir.actions.act_window">
<field name="name">Open Partner</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_mode">form</field>
<field name="target">current</field>
</record>
<!-- Action pour ouvrir l'assistant de transfert de propriété -->
<record id="action_start_transfer_property_wizard" model="ir.actions.act_window">
<field name="name">Transfer Property</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">transfer.property.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="partner_default_contacts_view_form" model="ir.ui.view">
<field name="name">bemade_sethy_configuration.res_partner.defaults.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<sheet position="before">
<header>
<button name="%(action_start_transfer_property_wizard)d"
type="action"
class="btn-primary"
string="Transfer Property"
context="{'default_property_id': id}"
invisible="is_property == False"
/>
</header>
</sheet>
<field name="company_type" position="after">
<field name="is_property" invisible="True"/>
</field>
<field name="company_type" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</field>
<field name="vat" position="before">
<field name="ref" position="move"/>
</field>
<xpath expr="//field[@name='name' and @id='company']" position="attributes">
<attribute name="invisible">not is_company or is_property</attribute>
</xpath>
<xpath expr="//field[@name='name' and @id='individual']" position="attributes">
<attribute name="invisible">is_company or is_property</attribute>
</xpath>
<xpath expr="//field[@name='name' and @id='company']" position="after">
<field id="lot_number"
class="text-break"
name="lot_number" placeholder="123456789"
invisible="not is_property"
/>
</xpath>
<button name="schedule_meeting" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</button>
<button name="action_view_opportunity" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</button>
<xpath expr="//field[@name='parent_id']/ancestor::div[hasclass('o_row')]" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</xpath>
<button name="action_view_partner_invoices" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</button>
<button name="%(payment.action_payment_token)d" position="attributes">
<attribute name="invisible">payment_token_count == 0 or is_property</attribute>
</button>
<xpath expr="//page[@name='contact_addresses']" position="attributes">
<attribute name="invisible">is_property</attribute>
</xpath>
<xpath expr="//page[@name='sales_purchases']" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</xpath>
<xpath expr="//page[@name='membership']" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</xpath>
<xpath expr="//page[@name='accounting']" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</xpath>
<xpath expr="//field[@name='function']/ancestor::group[1]" position="attributes">
<attribute name="invisible">is_property == True</attribute>
</xpath>
<xpath expr="//field[@name='function']/ancestor::group[1]" position="after">
<group invisible="is_property == False">
<field name="surface"/>
<field name="category_id"
widget="many2many_tags"
options="{'color_field': 'color', 'no_create_edit': True}"
/>
</group>
</xpath>
<xpath expr="//page[@name='contact_addresses']" position="after">
<page string="Property" name="bemade_sethy_configuration.res_partner.defaults.form">
<field name="relation_property_ids" string="All Owners" invisible="is_property == False">
<tree>
<field name="other_partner_id"
required="True"
options="{'no_create': True}"
string="Owner"
/>
<field name="date_start"/>
<field name="date_end"/>
</tree>
</field>
<field name="relation_owner_ids" string="All Properties" invisible="is_property == True">
<tree>
<field name="other_partner_id"
required="True"
options="{'no_create': True}"
string="Property"
/>
<field name="date_start"/>
<field name="date_end"/>
</tree>
</field>
</page>
</xpath>
<xpath expr="//page[@name='contact_addresses']" position="after">
<page string="Sethy" name="bemade_sethy_configuration.res_partner.page.sethy">
<group>
<field name="ref_project"/>
<field name="intent_signing" invisible="is_property"/>
<field name="cyberimpact" invisible="is_property"/>
<field name="specification_date"/>
<field name="crm_stage_activity"/>
</group>
</page>
</xpath>
</field>
</record>
<record id="view_res_partner_search_inherit" model="ir.ui.view">
<field name="name">res.partner.search.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='inactive']" position="before">
<field name="ref"/>
<filter string="Owner" name="owner" domain="[('is_owner', '=', True)]"/>
</xpath>
</field>
</record>
<!-- <record id="view_res_partner_filter_inherit" model="ir.ui.view">-->
<!-- <field name="name">res.partner.select.inherit</field>-->
<!-- <field name="model">res.partner</field>-->
<!-- <field name="inherit_id" ref="base.view_res_partner_filter"/>-->
<!-- <field name="arch" type="xml">-->
<!-- <xpath expr="//search" position="inside">-->
<!-- <filter string="Owner" domain="[('category_id.name', '=', 'Owner')]" />-->
<!-- <filter string="Property" domain="[('category_id.name', '=', 'Property')]" />-->
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>-->
<record id="contacts.action_contacts" model="ir.actions.act_window">
<field name="name">Contacts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_mode">tree,form</field>
<!-- Add your domain here -->
<field name="domain">[('is_property','=',False)]</field>
</record>
</odoo>