~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to analytic_distribution/account_invoice_view.xml

  • Committer: Olivier DOSSMANN
  • Date: 2014-03-31 09:31:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2086.
  • Revision ID: od@tempo-consulting.fr-20140331093146-tgvxnly1kc1hbv1s
UF-2171 [ADD] Analytic distribution reset button for recurring models

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
            <field name="model">account.invoice</field>
9
9
            <field name="type">form</field>
10
10
            <field name="inherit_id" ref="account.invoice_supplier_form"/>
 
11
            <field name="priority">30</field>
11
12
            <field name="arch" type="xml">
12
13
                <data>
13
 
                    <field name='account_id' position="before">
14
 
                        <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" context="context"/>
15
 
                        <field name="have_analytic_distribution" invisible="1"/>
16
 
                        <newline/>
17
 
                    </field>
18
 
                    <xpath expr="/form//field[@name='invoice_line']" position="before">
 
14
                    <xpath expr="/form/notebook" position="before">
19
15
                        <newline />
20
 
                        <group attrs="{'invisible': [('have_analytic_distribution', '=', True)]}" colspan="6">
21
 
                            <html>
22
 
                                <p style="color: blue; padding-left: 15px;">Please add an analytic distribution on this invoice before creating some invoice lines!</p>
23
 
                            </html>
24
 
                        </group>
25
 
                    </xpath>
26
 
                    <xpath expr="/form//field[@name='invoice_line']" position="attributes">
27
 
                        <attribute name="attrs">{'readonly': [('have_analytic_distribution', '=', False)]}</attribute>
 
16
                        <group colspan="4" col="8" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}">
 
17
                            <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-check" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}"/>
 
18
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
 
19
                        </group>
 
20
                        <group colspan="4" col="8" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}">
 
21
                            <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-emblem-important" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}"/>
 
22
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
 
23
                        </group>
 
24
                        <field name="analytic_distribution_id" invisible="1"/>
 
25
                        <group colspan="3"/>
28
26
                    </xpath>
29
27
                    <xpath expr="//tree[@string='Invoice lines']/field[@name='account_analytic_id']" position="replace">
30
 
                        <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" context="context"/>
31
 
                    </xpath>
32
 
                </data>
33
 
            </field>
34
 
        </record>
35
 
 
36
 
    <!-- Delete old analytic field -->
 
28
                        <field name="inactive_product" invisible="1" />
 
29
                        <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" context="context" attrs="{'invisible': [('is_allocatable', '=', False)]}"/>
 
30
                        <field name="analytic_distribution_state_recap"/>
 
31
                        <field name="have_analytic_distribution_from_header" invisible="1"/>
 
32
                        <field name="analytic_distribution_state" invisible="1"/>
 
33
                        <field name="is_allocatable" invisible="1"/>
 
34
                    </xpath>
 
35
                    <xpath expr="//tree[@string='Invoice lines']" position="attributes">
 
36
                        <attribute name="colors">red:analytic_distribution_state == 'invalid' or inactive_product == True;black:analytic_distribution_state in ('none','valid') and inactive_product == False</attribute>
 
37
                    </xpath>
 
38
                    <xpath expr="//tree[@string='Invoice lines']/field[@name='product_id']" position="before">
 
39
                        <field name="is_corrected" invisible="1"/>
 
40
                        <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/>
 
41
                    </xpath>
 
42
                </data>
 
43
            </field>
 
44
        </record>
 
45
 
 
46
        <record id="invoice_form_2" model="ir.ui.view">
 
47
            <field name="name">account.invoice.supplier.form.2</field>
 
48
            <field name="model">account.invoice</field>
 
49
            <field name="type">form</field>
 
50
            <field name="inherit_id" ref="account.invoice_form"/>
 
51
            <field name="priority">35</field>
 
52
            <field name="arch" type="xml">
 
53
                <data>
 
54
                    <xpath expr="/form/notebook" position="before">
 
55
                        <group colspan="4" col="8" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}">
 
56
                            <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-check" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}"/>
 
57
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
 
58
                        </group>
 
59
                        <group colspan="4" col="8" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}">
 
60
                            <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-emblem-important" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}"/>
 
61
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
 
62
                        </group>
 
63
                        <field name="analytic_distribution_id" invisible="1"/>
 
64
                        <group colspan="3"/>
 
65
                    </xpath>
 
66
                </data>
 
67
            </field>
 
68
        </record>
 
69
 
 
70
        <record id="view_invoice_line_tree_2" model="ir.ui.view">
 
71
            <field name="name">account.invoice.line.tree.2</field>
 
72
            <field name="model">account.invoice.line</field>
 
73
            <field name="type">tree</field>
 
74
            <field name="inherit_id" ref="account.view_invoice_line_tree"/>
 
75
            <field name="arch" type="xml">
 
76
                <data>
 
77
                    <xpath expr="/tree" position="replace">
 
78
                        <tree string="Invoice Line" colors="red:inactive_product == True or analytic_distribution_state in ('invalid');blue:inactive_product == False and analytic_distribution_state in ('valid');black:inactive_product == False and analytic_distribution_state in ('none')">
 
79
                            <field name="name"/>
 
80
                            <field name="inactive_product" invisible="1" />
 
81
                            <field name="account_id" domain="[('restricted_area', '=', 'invoice_lines')]"/>
 
82
                            <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" context="context" attrs="{'invisible': [('is_allocatable', '=', False)]}"/>
 
83
                            <field name="analytic_distribution_state_recap"/>
 
84
                            <field name="have_analytic_distribution_from_header" invisible="1"/>
 
85
                            <field name="analytic_distribution_state" invisible="1"/>
 
86
                            <field name="is_allocatable" invisible="1"/>
 
87
                            <field name="quantity"/>
 
88
                            <field name="uos_id" string="UoM"/>
 
89
                            <field name="price_unit"/>
 
90
                            <field name="price_subtotal"/>
 
91
                        </tree>
 
92
                    </xpath>
 
93
                </data>
 
94
            </field>
 
95
        </record>
 
96
 
 
97
    <!-- Delete old analytic field and new items for analytic distribution -->
37
98
        <record id="invoice_line_form" model="ir.ui.view">
38
99
            <field name="name">account.invoice.line.form</field>
39
100
            <field name="model">account.invoice.line</field>
40
101
            <field name="type">form</field>
41
102
            <field name="inherit_id" ref="account.view_invoice_line_form"/>
42
103
            <field name="arch" type="xml">
43
 
                <field name="account_analytic_id" position="replace" />
 
104
                <field name="account_analytic_id" position="replace">
 
105
                    <group colspan="6">
 
106
                        <group colspan="2" col="4">
 
107
                            <button name="button_analytic_distribution" string="Change analytic distribution" type="object" icon="terp-check" context="context" colspan="1" attrs="{'invisible': ['|','|', ('newline', '=', True),('analytic_distribution_state', '!=', 'valid'), ('is_allocatable', '=', False)]}" />
 
108
                            <button name="button_analytic_distribution" string="Change analytic distribution" type="object" icon="terp-emblem-important" context="context" colspan="1" attrs="{'invisible': ['|','|', ('newline', '=', True), ('analytic_distribution_state', '=', 'valid'), ('is_allocatable', '=', False)]}" />
 
109
                            <field name="analytic_distribution_state_recap" attrs="{'invisible': [('is_allocatable', '=', False)]}"/>
 
110
                            <field name="have_analytic_distribution_from_header" invisible="1"/>
 
111
                        </group>
 
112
                        <field name="analytic_distribution_state" invisible="1"/>
 
113
                        <field name="newline" invisible="1" />
 
114
                        <field name="is_allocatable" invisible="1"/>
 
115
                    </group>
 
116
                </field>
 
117
            </field>
 
118
        </record>
 
119
    
 
120
        <record id="view_account_invoice_doc_date_refund" model="ir.ui.view">
 
121
            <field name="name">account.invoice.refund.doc_date.form</field>
 
122
            <field name="model">account.invoice.refund</field>
 
123
            <field name="type">form</field>
 
124
            <field name="inherit_id" ref="account.view_account_invoice_refund"/>
 
125
            <field name="arch" type="xml">
 
126
                <field name="period" position="replace"/>
 
127
                <field name="date" position="replace">
 
128
                    <field name="document_date"/>
 
129
                    <field name="date" on_change="onchange_date(date)"/>
 
130
                </field>
44
131
            </field>
45
132
        </record>
46
133