odoo-addon-l10n-it-account-stamp 16.0.1.1.0.2__py3-none-any.whl → 18.0.1.0.0.3__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.
- odoo/addons/l10n_it_account_stamp/README.rst +53 -40
- odoo/addons/l10n_it_account_stamp/__manifest__.py +1 -1
- odoo/addons/l10n_it_account_stamp/data/data.xml +5 -7
- odoo/addons/l10n_it_account_stamp/i18n/it.po +87 -175
- odoo/addons/l10n_it_account_stamp/i18n/l10n_it_account_stamp.pot +62 -95
- odoo/addons/l10n_it_account_stamp/migrations/18.0.1.0.0/noupdate_changes.xml +12 -0
- odoo/addons/l10n_it_account_stamp/migrations/18.0.1.0.0/post-migration.py +14 -0
- odoo/addons/l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migration.py +77 -0
- odoo/addons/l10n_it_account_stamp/models/account_move.py +61 -45
- odoo/addons/l10n_it_account_stamp/models/company.py +8 -8
- odoo/addons/l10n_it_account_stamp/models/product.py +22 -11
- odoo/addons/l10n_it_account_stamp/readme/CONFIGURE.md +5 -5
- odoo/addons/l10n_it_account_stamp/readme/DESCRIPTION.md +1 -1
- odoo/addons/l10n_it_account_stamp/readme/ROADMAP.md +7 -0
- odoo/addons/l10n_it_account_stamp/readme/USAGE.md +3 -3
- odoo/addons/l10n_it_account_stamp/static/description/index.html +36 -26
- odoo/addons/l10n_it_account_stamp/tests/test_account_stamp_invoicing.py +22 -15
- odoo/addons/l10n_it_account_stamp/views/account_move_report.xml +8 -6
- odoo/addons/l10n_it_account_stamp/views/account_move_view.xml +26 -22
- odoo/addons/l10n_it_account_stamp/views/company_view.xml +8 -33
- odoo/addons/l10n_it_account_stamp/views/product_view.xml +12 -16
- {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.2.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.0.0.3.dist-info}/METADATA +56 -43
- odoo_addon_l10n_it_account_stamp-18.0.1.0.0.3.dist-info/RECORD +30 -0
- {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.2.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.0.0.3.dist-info}/WHEEL +1 -1
- odoo_addon_l10n_it_account_stamp-16.0.1.1.0.2.dist-info/RECORD +0 -26
- {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.2.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.0.0.3.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
|
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
|
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_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.
|
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
|
44
|
-
"
|
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.
|
49
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
50
|
-
|
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.
|
56
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
57
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
58
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
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,7 @@ 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
|
63
|
+
msgid "Configuration for stamp duty"
|
81
64
|
msgstr ""
|
82
65
|
|
83
66
|
#. module: l10n_it_account_stamp
|
@@ -87,14 +70,21 @@ msgid ""
|
|
87
70
|
" the application of the account stamp."
|
88
71
|
msgstr ""
|
89
72
|
|
73
|
+
#. module: l10n_it_account_stamp
|
74
|
+
#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.report_invoice_document_custom_fields_ext
|
75
|
+
msgid ""
|
76
|
+
"Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 del DPR "
|
77
|
+
"642/1972 e del DM 17/06/2014"
|
78
|
+
msgstr ""
|
79
|
+
|
90
80
|
#. module: l10n_it_account_stamp
|
91
81
|
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move_line__is_stamp_line
|
92
82
|
msgid "Is Stamp Line"
|
93
83
|
msgstr ""
|
94
84
|
|
95
85
|
#. module: l10n_it_account_stamp
|
96
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
97
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
86
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_is_stamp
|
87
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_is_stamp
|
98
88
|
msgid "Is a stamp"
|
99
89
|
msgstr ""
|
100
90
|
|
@@ -111,17 +101,13 @@ msgstr ""
|
|
111
101
|
#. module: l10n_it_account_stamp
|
112
102
|
#. odoo-python
|
113
103
|
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
114
|
-
#, python-format
|
115
104
|
msgid "Missing account income configuration for %s"
|
116
105
|
msgstr ""
|
117
106
|
|
118
107
|
#. module: l10n_it_account_stamp
|
119
108
|
#. odoo-python
|
120
109
|
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
121
|
-
|
122
|
-
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
123
|
-
#, python-format
|
124
|
-
msgid "Missing tax stamp product in company settings!"
|
110
|
+
msgid "Missing stamp duty product in company settings!"
|
125
111
|
msgstr ""
|
126
112
|
|
127
113
|
#. module: l10n_it_account_stamp
|
@@ -132,111 +118,92 @@ msgstr ""
|
|
132
118
|
#. module: l10n_it_account_stamp
|
133
119
|
#. odoo-python
|
134
120
|
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
135
|
-
#, python-format
|
136
121
|
msgid "Product %s must have income and expense accounts"
|
137
122
|
msgstr ""
|
138
123
|
|
139
124
|
#. module: l10n_it_account_stamp
|
140
|
-
#:
|
141
|
-
|
125
|
+
#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id
|
126
|
+
#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id
|
127
|
+
msgid "Product used as stamp duty in customer invoices."
|
142
128
|
msgstr ""
|
143
129
|
|
144
130
|
#. module: l10n_it_account_stamp
|
145
|
-
#: model:ir.model.fields,
|
146
|
-
#: model:ir.model.fields,
|
147
|
-
|
131
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied
|
132
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied
|
133
|
+
#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp
|
134
|
+
#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.product_template_form_view_account_stamp
|
135
|
+
msgid "Stamp Duty"
|
148
136
|
msgstr ""
|
149
137
|
|
150
138
|
#. module: l10n_it_account_stamp
|
151
|
-
|
152
|
-
#:
|
153
|
-
msgid "Stamp
|
139
|
+
#. odoo-python
|
140
|
+
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
141
|
+
msgid "Stamp Duty Expense"
|
154
142
|
msgstr ""
|
155
143
|
|
156
144
|
#. module: l10n_it_account_stamp
|
157
|
-
|
158
|
-
|
159
|
-
"Stamp
|
160
|
-
" 17, 2014\n"
|
161
|
-
" "
|
145
|
+
#. odoo-python
|
146
|
+
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
147
|
+
msgid "Stamp Duty Income"
|
162
148
|
msgstr ""
|
163
149
|
|
164
150
|
#. module: l10n_it_account_stamp
|
165
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
166
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
167
|
-
|
168
|
-
msgid "Stamp line is present in invoice"
|
151
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id
|
152
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id
|
153
|
+
msgid "Stamp Duty Product"
|
169
154
|
msgstr ""
|
170
155
|
|
171
156
|
#. module: l10n_it_account_stamp
|
172
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
173
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.
|
174
|
-
msgid "Stamp
|
157
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_tax_apply_min_total_base
|
158
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_tax_apply_min_total_base
|
159
|
+
msgid "Stamp applicability min total base"
|
175
160
|
msgstr ""
|
176
161
|
|
177
162
|
#. module: l10n_it_account_stamp
|
178
|
-
#: model:
|
179
|
-
|
180
|
-
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__tax_stamp
|
181
|
-
msgid "Tax Stamp"
|
163
|
+
#: model:product.template,name:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template
|
164
|
+
msgid "Stamp duty 2 euro"
|
182
165
|
msgstr ""
|
183
166
|
|
184
167
|
#. module: l10n_it_account_stamp
|
185
|
-
#: model:
|
186
|
-
|
168
|
+
#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied
|
169
|
+
#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied
|
170
|
+
msgid "Stamp duty is applied to this invoice."
|
187
171
|
msgstr ""
|
188
172
|
|
189
173
|
#. module: l10n_it_account_stamp
|
190
174
|
#. odoo-python
|
191
175
|
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
192
|
-
|
193
|
-
msgid "Tax Stamp Expense"
|
176
|
+
msgid "Stamp duty is not applicable"
|
194
177
|
msgstr ""
|
195
178
|
|
196
179
|
#. module: l10n_it_account_stamp
|
197
180
|
#. odoo-python
|
198
181
|
#: code:addons/l10n_it_account_stamp/models/account_move.py:0
|
199
|
-
|
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"
|
208
|
-
msgstr ""
|
209
|
-
|
210
|
-
#. 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"
|
182
|
+
msgid "Stamp duty line %s already present. Remove it first."
|
214
183
|
msgstr ""
|
215
184
|
|
216
185
|
#. module: l10n_it_account_stamp
|
217
|
-
#: model:
|
218
|
-
|
219
|
-
|
220
|
-
|
186
|
+
#: model:product.template,description_sale:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template
|
187
|
+
msgid ""
|
188
|
+
"Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree June\n"
|
189
|
+
" 17, 2014\n"
|
190
|
+
" "
|
221
191
|
msgstr ""
|
222
192
|
|
223
193
|
#. module: l10n_it_account_stamp
|
224
|
-
|
225
|
-
#:
|
226
|
-
|
227
|
-
msgid "Tax stamp is not applicable"
|
194
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_present
|
195
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_present
|
196
|
+
msgid "Stamp line is present in invoice"
|
228
197
|
msgstr ""
|
229
198
|
|
230
199
|
#. module: l10n_it_account_stamp
|
231
|
-
|
232
|
-
#:
|
233
|
-
|
234
|
-
msgid "Tax stamp line %s already present. Remove it first."
|
200
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_stamp_duty_apply_tax_ids
|
201
|
+
#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_stamp_duty_apply_tax_ids
|
202
|
+
msgid "Stamp taxes"
|
235
203
|
msgstr ""
|
236
204
|
|
237
205
|
#. module: l10n_it_account_stamp
|
238
206
|
#. odoo-python
|
239
207
|
#: code:addons/l10n_it_account_stamp/models/product.py:0
|
240
|
-
#, python-format
|
241
208
|
msgid "The product %s must be a stamp to apply set taxes!"
|
242
209
|
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.cr, "l10n_it_account_stamp", "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)
|
@@ -8,38 +8,46 @@ from odoo.exceptions import UserError
|
|
8
8
|
class AccountMove(models.Model):
|
9
9
|
_inherit = "account.move"
|
10
10
|
|
11
|
-
|
12
|
-
|
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="
|
15
|
+
compute="_compute_l10n_it_account_stamp_is_stamp_duty_applied",
|
15
16
|
store=True,
|
16
17
|
)
|
17
|
-
|
18
|
+
l10n_it_account_stamp_is_stamp_duty_present = fields.Boolean(
|
18
19
|
string="Stamp line is present in invoice",
|
19
|
-
compute="
|
20
|
+
compute="_compute_l10n_it_account_stamp_is_stamp_duty_present",
|
20
21
|
)
|
21
|
-
|
22
|
-
related="company_id.
|
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",
|
24
|
+
)
|
25
|
+
l10n_it_account_stamp_manually_apply_stamp_duty = fields.Boolean(
|
26
|
+
string="Apply stamp duty",
|
23
27
|
)
|
24
|
-
manually_apply_tax_stamp = fields.Boolean("Apply tax stamp")
|
25
28
|
|
26
|
-
def
|
29
|
+
def is_stamp_duty_applicable(self):
|
27
30
|
stamp_product_id = self.company_id.with_context(
|
28
31
|
lang=self.partner_id.lang
|
29
|
-
).
|
32
|
+
).l10n_it_account_stamp_stamp_duty_product_id
|
30
33
|
if not stamp_product_id:
|
31
|
-
raise UserError(_("Missing
|
34
|
+
raise UserError(_("Missing stamp duty product in company settings!"))
|
32
35
|
total_tax_base = sum(
|
33
36
|
(
|
34
37
|
inv_tax.price_subtotal
|
35
38
|
for inv_tax in self.line_ids.filtered(
|
36
39
|
lambda line: set(line.tax_ids.ids)
|
37
|
-
& set(
|
40
|
+
& set(
|
41
|
+
stamp_product_id.l10n_it_account_stamp_stamp_duty_apply_tax_ids.ids
|
42
|
+
)
|
38
43
|
)
|
39
44
|
),
|
40
45
|
0.0,
|
41
46
|
)
|
42
|
-
return
|
47
|
+
return (
|
48
|
+
total_tax_base
|
49
|
+
>= stamp_product_id.l10n_it_account_stamp_tax_apply_min_total_base
|
50
|
+
)
|
43
51
|
|
44
52
|
@api.depends(
|
45
53
|
"invoice_line_ids.price_subtotal",
|
@@ -48,31 +56,33 @@ class AccountMove(models.Model):
|
|
48
56
|
"company_id",
|
49
57
|
"invoice_date",
|
50
58
|
"move_type",
|
51
|
-
"
|
59
|
+
"l10n_it_account_stamp_manually_apply_stamp_duty",
|
52
60
|
"invoice_line_ids.tax_ids",
|
53
61
|
)
|
54
|
-
def
|
62
|
+
def _compute_l10n_it_account_stamp_is_stamp_duty_applied(self):
|
55
63
|
for invoice in self:
|
56
|
-
invoice.
|
57
|
-
if invoice.
|
58
|
-
invoice.
|
64
|
+
invoice.l10n_it_account_stamp_is_stamp_duty_applied = False
|
65
|
+
if invoice.l10n_it_account_stamp_auto_compute_stamp_duty:
|
66
|
+
invoice.l10n_it_account_stamp_is_stamp_duty_applied = (
|
67
|
+
invoice.is_stamp_duty_applicable()
|
68
|
+
)
|
59
69
|
else:
|
60
|
-
if invoice.
|
61
|
-
invoice.
|
70
|
+
if invoice.l10n_it_account_stamp_manually_apply_stamp_duty:
|
71
|
+
invoice.l10n_it_account_stamp_is_stamp_duty_applied = True
|
62
72
|
|
63
|
-
def
|
73
|
+
def add_stamp_duty_line(self):
|
64
74
|
for inv in self:
|
65
|
-
if not inv.
|
66
|
-
raise UserError(_("
|
75
|
+
if not inv.l10n_it_account_stamp_is_stamp_duty_applied:
|
76
|
+
raise UserError(_("Stamp duty is not applicable"))
|
67
77
|
stamp_product_id = inv.company_id.with_context(
|
68
78
|
lang=inv.partner_id.lang
|
69
|
-
).
|
79
|
+
).l10n_it_account_stamp_stamp_duty_product_id
|
70
80
|
if not stamp_product_id:
|
71
|
-
raise UserError(_("Missing
|
81
|
+
raise UserError(_("Missing stamp duty product in company settings!"))
|
72
82
|
for line in inv.invoice_line_ids:
|
73
|
-
if line.product_id and line.product_id.
|
83
|
+
if line.product_id and line.product_id.l10n_it_account_stamp_is_stamp:
|
74
84
|
raise UserError(
|
75
|
-
_("
|
85
|
+
_("Stamp duty line %s already present. Remove it first.")
|
76
86
|
% line.name
|
77
87
|
)
|
78
88
|
stamp_account = stamp_product_id.property_account_income_id
|
@@ -96,7 +106,7 @@ class AccountMove(models.Model):
|
|
96
106
|
}
|
97
107
|
inv.write({"invoice_line_ids": [(0, 0, invoice_line_vals)]})
|
98
108
|
|
99
|
-
def
|
109
|
+
def is_stamp_duty_line_present(self):
|
100
110
|
self.ensure_one()
|
101
111
|
for line in self.line_ids:
|
102
112
|
if line.is_stamp_line:
|
@@ -106,21 +116,23 @@ class AccountMove(models.Model):
|
|
106
116
|
@api.depends(
|
107
117
|
"invoice_line_ids",
|
108
118
|
"invoice_line_ids.product_id",
|
109
|
-
"invoice_line_ids.product_id.
|
119
|
+
"invoice_line_ids.product_id.l10n_it_account_stamp_is_stamp",
|
110
120
|
)
|
111
|
-
def
|
121
|
+
def _compute_l10n_it_account_stamp_is_stamp_duty_present(self):
|
112
122
|
for invoice in self:
|
113
|
-
invoice.
|
123
|
+
invoice.l10n_it_account_stamp_is_stamp_duty_present = (
|
124
|
+
invoice.is_stamp_duty_line_present()
|
125
|
+
)
|
114
126
|
|
115
|
-
def
|
127
|
+
def is_stamp_duty_product_present(self):
|
116
128
|
product_stamp = self.invoice_line_ids.filtered(
|
117
|
-
lambda line: line.product_id.
|
129
|
+
lambda line: line.product_id.l10n_it_account_stamp_is_stamp
|
118
130
|
)
|
119
131
|
if product_stamp:
|
120
132
|
return True
|
121
133
|
return False
|
122
134
|
|
123
|
-
def
|
135
|
+
def _build_stamp_duty_lines(self, product):
|
124
136
|
if (
|
125
137
|
not product.property_account_income_id
|
126
138
|
or not product.property_account_expense_id
|
@@ -130,7 +142,7 @@ class AccountMove(models.Model):
|
|
130
142
|
)
|
131
143
|
|
132
144
|
income_vals = {
|
133
|
-
"name": _("
|
145
|
+
"name": _("Stamp Duty Income"),
|
134
146
|
"is_stamp_line": True,
|
135
147
|
"partner_id": self.partner_id.id,
|
136
148
|
"account_id": product.property_account_income_id.id,
|
@@ -146,7 +158,7 @@ class AccountMove(models.Model):
|
|
146
158
|
income_vals["credit"] = 0
|
147
159
|
|
148
160
|
expense_vals = {
|
149
|
-
"name": _("
|
161
|
+
"name": _("Stamp Duty Expense"),
|
150
162
|
"is_stamp_line": True,
|
151
163
|
"partner_id": self.partner_id.id,
|
152
164
|
"account_id": product.property_account_expense_id.id,
|
@@ -168,9 +180,9 @@ class AccountMove(models.Model):
|
|
168
180
|
for inv in self:
|
169
181
|
posted = False
|
170
182
|
if (
|
171
|
-
inv.
|
172
|
-
and not inv.
|
173
|
-
and not inv.
|
183
|
+
inv.l10n_it_account_stamp_is_stamp_duty_applied
|
184
|
+
and not inv.is_stamp_duty_line_present()
|
185
|
+
and not inv.is_stamp_duty_product_present()
|
174
186
|
):
|
175
187
|
if inv.state == "posted":
|
176
188
|
posted = True
|
@@ -178,10 +190,14 @@ class AccountMove(models.Model):
|
|
178
190
|
line_model = self.env["account.move.line"]
|
179
191
|
stamp_product_id = inv.company_id.with_context(
|
180
192
|
lang=inv.partner_id.lang
|
181
|
-
).
|
193
|
+
).l10n_it_account_stamp_stamp_duty_product_id
|
182
194
|
if not stamp_product_id:
|
183
|
-
raise UserError(
|
184
|
-
|
195
|
+
raise UserError(
|
196
|
+
_("Missing stamp duty product in company settings!")
|
197
|
+
)
|
198
|
+
income_vals, expense_vals = inv._build_stamp_duty_lines(
|
199
|
+
stamp_product_id
|
200
|
+
)
|
185
201
|
income_vals["move_id"] = inv.id
|
186
202
|
expense_vals["move_id"] = inv.id
|
187
203
|
line_model.with_context(check_move_validity=False).create(income_vals)
|
@@ -193,10 +209,10 @@ class AccountMove(models.Model):
|
|
193
209
|
def button_draft(self):
|
194
210
|
res = super().button_draft()
|
195
211
|
for account_move in self:
|
196
|
-
|
212
|
+
move_line_stamp_duty_ids = account_move.line_ids.filtered(
|
197
213
|
lambda line: line.is_stamp_line
|
198
214
|
)
|
199
|
-
|
215
|
+
move_line_stamp_duty_ids.unlink()
|
200
216
|
return res
|
201
217
|
|
202
218
|
|
@@ -205,4 +221,4 @@ class AccountInvoiceLine(models.Model):
|
|
205
221
|
|
206
222
|
is_stamp_line = fields.Boolean(
|
207
223
|
readonly=True
|
208
|
-
) # used only with automatic
|
224
|
+
) # used only with automatic stamp duty active
|
@@ -6,19 +6,19 @@ from odoo import fields, models
|
|
6
6
|
class ResCompany(models.Model):
|
7
7
|
_inherit = "res.company"
|
8
8
|
|
9
|
-
|
10
|
-
"product.product",
|
11
|
-
"
|
12
|
-
help="Product used as
|
9
|
+
l10n_it_account_stamp_stamp_duty_product_id = fields.Many2one(
|
10
|
+
comodel_name="product.product",
|
11
|
+
string="Stamp Duty Product",
|
12
|
+
help="Product used as stamp duty in customer invoices.",
|
13
13
|
)
|
14
14
|
|
15
15
|
|
16
16
|
class AccountConfigSettings(models.TransientModel):
|
17
17
|
_inherit = "res.config.settings"
|
18
18
|
|
19
|
-
|
20
|
-
related="company_id.
|
21
|
-
string="
|
22
|
-
help="Product used as
|
19
|
+
l10n_it_account_stamp_stamp_duty_product_id = fields.Many2one(
|
20
|
+
related="company_id.l10n_it_account_stamp_stamp_duty_product_id",
|
21
|
+
string="Stamp Duty Product",
|
22
|
+
help="Product used as stamp duty in customer invoices.",
|
23
23
|
readonly=False,
|
24
24
|
)
|