-
-
Notifications
You must be signed in to change notification settings - Fork 305
/
account.xml
174 lines (147 loc) · 8.51 KB
/
account.xml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
INVOICE CUSTOMER
-->
<record model="ir.ui.view" id="view_withholding_invoice_form">
<field name="name">view.withholding.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//page/group/group/field[@name='journal_id']" position="after">
<field name="withholding_tax" invisible="1"/>
</xpath>
<xpath expr="//page/field[@name='invoice_line_ids']" position="attributes">
<attribute name="context">{'fiscal_position_id': fiscal_position_id, 'type': type, 'journal_id': journal_id, 'default_invoice_id': id}</attribute>
</xpath>
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='invoice_line_tax_ids']" position="after">
<field name="invoice_line_tax_wt_ids" widget="many2many_tags" options="{'no_create': True}"/>
</xpath>
<xpath expr="//page/field[@name='tax_line_ids']" position="after">
<field name="withholding_tax_line_ids" attrs="{'invisible': [('withholding_tax', '=', False)]}">
<tree>
<field name="withholding_tax_id"/>
<field name="base"/>
<field name="tax"/>
</tree>
<form>
<group colspan="2">
<field name="withholding_tax_id" />
<field name="base"/>
<field name="tax"/>
</group>
</form>
<tree editable="bottom" string="Withholding Taxes">
<field name="withholding_tax_id"/>
<field name="base"/>
<field name="tax"/>
</tree>
</field>
</xpath>
<xpath expr="//group[hasclass('oe_subtotal_footer', 'oe_right')]/field[@name='amount_total']" position="after">
<field name="withholding_tax_amount" widget="monetary" options="{'currency_field': 'currency_id'}"
attrs="{'invisible': [('withholding_tax', '=', False)]}"/>
<field name="amount_net_pay" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator"
attrs="{'invisible': [('withholding_tax', '=', False)]}"/>
</xpath>
<xpath expr="//group[hasclass('oe_subtotal_footer', 'oe_right')]/field[@name='residual']" position="after">
<field name="amount_net_pay_residual" widget="monetary" options="{'currency_field': 'currency_id'}"
attrs="{'invisible': ['|', ('state', '=', 'draft'), ('withholding_tax', '=', False)]}" class="oe_subtotal_footer_separator"/>
</xpath>
</field>
</record>
<!--
INVOICE SUPPLIER
-->
<record model="ir.ui.view" id="view_withholding_invoice_supplier_form">
<field name="name">view.withholding.invoice.supplier.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<xpath expr="//group/group/field[@name='reference']" position="after">
<field name="withholding_tax" invisible="1"/>
</xpath>
<xpath expr="//page/field[@name='invoice_line_ids']" position="attributes">
<attribute name="context">{'fiscal_position_id': fiscal_position_id, 'type': type, 'journal_id': journal_id}</attribute>
</xpath>
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='invoice_line_tax_ids']" position="after">
<field name="invoice_line_tax_wt_ids" widget="many2many_tags" options="{'no_create': True}"/>
</xpath>
<xpath expr="//group/div/field[@name='tax_line_ids']" position="after">
<field name="withholding_tax_line_ids" attrs="{'invisible': [('withholding_tax', '=', False)]}">
<tree>
<field name="withholding_tax_id"/>
<field name="base"/>
<field name="tax"/>
</tree>
<form>
<group colspan="2">
<field name="withholding_tax_id" />
<field name="base"/>
<field name="tax"/>
</group>
</form>
<tree editable="bottom" string="Withholding Taxes">
<field name="withholding_tax_id"/>
<field name="base"/>
<field name="tax"/>
</tree>
</field>
</xpath>
<xpath expr="//group[hasclass('oe_subtotal_footer', 'oe_right')]/field[@name='amount_total']" position="after">
<field name="withholding_tax_amount" widget="monetary" options="{'currency_field': 'currency_id'}"
attrs="{'invisible': [('withholding_tax', '=', False)]}"/>
<field name="amount_net_pay" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator"
attrs="{'invisible': [('withholding_tax', '=', False)]}"/>
</xpath>
<xpath expr="//group[hasclass('oe_subtotal_footer', 'oe_right')]/field[@name='residual']" position="after">
<field name="amount_net_pay_residual" widget="monetary" options="{'currency_field': 'currency_id'}"
attrs="{'invisible': ['|', ('state', '=', 'draft'), ('withholding_tax', '=', False)]}" class="oe_subtotal_footer_separator"/>
</xpath>
</field>
</record>
<record id="invoice_supplier_tree" model="ir.ui.view">
<field name="name">view.withholding.invoice.supplier.tree</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_tree"/>
<field name="arch" type="xml">
<field name="residual_signed" position="after">
<field name="amount_net_pay" widget="monetary" options="{'currency_field': 'currency_id'}" sum="Net to pay"/>
</field>
</field>
</record>
<!--
INVOICE LINE
-->
<record model="ir.ui.view" id="view_wt_invoice_line_form">
<field name="name">view.withholding.invoice.supplier.form</field>
<field name="model">account.invoice.line</field>
<field name="inherit_id" ref="account.view_invoice_line_form"/>
<field name="arch" type="xml">
<xpath expr="//group/group/field[@name='invoice_line_tax_ids']" position="after">
<field name="invoice_line_tax_wt_ids" widget="many2many_tags" options="{'no_create': True}" />
</xpath>
</field>
</record>
<!--
FISCAL POSITION
-->
<record model="ir.ui.view" id="view_withholding_tax_fiscal_position_form">
<field name="name">view.withholding.tax.fiscal.position.form</field>
<field name="model">account.fiscal.position</field>
<field name="inherit_id" ref="account.view_account_position_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='account_mapping']" position="after">
<page name="account_withholding_tax" string="Withholding Tax">
<field name="withholding_tax_ids" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="tax"/>
<field name="base"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>
</odoo>