open-synergy/opnsynid-hr

View on GitHub
hr_timesheet_onchange/views/hr_analytic_timesheet_views.xml

Summary

Maintainability
Test Coverage
<?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_analytic_timesheet_view_tree" model="ir.ui.view">
    <field name="name">hr.analytic.timesheet form</field>
    <field name="model">hr.analytic.timesheet</field>
    <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />
    <field name="arch" type="xml">
        <data>
            <xpath expr="//field[@name='user_id']" position="attributes">
                <attribute name="on_change">1</attribute>
            </xpath>

            <xpath expr="//field[@name='account_id']" position="attributes">
                <attribute name="on_change">1</attribute>
            </xpath>

            <xpath expr="//field[@name='product_id']" position="attributes">
                <attribute name="on_change">1</attribute>
            </xpath>

            <xpath expr="//field[@name='product_id']" position="before">
                <field
                            name="allowed_product_uom_ids"
                            widget="many2many_tags"
                            invisible="1"
                        />
            </xpath>

            <xpath expr="//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='unit_amount']" position="attributes">
                <attribute name="on_change">1</attribute>
            </xpath>
        </data>
    </field>
</record>


</data>
</openerp>