~acsone-openerp/acsone-addons/6.1-git

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record model="ir.ui.view" id="hr_timesheet_line_form">
            <field name="name">hr.analytic.timesheet.form</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet_task.hr_timesheet_line_form"/>
            <field name="arch" type="xml">
                <!--
                  do not allow view accounts
                -->
                <field name="account_id" position="replace">
                    <field name="account_id" on_change="on_change_account_id(account_id)" domain="[('state','=','open'),('type','=','normal')]"/>
                </field>
                <!--
                  set task domain to restrict to project's task
                -->
                <field name="task_id" position="replace">
                    <field name="task_id" on_change="on_change_account_id(account_id, task_id)" domain="[('state','=','open'),('project_id.analytic_account_id','=',account_id)]" required="True"/>
                </field>
            </field>
        </record>

        <record model="ir.ui.view" id="hr_timesheet_line_form2">
            <field name="name">hr.analytic.timesheet.form</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet_invoice.hr_timesheet_line_form"/>
            <field name="arch" type="xml">
                <!--
                  hide or make readonly a set of fields that should
                  never be modified by the end user
                -->
                <field name="to_invoice" position="attributes">
                  <attribute name="readonly">1</attribute>
                </field>
                <field name="invoice_id" position="attributes">
                  <attribute name="readonly">1</attribute>
                </field>
                <field name="product_id" position="attributes">
                  <attribute name="invisible">1</attribute>
                </field>
                <field name="general_account_id" position="attributes">
                  <attribute name="invisible">1</attribute>
                </field>
                <field name="journal_id" position="attributes">
                  <attribute name="invisible">1</attribute>
                </field>
                <field name="amount" position="attributes">
                  <attribute name="invisible">1</attribute>
                </field>
            </field>
        </record>

        <record model="ir.ui.view" id="hr_timesheet_line_tree">
            <field name="name">hr.analytic.timesheet.tree</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
            <field name="arch" type="xml">
                <field name="account_id" position="replace">
                    <field name="account_id" on_change="on_change_account_id(account_id)" domain="[('state','=','open'),('type','=','normal')]"/>
                </field>
                <field name="task_id" position="replace">
                    <field name="task_id" on_change="on_change_account_id(account_id, task_id)" domain="[('state','=','open'),('project_id.analytic_account_id','=',account_id)]" required="True"/>
                </field>
            </field>
        </record>

        <record model="ir.ui.view" id="hr_timesheet_line_tree2">
            <field name="name">hr.analytic.timesheet.form</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet_invoice.hr_timesheet_line_tree"/>
            <field name="arch" type="xml">
                <!--
                  hide the to_invoice field as it should not be modified by
                  the end user (it is inherited from the project/analytic_account)
                -->
                <field name="to_invoice" position="attributes">
                  <attribute name="invisible">1</attribute>
                </field>
            </field>
        </record>

    </data>
</openerp>