-
-
Notifications
You must be signed in to change notification settings - Fork 192
Expand file tree
/
Copy pathaccount_invoice_margin_view.xml
More file actions
79 lines (79 loc) · 3.18 KB
/
Copy pathaccount_invoice_margin_view.xml
File metadata and controls
79 lines (79 loc) · 3.18 KB
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
<?xml version="1.0" encoding="utf-8" ?>
<!-- © 2017 Sergio Teruel <sergio.teruel@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
<odoo>
<record id="invoice_margin_form_tree" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<!-- To display new fields in invoice lines tab -->
<xpath
expr="//field[@name='invoice_line_ids']/tree/field[@name='price_unit']"
position="after"
>
<field
name="purchase_price"
optional="show"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
<field
name="margin"
optional="hide"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
<field
name="margin_percent"
optional="hide"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
</xpath>
<!-- Add fields to embed invoice line form view -->
<xpath
expr="//field[@name='invoice_line_ids']/form//field[@name='discount']"
position="after"
>
<field
name="purchase_price"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
<field
name="margin"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
<field
name="margin_percent"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
</xpath>
<field name="tax_totals" position="before">
<field
name="margin"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
<field
name="margin_percent"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
</field>
</field>
</record>
<record id="view_account_invoice_tree" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_invoice_tree" />
<field name="arch" type="xml">
<field name="amount_untaxed_signed" position="before">
<field
name="margin_signed"
sum="Total"
optional="hide"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
<field
name="margin_percent"
optional="hide"
groups="account_invoice_margin.group_account_invoice_margin_security"
/>
</field>
</field>
</record>
</odoo>