hr_timesheet_sheet_onchange/views/hr_timesheet_sheet_sheet_views.xml
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2020 OpenSynergy Indonesia
Copyright 2020 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<record id="hr_timesheet_sheet_sheet_view_form" model="ir.ui.view">
<field name="name">hr_timesheet_sheet.sheet form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form" />
<field name="arch" type="xml">
<data>
<xpath
expr="//field[@name='timesheet_ids']/tree/field[@name='user_id']"
position="attributes"
>
<attribute name="on_change">1</attribute>
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/tree/field[@name='account_id']"
position="attributes"
>
<attribute name="on_change">1</attribute>
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/tree/field[@name='product_id']"
position="attributes"
>
<attribute name="on_change">1</attribute>
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/tree/field[@name='product_id']"
position="before"
>
<field
name="allowed_product_uom_ids"
widget="many2many_tags"
invisible="1"
/>
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/tree/field[@name='product_uom_id']"
position="attributes"
>
<attribute name="on_change">1</attribute>
<attribute
name="domain"
>[('id','in',allowed_product_uom_ids[0][2])]</attribute>
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/tree/field[@name='unit_amount']"
position="attributes"
>
<attribute name="on_change">1</attribute>
</xpath>
</data>
</field>
</record>
</data>
</openerp>