bemade-addons/bemade_fsm/views/res_partner.xml
Marc Durepos dc04ab952b bemade_fsm: Changes to site and work order contact behaviour
1. Site contacts and work order contacts now get set on create and write
   of all FSM project tasks. If the task has no parent_id, it will try
   to set them from the sale order if it has one. Otherwise, they are
   simply inherited from the parent.
2. Changing the site or work order contact on a task no longer feeds
   back to the sale order.
3. Changing the site or work order contacts on a parent task propagates
   the change to its subtasks.
2024-05-02 10:01:44 -04:00

83 lines
4 KiB
XML

<?xml version="1.0"?>
<odoo>
<record id="act_res_partner_2_equipment" model="ir.actions.act_window">
<field name="name">Equipments</field>
<field name="res_model">bemade_fsm.equipment</field>
<field name="view_mode">tree,form</field>
<field name="context">{'default_partner_location_id': active_id}</field>
<field name="domain">[("partner_location_id", "=", active_id)]</field>
</record>
<record id="partner_equipment_location_view_form" model="ir.ui.view">
<field name="name">bemade_fsm.partner.equipment.location.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='internal_notes']" position="before">
<page name="field_service" string="Field Service">
<field name="owned_equipment_ids" invisible="True"/>
<group>
<field name="site_contacts"
invisible="company_type == 'person'"
context="{'tree_view_ref': 'bemade_fsm.fsm_contacts_view_tree'}"/>
<field name="work_order_contacts"
invisible="company_type == 'person'"
context="{'tree_view_ref': 'bemade_fsm.fsm_contacts_view_tree'}"/>
<field name="equipment_ids"
invisible="company_type == 'person'"
context="{'tree_view_ref': 'bemade_fsm.fsm_equipment_view_tree'}"
readonly="False"/>
<field name="owned_equipment_ids"
invisible="company_type == 'person' or owned_equipment_ids == False"
context="{'tree_view_ref': 'bemade_fsm.fsm_equipment_view_tree'}"
readonly="True"/>
<field name="site_ids"
invisible="company_type == 'company'">
<tree editable="bottom">
<field name="name" widget="res_partner_many2one"/>
</tree>
</field>
</group>
</page>
</xpath>
<div name="button_box" position="inside">
<button class="oe_stat_button" type="action" name="%(bemade_fsm.act_res_partner_2_equipment)d"
icon="fa-tachometer">
<field string="Equipments" name="equipment_count" widget="statinfo"/>
</button>
</div>
<field name="lang" position="after">
</field>
<xpath expr="/form//field[@name='child_ids']/form//field[@name='comment']" position="after">
<field name="is_site_contact"/>
</xpath>
</field>
</record>
<record id="fsm_contacts_view_tree" model="ir.ui.view">
<field name="name">bemade_fsm.contacts.tree</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="name" />
<field name="email" widget="email"/>
<field name="phone" widget="phone"/>
<field name="mobile" widget="phone"/>
</tree>
</field>
</record>
<record id="fsm_equipment_view_tree" model="ir.ui.view">
<field name="name">bemade_fsm.equipment.tree</field>
<field name="model">bemade_fsm.equipment</field>
<field name="arch" type="xml">
<tree>
<field name="pid_tag"/>
<field name="name"/>
<field name="location_notes"/>
<button name="action_view_equipment"
type="object"
string="Details"
icon="fa-external-link"/>
</tree>
</field>
</record>
</odoo>