|
5 | 5 | <field name="model">sale.invoice.plan</field> |
6 | 6 | <field name="arch" type="xml"> |
7 | 7 | <tree editable="bottom"> |
8 | | - <field name="no_edit" invisible="1" /> |
| 8 | + <field name="no_edit" column_invisible="1" /> |
9 | 9 | <field name="analytic_account_id" /> |
10 | 10 | <field |
11 | 11 | name="installment" |
12 | | - attrs="{'readonly': [('no_edit', '=', True)]}" |
| 12 | + readonly="no_edit" |
13 | 13 | /> |
14 | 14 | <field |
15 | 15 | name="plan_date" |
16 | | - attrs="{'readonly': [('no_edit', '=', True)]}" |
| 16 | + readonly="no_edit" |
17 | 17 | /> |
18 | 18 | <field |
19 | 19 | name="invoice_type" |
20 | | - attrs="{'readonly': [('no_edit', '=', True)]}" |
| 20 | + readonly="no_edit" |
21 | 21 | /> |
22 | 22 | <field |
23 | 23 | name="percent" |
24 | 24 | optional="show" |
25 | | - attrs="{'readonly': [('no_edit', '=', True)]}" |
| 25 | + readonly="no_edit" |
26 | 26 | /> |
27 | 27 | <field |
28 | 28 | name="amount" |
29 | 29 | optional="show" |
30 | | - attrs="{'readonly': [('no_edit', '=', True)]}" |
| 30 | + readonly="no_edit" |
31 | 31 | /> |
32 | 32 | <field name="amount_invoiced" optional="hide" sum="Amount" /> |
33 | 33 | <field name="to_invoice" /> |
|
36 | 36 | name="invoice_move_ids" |
37 | 37 | optional="hide" |
38 | 38 | widget="many2many_tags" |
| 39 | + readonly="1" |
39 | 40 | /> |
40 | | - <field name="last" invisible="1" /> |
| 41 | + <field name="last" column_invisible="1" /> |
41 | 42 | </tree> |
42 | 43 | </field> |
43 | 44 | </record> |
|
57 | 58 | <field name="percent" /> |
58 | 59 | <field name="amount" /> |
59 | 60 | <field name="invoiced" /> |
60 | | - <field name="invoice_move_ids" widget="many2many_tags" /> |
| 61 | + <field name="invoice_move_ids" widget="many2many_tags" readonly="1"/> |
61 | 62 | </group> |
62 | 63 | </group> |
63 | 64 | <separator |
64 | 65 | string="Related Invoices" |
65 | | - attrs="{'invisible': [('invoice_move_ids', '=', [])]}" |
| 66 | + invisible="not invoice_move_ids" |
66 | 67 | /> |
67 | | - <field name="invoice_move_ids" widget="many2many_tags" /> |
| 68 | + <field name="invoice_move_ids" widget="many2many_tags" readonly="1"/> |
68 | 69 | </form> |
69 | 70 | </field> |
70 | 71 | </record> |
|
74 | 75 | <field name="inherit_id" ref="sale.view_order_form" /> |
75 | 76 | <field name="arch" type="xml"> |
76 | 77 | <xpath expr='/form/sheet/notebook' position="before"> |
77 | | - <div attrs="{'readonly': [('invoice_count', '>', 0)]}"> |
| 78 | + <div readonly="invoice_count > 0"> |
78 | 79 | <field name="use_invoice_plan" /> |
79 | 80 | <label for="use_invoice_plan" /> |
80 | 81 | </div> |
|
86 | 87 | string="Create Invoice by Plan" |
87 | 88 | type="action" |
88 | 89 | class="btn-primary" |
89 | | - attrs="{'invisible': [('invoice_plan_process', '=', False)]}" |
| 90 | + invisible="not invoice_plan_process" |
90 | 91 | /> |
91 | 92 | </xpath> |
92 | 93 | <xpath |
93 | 94 | expr="//button[@name='%(sale.action_view_sale_advance_payment_inv)d'][1]" |
94 | 95 | position="attributes" |
95 | 96 | > |
96 | 97 | <attribute |
97 | | - name="attrs" |
98 | | - >{'invisible': ['|', ('invoice_plan_process', '=', True), ('invoice_status', '!=', 'to invoice')]}</attribute> |
| 98 | + name="invisible" |
| 99 | + >invoice_plan_process or invoice_status != 'to invoice'</attribute> |
99 | 100 | </xpath> |
100 | 101 | <xpath |
101 | 102 | expr="//button[@name='%(sale.action_view_sale_advance_payment_inv)d'][2]" |
102 | 103 | position="attributes" |
103 | 104 | > |
104 | 105 | <attribute |
105 | | - name="attrs" |
106 | | - >{'invisible': ['|', ('invoice_plan_process', '=', True), '|', ('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}</attribute> |
| 106 | + name="invisible" |
| 107 | + >invoice_plan_process or invoice_status != 'no' or state != 'sale'</attribute> |
107 | 108 | </xpath> |
108 | 109 | <xpath expr="/form/sheet/notebook/page" position="after"> |
109 | 110 | <page |
110 | 111 | string="Invoice Plan" |
111 | | - attrs="{'invisible': [('use_invoice_plan', '=', False)]}" |
| 112 | + invisible="not use_invoice_plan" |
112 | 113 | > |
113 | 114 | <button |
114 | 115 | name="%(action_sale_create_invoice_plan)d" |
115 | 116 | string="⇒ Create Invoice Plan" |
116 | 117 | type="action" |
117 | 118 | class="oe_link" |
118 | | - attrs="{'invisible': ['|', ('invoice_plan_ids', '!=', []), ('invoice_count', '>', 0)]}" |
| 119 | + invisible="invoice_plan_ids or invoice_count > 0" |
119 | 120 | /> |
120 | 121 | <button |
121 | 122 | name="remove_invoice_plan" |
122 | 123 | string="⇒ Remove Invoice Plan" |
123 | 124 | type="object" |
124 | 125 | class="oe_link" |
125 | | - attrs="{'invisible': ['|', ('invoice_plan_ids', '=', []), ('invoice_count', '>', 0)]}" |
| 126 | + invisible="not invoice_plan_ids or invoice_count > 0" |
126 | 127 | confirm="Are you sure to remove this invoice plan?" |
127 | 128 | /> |
128 | 129 | <field |
129 | 130 | name="invoice_plan_ids" |
130 | 131 | context="{'tree_view_ref': 'sale_invoice_plan.view_sale_invoice_plan_tree'}" |
131 | | - attrs="{'invisible': [('invoice_plan_ids', '=', [])]}" |
| 132 | + invisible="not invoice_plan_ids" |
132 | 133 | /> |
133 | 134 | <group class="oe_subtotal_footer oe_right"> |
134 | 135 | <field name="invoice_plan_total_percent" /> |
|
0 commit comments