|
62 | 62 | </field>
|
63 | 63 | </record>
|
64 | 64 |
|
65 |
| - # For Receivable side. User want to have a checkbox to show Account column. |
66 |
| - <record id="invoice_form" model="ir.ui.view"> |
| 65 | + <record id="view_invoice_line_show_account_tree" model="ir.ui.view"> |
| 66 | + <field name="name">view_invoice_line_show_account_tree</field> |
| 67 | + <field name="model">account.invoice.line</field> |
| 68 | + <field name="arch" type="xml"> |
| 69 | + |
| 70 | + <tree string="Invoice lines" editable="bottom"> |
| 71 | + <field name="sequence" widget="handle"/> |
| 72 | + <field name="product_id" invisible="1"/> |
| 73 | + <field |
| 74 | + name="account_id" |
| 75 | + groups="account.group_account_user" |
| 76 | + domain="[('type', 'not in', ['view', 'consolidation', 'closed']), ('activity_ids', '=', activity_id and [activity_id] or False)]" |
| 77 | + on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/> |
| 78 | + <field name="company_id" invisible="1"/> |
| 79 | + <field name="account_analytic_id" invisible="1"/> |
| 80 | + |
| 81 | + <!-- Account Budget Activity --> |
| 82 | + <field name="activity_group_id"/> |
| 83 | + <field name="activity_id"/> |
| 84 | + |
| 85 | + <field name="name"/> |
| 86 | + |
| 87 | + <!-- Chart Fields --> |
| 88 | + <field name="require_chartfield" invisible="1"/> |
| 89 | + |
| 90 | + <field name="spa_id" invisible="1"/> |
| 91 | + <field name="mission_id" invisible="1"/> |
| 92 | + <field name="tag_type_id" invisible="1"/> |
| 93 | + <field name="tag_id" invisible="1"/> |
| 94 | + |
| 95 | + <field name="functional_area_id" invisible="1"/> |
| 96 | + <field name="program_group_id" invisible="1"/> |
| 97 | + <field name="program_id" invisible="1"/> |
| 98 | + <field name="project_group_id" invisible="1"/> |
| 99 | + <field |
| 100 | + name="project_id" |
| 101 | + invisible="0" |
| 102 | + attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False), |
| 103 | + ('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False), |
| 104 | + ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
| 105 | + |
| 106 | + <field name="org_id" invisible="1"/> |
| 107 | + <field name="sector_id" invisible="1"/> |
| 108 | + <field name="subsector_id" invisible="1"/> |
| 109 | + <field name="division_id" invisible="1"/> |
| 110 | + <field |
| 111 | + name="section_id" |
| 112 | + invisible="0" |
| 113 | + attrs="{'required': [('project_id','=',False),('invest_asset_id','=',False), |
| 114 | + ('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False), |
| 115 | + ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
| 116 | + <field name="costcenter_id" invisible="1"/> |
| 117 | + <field name="taxbranch_id" invisible="1"/> |
| 118 | + |
| 119 | + <field |
| 120 | + name="invest_asset_id" |
| 121 | + invisible="0" |
| 122 | + attrs="{'required': [('section_id','=',False),('project_id','=',False), |
| 123 | + ('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False), |
| 124 | + ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
| 125 | + |
| 126 | + <field name="invest_construction_id" invisible="1"/> |
| 127 | + <field |
| 128 | + name="invest_construction_phase_id" |
| 129 | + invisible="0" |
| 130 | + attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False), |
| 131 | + ('project_id','=',False),('personnel_costcenter_id','=',False), |
| 132 | + ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
| 133 | + |
| 134 | + <field |
| 135 | + name="personnel_costcenter_id" |
| 136 | + invisible="1" |
| 137 | + attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False), |
| 138 | + ('invest_construction_phase_id','=',False),('project_id','=',False), |
| 139 | + ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
| 140 | + |
| 141 | + <field name="fund_id" invisible="0"/> |
| 142 | + <field name="cost_control_type_id" invisible="1"/> |
| 143 | + <field name="cost_control_id" invisible="0"/> |
| 144 | + |
| 145 | + <!-- --> |
| 146 | + |
| 147 | + <field name="quantity"/> |
| 148 | + <field name="uos_id" groups="product.group_uom" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)"/> |
| 149 | + <field name="price_unit"/> |
| 150 | + <field name="discount" groups="sale.group_discount_per_so_line"/> |
| 151 | + <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/> |
| 152 | + <field name="price_subtotal"/> |
| 153 | + </tree> |
| 154 | + |
| 155 | + </field> |
| 156 | + </record> |
| 157 | + |
| 158 | + # User want to have a checkbox to show Account column. |
| 159 | + |
| 160 | + <record id="invoice_supplier_form_show_account" model="ir.ui.view"> |
| 161 | + <field name="name">invoice.form</field> |
| 162 | + <field name="model">account.invoice</field> |
| 163 | + <field name="inherit_id" ref="account.invoice_supplier_form"/> |
| 164 | + <field name="arch" type="xml"> |
| 165 | + <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']" position="before"> |
| 166 | + <div> |
| 167 | + <field name="show_account"/> |
| 168 | + <label for="show_account" class="oe_inline"/> |
| 169 | + </div> |
| 170 | + </xpath> |
| 171 | + <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']" position="attributes"> |
| 172 | + <attribute name="attrs">{'invisible': [('show_account', '=', True)]}</attribute> |
| 173 | + </xpath> |
| 174 | + <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']" position="after"> |
| 175 | + <field |
| 176 | + name="invoice_line_show_account" |
| 177 | + attrs="{'invisible': [('show_account', '=', False)]}" |
| 178 | + context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type, |
| 179 | + 'tree_view_ref': 'pabi_account.view_invoice_line_show_account_tree'}"/> |
| 180 | + </xpath> |
| 181 | + </field> |
| 182 | + </record> |
| 183 | + |
| 184 | + |
| 185 | + <record id="invoice_form_show_account" model="ir.ui.view"> |
67 | 186 | <field name="name">invoice.form</field>
|
68 | 187 | <field name="model">account.invoice</field>
|
69 | 188 | <field name="inherit_id" ref="account.invoice_form"/>
|
|
78 | 197 | <attribute name="attrs">{'invisible': [('show_account', '=', True)]}</attribute>
|
79 | 198 | </xpath>
|
80 | 199 | <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']" position="after">
|
81 |
| - <field name="invoice_line_show_account" attrs="{'invisible': [('show_account', '=', False)]}" context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type}"> |
82 |
| - <tree string="Invoice lines" editable="bottom"> |
83 |
| - <field name="sequence" widget="handle"/> |
84 |
| - <field name="product_id" invisible="1"/> |
85 |
| - <field |
86 |
| - name="account_id" |
87 |
| - groups="account.group_account_user" |
88 |
| - domain="[('type', 'not in', ['view', 'consolidation', 'closed']), ('activity_ids', '=', activity_id and [activity_id] or False)]" |
89 |
| - on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/> |
90 |
| - <field name="company_id" invisible="1"/> |
91 |
| - <field name="account_analytic_id" invisible="1"/> |
92 |
| - |
93 |
| - <!-- Account Budget Activity --> |
94 |
| - <field name="activity_group_id"/> |
95 |
| - <field name="activity_id"/> |
96 |
| - |
97 |
| - <field name="name"/> |
98 |
| - |
99 |
| - <!-- Chart Fields --> |
100 |
| - <field name="require_chartfield" invisible="1"/> |
101 |
| - |
102 |
| - <field name="spa_id" invisible="1"/> |
103 |
| - <field name="mission_id" invisible="1"/> |
104 |
| - <field name="tag_type_id" invisible="1"/> |
105 |
| - <field name="tag_id" invisible="1"/> |
106 |
| - |
107 |
| - <field name="functional_area_id" invisible="1"/> |
108 |
| - <field name="program_group_id" invisible="1"/> |
109 |
| - <field name="program_id" invisible="1"/> |
110 |
| - <field name="project_group_id" invisible="1"/> |
111 |
| - <field |
112 |
| - name="project_id" |
113 |
| - invisible="0" |
114 |
| - attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False), |
115 |
| - ('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False), |
116 |
| - ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
117 |
| - |
118 |
| - <field name="org_id" invisible="1"/> |
119 |
| - <field name="sector_id" invisible="1"/> |
120 |
| - <field name="subsector_id" invisible="1"/> |
121 |
| - <field name="division_id" invisible="1"/> |
122 |
| - <field |
123 |
| - name="section_id" |
124 |
| - invisible="0" |
125 |
| - attrs="{'required': [('project_id','=',False),('invest_asset_id','=',False), |
126 |
| - ('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False), |
127 |
| - ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
128 |
| - <field name="costcenter_id" invisible="1"/> |
129 |
| - <field name="taxbranch_id" invisible="1"/> |
130 |
| - |
131 |
| - <field |
132 |
| - name="invest_asset_id" |
133 |
| - invisible="0" |
134 |
| - attrs="{'required': [('section_id','=',False),('project_id','=',False), |
135 |
| - ('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False), |
136 |
| - ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
137 |
| - |
138 |
| - <field name="invest_construction_id" invisible="1"/> |
139 |
| - <field |
140 |
| - name="invest_construction_phase_id" |
141 |
| - invisible="0" |
142 |
| - attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False), |
143 |
| - ('project_id','=',False),('personnel_costcenter_id','=',False), |
144 |
| - ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
145 |
| - |
146 |
| - <field |
147 |
| - name="personnel_costcenter_id" |
148 |
| - invisible="1" |
149 |
| - attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False), |
150 |
| - ('invest_construction_phase_id','=',False),('project_id','=',False), |
151 |
| - ('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/> |
152 |
| - |
153 |
| - <field name="fund_id" invisible="0"/> |
154 |
| - <field name="cost_control_type_id" invisible="1"/> |
155 |
| - <field name="cost_control_id" invisible="0"/> |
156 |
| - |
157 |
| - <!-- --> |
158 |
| - |
159 |
| - <field name="quantity"/> |
160 |
| - <field name="uos_id" groups="product.group_uom" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)"/> |
161 |
| - <field name="price_unit"/> |
162 |
| - <field name="discount" groups="sale.group_discount_per_so_line"/> |
163 |
| - <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/> |
164 |
| - <field name="price_subtotal"/> |
165 |
| - </tree> |
166 |
| - </field> |
| 200 | + <field |
| 201 | + name="invoice_line_show_account" |
| 202 | + attrs="{'invisible': [('show_account', '=', False)]}" |
| 203 | + context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type, |
| 204 | + 'tree_view_ref': 'pabi_account.view_invoice_line_show_account_tree'}"/> |
167 | 205 | </xpath>
|
168 | 206 | </field>
|
169 | 207 | </record>
|
|
0 commit comments