odoo-addon-l10n-it-account-stamp 16.0.1.1.0__py3-none-any.whl → 18.0.1.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of odoo-addon-l10n-it-account-stamp might be problematic. Click here for more details.

Files changed (28) hide show
  1. odoo/addons/l10n_it_account_stamp/README.rst +69 -43
  2. odoo/addons/l10n_it_account_stamp/__manifest__.py +2 -2
  3. odoo/addons/l10n_it_account_stamp/data/data.xml +5 -7
  4. odoo/addons/l10n_it_account_stamp/i18n/it.po +108 -143
  5. odoo/addons/l10n_it_account_stamp/i18n/l10n_it_account_stamp.pot +68 -95
  6. odoo/addons/l10n_it_account_stamp/migrations/18.0.1.0.0/noupdate_changes.xml +12 -0
  7. odoo/addons/l10n_it_account_stamp/migrations/18.0.1.0.0/post-migration.py +14 -0
  8. odoo/addons/l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migration.py +77 -0
  9. odoo/addons/l10n_it_account_stamp/migrations/18.0.1.1.0/post-migration.py +17 -0
  10. odoo/addons/l10n_it_account_stamp/models/account_move.py +82 -46
  11. odoo/addons/l10n_it_account_stamp/models/company.py +8 -8
  12. odoo/addons/l10n_it_account_stamp/models/product.py +22 -11
  13. odoo/addons/l10n_it_account_stamp/readme/CONFIGURE.md +5 -5
  14. odoo/addons/l10n_it_account_stamp/readme/CONTRIBUTORS.md +1 -0
  15. odoo/addons/l10n_it_account_stamp/readme/DESCRIPTION.md +4 -3
  16. odoo/addons/l10n_it_account_stamp/readme/ROADMAP.md +7 -0
  17. odoo/addons/l10n_it_account_stamp/readme/USAGE.md +3 -3
  18. odoo/addons/l10n_it_account_stamp/static/description/index.html +57 -33
  19. odoo/addons/l10n_it_account_stamp/tests/test_account_stamp_invoicing.py +115 -27
  20. odoo/addons/l10n_it_account_stamp/views/account_move_report.xml +8 -6
  21. odoo/addons/l10n_it_account_stamp/views/account_move_view.xml +26 -18
  22. odoo/addons/l10n_it_account_stamp/views/company_view.xml +8 -33
  23. odoo/addons/l10n_it_account_stamp/views/product_view.xml +12 -16
  24. {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.2.0.dist-info}/METADATA +73 -46
  25. odoo_addon_l10n_it_account_stamp-18.0.1.2.0.dist-info/RECORD +31 -0
  26. {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.2.0.dist-info}/WHEEL +1 -1
  27. odoo_addon_l10n_it_account_stamp-16.0.1.1.0.dist-info/RECORD +0 -26
  28. {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.2.0.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 16.0\n"
7
+ "Project-Id-Version: Odoo Server 18.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -16,47 +16,30 @@ msgstr ""
16
16
  #. module: l10n_it_account_stamp
17
17
  #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp
18
18
  msgid ""
19
- "<span attrs=\"{'invisible': [('state', '=', 'draft')]}\">\n"
20
- " Stamp can only be charged to customer when invoice is in draft state\n"
21
- " </span>"
22
- msgstr ""
23
-
24
- #. module: l10n_it_account_stamp
25
- #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp
26
- msgid ""
27
- "<span attrs=\"{'invisible': [('tax_stamp_line_present', '=', False)]}\">\n"
19
+ "<span invisible=\"not l10n_it_account_stamp_is_stamp_duty_invoice_line_present\">\n"
28
20
  " Stamp charged to customer\n"
29
21
  " </span>"
30
22
  msgstr ""
31
23
 
32
24
  #. module: l10n_it_account_stamp
33
- #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp
34
- msgid ""
35
- "<span class=\"o_form_label\">Configuration for Tax stamp\n"
36
- " </span>\n"
37
- " <span class=\"fa fa-lg fa-building-o\" title=\"Values set here are company-specific.\" aria-label=\"Values set here are company-specific.\" groups=\"base.group_multi_company\" role=\"img\"/>"
38
- msgstr ""
39
-
40
- #. module: l10n_it_account_stamp
41
- #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.report_invoice_document_custom_fields_ext
25
+ #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp
42
26
  msgid ""
43
- "<span>Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 "
44
- "del DPR 642/1972 e del DM 17/06/2014</span>"
27
+ "<span invisible=\"state == 'draft'\">\n"
28
+ " Stamp can only be charged to customer when invoice is in draft state\n"
29
+ " </span>"
45
30
  msgstr ""
46
31
 
47
32
  #. module: l10n_it_account_stamp
48
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__manually_apply_tax_stamp
49
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__manually_apply_tax_stamp
50
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__manually_apply_tax_stamp
51
- msgid "Apply tax stamp"
33
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_manually_apply_stamp_duty
34
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_manually_apply_stamp_duty
35
+ msgid "Apply stamp duty"
52
36
  msgstr ""
53
37
 
54
38
  #. module: l10n_it_account_stamp
55
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__auto_compute_stamp
56
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__auto_compute_stamp
57
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__auto_compute_stamp
58
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__auto_compute
59
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__auto_compute
39
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_auto_compute_stamp_duty
40
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_auto_compute_stamp_duty
41
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_auto_compute
42
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_auto_compute
60
43
  msgid "Auto-compute"
61
44
  msgstr ""
62
45
 
@@ -77,7 +60,13 @@ msgstr ""
77
60
 
78
61
  #. module: l10n_it_account_stamp
79
62
  #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp
80
- msgid "Configuration for Tax stamp"
63
+ msgid "Configuration for stamp duty"
64
+ msgstr ""
65
+
66
+ #. module: l10n_it_account_stamp
67
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_stamp_duty
68
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_stamp_duty
69
+ msgid "Dati Bollo"
81
70
  msgstr ""
82
71
 
83
72
  #. module: l10n_it_account_stamp
@@ -87,14 +76,21 @@ msgid ""
87
76
  " the application of the account stamp."
88
77
  msgstr ""
89
78
 
79
+ #. module: l10n_it_account_stamp
80
+ #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.report_invoice_document_custom_fields_ext
81
+ msgid ""
82
+ "Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 del DPR "
83
+ "642/1972 e del DM 17/06/2014"
84
+ msgstr ""
85
+
90
86
  #. module: l10n_it_account_stamp
91
87
  #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move_line__is_stamp_line
92
88
  msgid "Is Stamp Line"
93
89
  msgstr ""
94
90
 
95
91
  #. module: l10n_it_account_stamp
96
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__is_stamp
97
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__is_stamp
92
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_is_stamp
93
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_is_stamp
98
94
  msgid "Is a stamp"
99
95
  msgstr ""
100
96
 
@@ -111,17 +107,13 @@ msgstr ""
111
107
  #. module: l10n_it_account_stamp
112
108
  #. odoo-python
113
109
  #: code:addons/l10n_it_account_stamp/models/account_move.py:0
114
- #, python-format
115
110
  msgid "Missing account income configuration for %s"
116
111
  msgstr ""
117
112
 
118
113
  #. module: l10n_it_account_stamp
119
114
  #. odoo-python
120
115
  #: code:addons/l10n_it_account_stamp/models/account_move.py:0
121
- #: code:addons/l10n_it_account_stamp/models/account_move.py:0
122
- #: code:addons/l10n_it_account_stamp/models/account_move.py:0
123
- #, python-format
124
- msgid "Missing tax stamp product in company settings!"
116
+ msgid "Missing stamp duty product in company settings!"
125
117
  msgstr ""
126
118
 
127
119
  #. module: l10n_it_account_stamp
@@ -132,111 +124,92 @@ msgstr ""
132
124
  #. module: l10n_it_account_stamp
133
125
  #. odoo-python
134
126
  #: code:addons/l10n_it_account_stamp/models/account_move.py:0
135
- #, python-format
136
127
  msgid "Product %s must have income and expense accounts"
137
128
  msgstr ""
138
129
 
139
130
  #. module: l10n_it_account_stamp
140
- #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp
141
- msgid "Product used as Tax Stamp in customer invoices"
131
+ #: model:ir.model.fields,help:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id
132
+ #: model:ir.model.fields,help:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id
133
+ msgid "Product used as stamp duty in customer invoices."
142
134
  msgstr ""
143
135
 
144
136
  #. module: l10n_it_account_stamp
145
- #: model:ir.model.fields,help:l10n_it_account_stamp.field_res_company__tax_stamp_product_id
146
- #: model:ir.model.fields,help:l10n_it_account_stamp.field_res_config_settings__tax_stamp_product_id
147
- msgid "Product used as Tax Stamp in customer invoices."
137
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied
138
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied
139
+ #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp
140
+ #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.product_template_form_view_account_stamp
141
+ msgid "Stamp Duty"
148
142
  msgstr ""
149
143
 
150
144
  #. module: l10n_it_account_stamp
151
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__stamp_apply_min_total_base
152
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__stamp_apply_min_total_base
153
- msgid "Stamp applicability min total base"
145
+ #. odoo-python
146
+ #: code:addons/l10n_it_account_stamp/models/account_move.py:0
147
+ msgid "Stamp Duty Expense"
154
148
  msgstr ""
155
149
 
156
150
  #. module: l10n_it_account_stamp
157
- #: model:product.template,description_sale:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template
158
- msgid ""
159
- "Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree June\n"
160
- " 17, 2014\n"
161
- " "
151
+ #. odoo-python
152
+ #: code:addons/l10n_it_account_stamp/models/account_move.py:0
153
+ msgid "Stamp Duty Income"
162
154
  msgstr ""
163
155
 
164
156
  #. module: l10n_it_account_stamp
165
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp_line_present
166
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__tax_stamp_line_present
167
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__tax_stamp_line_present
168
- msgid "Stamp line is present in invoice"
157
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id
158
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id
159
+ msgid "Stamp Duty Product"
169
160
  msgstr ""
170
161
 
171
162
  #. module: l10n_it_account_stamp
172
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__stamp_apply_tax_ids
173
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__stamp_apply_tax_ids
174
- msgid "Stamp taxes"
163
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_tax_apply_min_total_base
164
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_tax_apply_min_total_base
165
+ msgid "Stamp applicability min total base"
175
166
  msgstr ""
176
167
 
177
168
  #. module: l10n_it_account_stamp
178
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp
179
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__tax_stamp
180
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__tax_stamp
181
- msgid "Tax Stamp"
169
+ #: model:product.template,name:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template
170
+ msgid "Stamp duty 2 euro"
182
171
  msgstr ""
183
172
 
184
173
  #. module: l10n_it_account_stamp
185
- #: model:product.template,name:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template
186
- msgid "Tax Stamp 2 euro"
174
+ #: model:ir.model.fields,help:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied
175
+ #: model:ir.model.fields,help:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied
176
+ msgid "Stamp duty is applied to this invoice."
187
177
  msgstr ""
188
178
 
189
179
  #. module: l10n_it_account_stamp
190
180
  #. odoo-python
191
181
  #: code:addons/l10n_it_account_stamp/models/account_move.py:0
192
- #, python-format
193
- msgid "Tax Stamp Expense"
182
+ msgid "Stamp duty is not applicable"
194
183
  msgstr ""
195
184
 
196
185
  #. module: l10n_it_account_stamp
197
186
  #. odoo-python
198
187
  #: code:addons/l10n_it_account_stamp/models/account_move.py:0
199
- #, python-format
200
- msgid "Tax Stamp Income"
201
- msgstr ""
202
-
203
- #. module: l10n_it_account_stamp
204
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_company__tax_stamp_product_id
205
- #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_config_settings__tax_stamp_product_id
206
- #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp
207
- msgid "Tax Stamp Product"
188
+ msgid "Stamp duty line %s already present. Remove it first."
208
189
  msgstr ""
209
190
 
210
191
  #. module: l10n_it_account_stamp
211
- #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp
212
- #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.product_template_form_view_account_stamp
213
- msgid "Tax stamp"
214
- msgstr ""
215
-
216
- #. module: l10n_it_account_stamp
217
- #: model:ir.model.fields,help:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp
218
- #: model:ir.model.fields,help:l10n_it_account_stamp.field_account_move__tax_stamp
219
- #: model:ir.model.fields,help:l10n_it_account_stamp.field_account_payment__tax_stamp
220
- msgid "Tax stamp is applied to this invoice."
192
+ #: model:product.template,description_sale:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template
193
+ msgid ""
194
+ "Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree June\n"
195
+ " 17, 2014\n"
196
+ " "
221
197
  msgstr ""
222
198
 
223
199
  #. module: l10n_it_account_stamp
224
- #. odoo-python
225
- #: code:addons/l10n_it_account_stamp/models/account_move.py:0
226
- #, python-format
227
- msgid "Tax stamp is not applicable"
200
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_invoice_line_present
201
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_invoice_line_present
202
+ msgid "Stamp line is present in invoice"
228
203
  msgstr ""
229
204
 
230
205
  #. module: l10n_it_account_stamp
231
- #. odoo-python
232
- #: code:addons/l10n_it_account_stamp/models/account_move.py:0
233
- #, python-format
234
- msgid "Tax stamp line %s already present. Remove it first."
206
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_stamp_duty_apply_tax_ids
207
+ #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_stamp_duty_apply_tax_ids
208
+ msgid "Stamp taxes"
235
209
  msgstr ""
236
210
 
237
211
  #. module: l10n_it_account_stamp
238
212
  #. odoo-python
239
213
  #: code:addons/l10n_it_account_stamp/models/product.py:0
240
- #, python-format
241
214
  msgid "The product %s must be a stamp to apply set taxes!"
242
215
  msgstr ""
@@ -0,0 +1,12 @@
1
+ <?xml version='1.0' encoding='utf-8' ?>
2
+ <odoo>
3
+ <record id="l10n_it_account_stamp_2_euro" model="product.product">
4
+ <field name="name">Stamp duty 2 euro</field>
5
+ </record>
6
+ <record id="base.main_company" model="res.company">
7
+ <field
8
+ name="l10n_it_account_stamp_stamp_duty_product_id"
9
+ ref="l10n_it_account_stamp.l10n_it_account_stamp_2_euro"
10
+ />
11
+ </record>
12
+ </odoo>
@@ -0,0 +1,14 @@
1
+ # Copyright 2024 Sergio Zanchetta
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+
4
+ from openupgradelib import openupgrade
5
+
6
+
7
+ @openupgrade.migrate()
8
+ def migrate(env, version):
9
+ openupgrade.load_data(
10
+ env, "l10n_it_account_stamp", "migrations/18.0.1.0.0/noupdate_changes.xml"
11
+ )
12
+ openupgrade.delete_record_translations(
13
+ env.cr, "l10n_it_account_stamp", ["l10n_it_account_stamp_2_euro"]
14
+ )
@@ -0,0 +1,77 @@
1
+ # Copyright 2024 Sergio Zanchetta
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+
4
+ from openupgradelib import openupgrade
5
+
6
+
7
+ def _rename_fields(env):
8
+ openupgrade.rename_fields(
9
+ env,
10
+ [
11
+ (
12
+ "account.move",
13
+ "account_move",
14
+ "tax_stamp",
15
+ "l10n_it_account_stamp_is_stamp_duty_applied",
16
+ ),
17
+ (
18
+ "account.move",
19
+ "account_move",
20
+ "tax_stamp_line_present",
21
+ "l10n_it_account_stamp_is_stamp_duty_present",
22
+ ),
23
+ (
24
+ "account.move",
25
+ "account_move",
26
+ "auto_compute_stamp",
27
+ "l10n_it_account_stamp_auto_compute_stamp_duty",
28
+ ),
29
+ (
30
+ "account.move",
31
+ "account_move",
32
+ "manually_apply_tax_stamp",
33
+ "l10n_it_account_stamp_manually_apply_stamp_duty",
34
+ ),
35
+ (
36
+ "res.company",
37
+ "res_company",
38
+ "tax_stamp_product_id",
39
+ "l10n_it_account_stamp_stamp_duty_product_id",
40
+ ),
41
+ (
42
+ "res.config.settings",
43
+ "res_config_settings",
44
+ "tax_stamp_product_id",
45
+ "l10n_it_account_stamp_stamp_duty_product_id",
46
+ ),
47
+ (
48
+ "product.template",
49
+ "product_template",
50
+ "stamp_apply_tax_ids",
51
+ "l10n_it_account_stamp_stamp_duty_apply_tax_ids",
52
+ ),
53
+ (
54
+ "product.template",
55
+ "product_template",
56
+ "stamp_apply_min_total_base",
57
+ "l10n_it_account_stamp_tax_apply_min_total_base",
58
+ ),
59
+ (
60
+ "product.template",
61
+ "product_template",
62
+ "is_stamp",
63
+ "l10n_it_account_stamp_is_stamp",
64
+ ),
65
+ (
66
+ "product.template",
67
+ "product_template",
68
+ "auto_compute",
69
+ "l10n_it_account_stamp_auto_compute",
70
+ ),
71
+ ],
72
+ )
73
+
74
+
75
+ @openupgrade.migrate()
76
+ def migrate(env, version):
77
+ _rename_fields(env)
@@ -0,0 +1,17 @@
1
+ # Copyright 2025 Sergio Zanchetta
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+
4
+ from openupgradelib import openupgrade
5
+
6
+
7
+ @openupgrade.migrate()
8
+ def migrate(env, version):
9
+ openupgrade.logged_query(
10
+ env.cr,
11
+ """
12
+ UPDATE account_move_line aml
13
+ SET
14
+ is_stamp_line = NULL
15
+ WHERE aml.product_id IS NOT NULL AND aml.is_stamp_line = True
16
+ """,
17
+ )
@@ -8,38 +8,67 @@ from odoo.exceptions import UserError
8
8
  class AccountMove(models.Model):
9
9
  _inherit = "account.move"
10
10
 
11
- tax_stamp = fields.Boolean(
12
- help="Tax stamp is applied to this invoice.",
11
+ l10n_it_account_stamp_is_stamp_duty_applied = fields.Boolean(
12
+ string="Stamp Duty",
13
+ help="Stamp duty is applied to this invoice.",
13
14
  readonly=False,
14
- compute="_compute_tax_stamp",
15
+ compute="_compute_l10n_it_account_stamp_is_stamp_duty_applied",
15
16
  store=True,
16
17
  )
17
- tax_stamp_line_present = fields.Boolean(
18
+ l10n_it_account_stamp_is_stamp_duty_invoice_line_present = fields.Boolean(
18
19
  string="Stamp line is present in invoice",
19
- compute="_compute_tax_stamp_line_present",
20
+ compute="_compute_l10n_it_account_stamp_is_stamp_duty_invoice_line_present",
20
21
  )
21
- auto_compute_stamp = fields.Boolean(
22
- related="company_id.tax_stamp_product_id.auto_compute"
22
+ l10n_it_account_stamp_auto_compute_stamp_duty = fields.Boolean(
23
+ related="company_id.l10n_it_account_stamp_stamp_duty_product_id.l10n_it_account_stamp_auto_compute",
23
24
  )
24
- manually_apply_tax_stamp = fields.Boolean("Apply tax stamp")
25
+ l10n_it_account_stamp_manually_apply_stamp_duty = fields.Boolean(
26
+ string="Apply stamp duty",
27
+ )
28
+ l10n_it_stamp_duty = fields.Float(
29
+ compute="_compute_l10n_it_stamp_duty",
30
+ store=True,
31
+ )
32
+
33
+ @api.depends(
34
+ "l10n_it_account_stamp_is_stamp_duty_applied",
35
+ "company_id.l10n_it_account_stamp_stamp_duty_product_id.list_price",
36
+ )
37
+ def _compute_l10n_it_stamp_duty(self):
38
+ for invoice in self:
39
+ if invoice.state != "draft":
40
+ continue
41
+ elif invoice.l10n_it_account_stamp_is_stamp_duty_applied:
42
+ stamp_product = (
43
+ invoice.company_id.l10n_it_account_stamp_stamp_duty_product_id
44
+ )
45
+ stamp_duty_amount = stamp_product.list_price
46
+ else:
47
+ stamp_duty_amount = 0
48
+ invoice.l10n_it_stamp_duty = stamp_duty_amount
25
49
 
26
- def is_tax_stamp_applicable(self):
50
+ def is_stamp_duty_applicable(self):
27
51
  stamp_product_id = self.company_id.with_context(
28
52
  lang=self.partner_id.lang
29
- ).tax_stamp_product_id
53
+ ).l10n_it_account_stamp_stamp_duty_product_id
30
54
  if not stamp_product_id:
31
- raise UserError(_("Missing tax stamp product in company settings!"))
55
+ raise UserError(_("Missing stamp duty product in company settings!"))
32
56
  total_tax_base = sum(
33
57
  (
34
58
  inv_tax.price_subtotal
35
59
  for inv_tax in self.line_ids.filtered(
36
60
  lambda line: set(line.tax_ids.ids)
37
- & set(stamp_product_id.stamp_apply_tax_ids.ids)
61
+ & set(
62
+ stamp_product_id.l10n_it_account_stamp_stamp_duty_apply_tax_ids.ids
63
+ )
38
64
  )
39
65
  ),
40
66
  0.0,
41
67
  )
42
- return total_tax_base >= stamp_product_id.stamp_apply_min_total_base
68
+ return (
69
+ total_tax_base
70
+ >= stamp_product_id.l10n_it_account_stamp_tax_apply_min_total_base
71
+ )
43
72
 
44
73
  @api.depends(
45
74
  "invoice_line_ids.price_subtotal",
@@ -48,31 +77,33 @@ class AccountMove(models.Model):
48
77
  "company_id",
49
78
  "invoice_date",
50
79
  "move_type",
51
- "manually_apply_tax_stamp",
80
+ "l10n_it_account_stamp_manually_apply_stamp_duty",
52
81
  "invoice_line_ids.tax_ids",
53
82
  )
54
- def _compute_tax_stamp(self):
83
+ def _compute_l10n_it_account_stamp_is_stamp_duty_applied(self):
55
84
  for invoice in self:
56
- invoice.tax_stamp = False
57
- if invoice.auto_compute_stamp:
58
- invoice.tax_stamp = invoice.is_tax_stamp_applicable()
85
+ invoice.l10n_it_account_stamp_is_stamp_duty_applied = False
86
+ if invoice.l10n_it_account_stamp_auto_compute_stamp_duty:
87
+ invoice.l10n_it_account_stamp_is_stamp_duty_applied = (
88
+ invoice.is_stamp_duty_applicable()
89
+ )
59
90
  else:
60
- if invoice.manually_apply_tax_stamp:
61
- invoice.tax_stamp = True
91
+ if invoice.l10n_it_account_stamp_manually_apply_stamp_duty:
92
+ invoice.l10n_it_account_stamp_is_stamp_duty_applied = True
62
93
 
63
- def add_tax_stamp_line(self):
94
+ def add_stamp_duty_invoice_line(self):
64
95
  for inv in self:
65
- if not inv.tax_stamp:
66
- raise UserError(_("Tax stamp is not applicable"))
96
+ if not inv.l10n_it_account_stamp_is_stamp_duty_applied:
97
+ raise UserError(_("Stamp duty is not applicable"))
67
98
  stamp_product_id = inv.company_id.with_context(
68
99
  lang=inv.partner_id.lang
69
- ).tax_stamp_product_id
100
+ ).l10n_it_account_stamp_stamp_duty_product_id
70
101
  if not stamp_product_id:
71
- raise UserError(_("Missing tax stamp product in company settings!"))
102
+ raise UserError(_("Missing stamp duty product in company settings!"))
72
103
  for line in inv.invoice_line_ids:
73
- if line.product_id and line.product_id.is_stamp:
104
+ if line.product_id and line.product_id.l10n_it_account_stamp_is_stamp:
74
105
  raise UserError(
75
- _("Tax stamp line %s already present. Remove it first.")
106
+ _("Stamp duty line %s already present. Remove it first.")
76
107
  % line.name
77
108
  )
78
109
  stamp_account = stamp_product_id.property_account_income_id
@@ -84,7 +115,6 @@ class AccountMove(models.Model):
84
115
  invoice_line_vals = {
85
116
  "move_id": inv.id,
86
117
  "product_id": stamp_product_id.id,
87
- "is_stamp_line": True,
88
118
  "name": stamp_product_id.description_sale,
89
119
  "sequence": 99999,
90
120
  "account_id": stamp_account.id,
@@ -96,7 +126,7 @@ class AccountMove(models.Model):
96
126
  }
97
127
  inv.write({"invoice_line_ids": [(0, 0, invoice_line_vals)]})
98
128
 
99
- def is_tax_stamp_line_present(self):
129
+ def is_stamp_duty_line_present(self):
100
130
  self.ensure_one()
101
131
  for line in self.line_ids:
102
132
  if line.is_stamp_line:
@@ -106,21 +136,23 @@ class AccountMove(models.Model):
106
136
  @api.depends(
107
137
  "invoice_line_ids",
108
138
  "invoice_line_ids.product_id",
109
- "invoice_line_ids.product_id.is_stamp",
139
+ "invoice_line_ids.product_id.l10n_it_account_stamp_is_stamp",
110
140
  )
111
- def _compute_tax_stamp_line_present(self):
141
+ def _compute_l10n_it_account_stamp_is_stamp_duty_invoice_line_present(self):
112
142
  for invoice in self:
113
- invoice.tax_stamp_line_present = invoice.is_tax_stamp_line_present()
143
+ invoice.l10n_it_account_stamp_is_stamp_duty_invoice_line_present = (
144
+ invoice.is_stamp_duty_product_present()
145
+ )
114
146
 
115
- def is_tax_stamp_product_present(self):
147
+ def is_stamp_duty_product_present(self):
116
148
  product_stamp = self.invoice_line_ids.filtered(
117
- lambda line: line.product_id.is_stamp
149
+ lambda line: line.product_id.l10n_it_account_stamp_is_stamp
118
150
  )
119
151
  if product_stamp:
120
152
  return True
121
153
  return False
122
154
 
123
- def _build_tax_stamp_lines(self, product):
155
+ def _build_stamp_duty_lines(self, product):
124
156
  if (
125
157
  not product.property_account_income_id
126
158
  or not product.property_account_expense_id
@@ -130,7 +162,7 @@ class AccountMove(models.Model):
130
162
  )
131
163
 
132
164
  income_vals = {
133
- "name": _("Tax Stamp Income"),
165
+ "name": _("Stamp Duty Income"),
134
166
  "is_stamp_line": True,
135
167
  "partner_id": self.partner_id.id,
136
168
  "account_id": product.property_account_income_id.id,
@@ -146,7 +178,7 @@ class AccountMove(models.Model):
146
178
  income_vals["credit"] = 0
147
179
 
148
180
  expense_vals = {
149
- "name": _("Tax Stamp Expense"),
181
+ "name": _("Stamp Duty Expense"),
150
182
  "is_stamp_line": True,
151
183
  "partner_id": self.partner_id.id,
152
184
  "account_id": product.property_account_expense_id.id,
@@ -168,9 +200,9 @@ class AccountMove(models.Model):
168
200
  for inv in self:
169
201
  posted = False
170
202
  if (
171
- inv.tax_stamp
172
- and not inv.is_tax_stamp_line_present()
173
- and not inv.is_tax_stamp_product_present()
203
+ inv.l10n_it_account_stamp_is_stamp_duty_applied
204
+ and not inv.is_stamp_duty_line_present()
205
+ and not inv.is_stamp_duty_product_present()
174
206
  ):
175
207
  if inv.state == "posted":
176
208
  posted = True
@@ -178,10 +210,14 @@ class AccountMove(models.Model):
178
210
  line_model = self.env["account.move.line"]
179
211
  stamp_product_id = inv.company_id.with_context(
180
212
  lang=inv.partner_id.lang
181
- ).tax_stamp_product_id
213
+ ).l10n_it_account_stamp_stamp_duty_product_id
182
214
  if not stamp_product_id:
183
- raise UserError(_("Missing tax stamp product in company settings!"))
184
- income_vals, expense_vals = inv._build_tax_stamp_lines(stamp_product_id)
215
+ raise UserError(
216
+ _("Missing stamp duty product in company settings!")
217
+ )
218
+ income_vals, expense_vals = inv._build_stamp_duty_lines(
219
+ stamp_product_id
220
+ )
185
221
  income_vals["move_id"] = inv.id
186
222
  expense_vals["move_id"] = inv.id
187
223
  line_model.with_context(check_move_validity=False).create(income_vals)
@@ -193,10 +229,10 @@ class AccountMove(models.Model):
193
229
  def button_draft(self):
194
230
  res = super().button_draft()
195
231
  for account_move in self:
196
- move_line_tax_stamp_ids = account_move.line_ids.filtered(
232
+ move_line_stamp_duty_ids = account_move.line_ids.filtered(
197
233
  lambda line: line.is_stamp_line
198
234
  )
199
- move_line_tax_stamp_ids.unlink()
235
+ move_line_stamp_duty_ids.unlink()
200
236
  return res
201
237
 
202
238
 
@@ -205,4 +241,4 @@ class AccountInvoiceLine(models.Model):
205
241
 
206
242
  is_stamp_line = fields.Boolean(
207
243
  readonly=True
208
- ) # used only with automatic tax stamp active
244
+ ) # used only with automatic stamp duty active