File tree 7 files changed +95
-2
lines changed
7 files changed +95
-2
lines changed Original file line number Diff line number Diff line change 25
25
"views/account_move_view.xml" ,
26
26
"views/product_template_view.xml" ,
27
27
"views/product_view.xml" ,
28
+ "report/invoice.xml" ,
28
29
],
29
30
"installable" : True ,
30
31
}
Original file line number Diff line number Diff line change @@ -59,3 +59,7 @@ def _get_tax_totals(
59
59
)
60
60
res ["groups_by_subtotal" ][_ ("Untaxed Amount" )] = data
61
61
return res
62
+
63
+ def _get_formatted_ecotax_amount (self ):
64
+ self .ensure_one ()
65
+ return formatLang (self .env , self .amount_ecotax , currency_obj = self .currency_id )
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <odoo >
3
+ <template
4
+ id =" report_invoice_document"
5
+ inherit_id =" account.report_invoice_document"
6
+ priority =" 100"
7
+ >
8
+ <xpath expr =" //th[@name='th_price_unit']" position =" after" >
9
+ <th
10
+ name =" th_ecotax"
11
+ t-if =" o.amount_ecotax"
12
+ t-attf-class =" text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"
13
+ >
14
+ <span name =" ecotax_line_label" >Eco Part Unit</span >
15
+ </th >
16
+ </xpath >
17
+ <xpath expr =" //td[span[@t-field='line.discount']]" position =" after" >
18
+ <td
19
+ t-if =" o.amount_ecotax"
20
+ t-attf-class =" text-center {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"
21
+ >
22
+ <span
23
+ class =" text-nowrap"
24
+ t-field =" line.ecotax_amount_unit"
25
+ />
26
+ </td >
27
+ </xpath >
28
+ </template >
29
+
30
+ <template
31
+ id =" document_tax_totals"
32
+ inherit_id =" account.document_tax_totals"
33
+ priority =" 100"
34
+ >
35
+ <xpath expr =" //t[@t-set='subtotal_to_show']" position =" before" >
36
+ <tr t-if =" o.amount_ecotax" name =" ecotax_line" >
37
+ <td name =" ecotax_label" >Including Eco Part</td >
38
+ <td class =" text-end" >
39
+ <span
40
+ t-esc =" o._get_formatted_ecotax_amount()"
41
+ />
42
+ </td >
43
+ </tr >
44
+ </xpath >
45
+ </template >
46
+ </odoo >
Original file line number Diff line number Diff line change 138
138
<field name =" name" widget =" text" readonly =" 1" />
139
139
<notebook >
140
140
<page string =" Ecotaxe lines" name =" ecotax_line" >
141
- <field name =" ecotax_line_ids" nolabel =" 1" readonly =" 1" >
141
+ <field
142
+ name =" ecotax_line_ids"
143
+ nolabel =" 1"
144
+ attrs =" {'readonly': [('parent_state', '!=', 'draft')]}"
145
+ >
142
146
<tree editable =" bottom" >
143
147
<field name =" classification_id" />
144
- <field name =" force_amount_unit" readonly = " 1 " />
148
+ <field name =" force_amount_unit" />
145
149
<field name =" amount_unit" />
146
150
<field
147
151
name =" amount_total"
Original file line number Diff line number Diff line change 17
17
"data" : [
18
18
"views/account_ecotax_classification_view.xml" ,
19
19
"views/account_tax_view.xml" ,
20
+ "views/account_move_view.xml" ,
21
+ "report/invoice.xml" ,
20
22
],
21
23
"installable" : True ,
22
24
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <odoo >
3
+ <template
4
+ id =" report_invoice_document"
5
+ inherit_id =" account.report_invoice_document"
6
+ priority =" 150"
7
+ >
8
+ <xpath expr =" //t[@t-set='taxes']" position =" replace" >
9
+ <t
10
+ t-set =" taxes"
11
+ t-value =" ', '.join([(tax.description or tax.name) for tax in line.tax_ids.filtered(lambda t: not t.is_ecotax)])"
12
+ />
13
+ </xpath >
14
+ </template >
15
+
16
+ <template
17
+ id =" document_tax_totals"
18
+ inherit_id =" account.document_tax_totals"
19
+ priority =" 150"
20
+ >
21
+ <xpath expr =" //tr[@name='ecotax_line']" position =" replace" >
22
+ </xpath >
23
+ </template >
24
+ </odoo >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <odoo >
3
+ <record id =" view_move_line_ecotax_form" model =" ir.ui.view" >
4
+ <field name =" model" >account.move.line</field >
5
+ <field name =" inherit_id" ref =" account_ecotax.view_move_line_ecotax_form" />
6
+ <field name =" arch" type =" xml" >
7
+ <field name =" ecotax_line_ids" position =" attributes" >
8
+ <attribute name =" readonly" >1</attribute >
9
+ </field >
10
+ </field >
11
+ </record >
12
+ </odoo >
You can’t perform that action at this time.
0 commit comments