open-synergy/opnsynid-hr

View on GitHub
hr_timesheet_task_onchange/views/project_task_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="project_task_views_form" model="ir.ui.view">
    <field name="name">project.task form</field>
    <field name="model">project.task</field>
    <field name="inherit_id" ref="timesheet_task.view_task_form2" />
    <field name="priority" eval="30" />
    <field name="arch" type="xml">
        <data>
            <xpath expr="//field[@name='work_ids']" position="attributes">
                <attribute
                            name="context"
                        >{'default_account_id': analytic_account_id}</attribute>
            </xpath>

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

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

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

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

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

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


</data>
</openerp>