odoo-addon-l10n-it-vat-registries 18.0.1.0.2__py3-none-any.whl → 18.0.1.1.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.
- odoo/addons/l10n_it_vat_registries/README.rst +1 -1
- odoo/addons/l10n_it_vat_registries/__manifest__.py +2 -1
- odoo/addons/l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot +43 -0
- odoo/addons/l10n_it_vat_registries/report/reports.xml +12 -0
- odoo/addons/l10n_it_vat_registries/static/description/index.html +1 -1
- odoo/addons/l10n_it_vat_registries/tests/test_registry.py +46 -20
- odoo/addons/l10n_it_vat_registries/wizard/__init__.py +1 -0
- odoo/addons/l10n_it_vat_registries/wizard/print_registro_iva.py +29 -19
- odoo/addons/l10n_it_vat_registries/wizard/print_registro_iva.xml +7 -0
- odoo/addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py +161 -0
- {odoo_addon_l10n_it_vat_registries-18.0.1.0.2.dist-info → odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info}/METADATA +4 -2
- {odoo_addon_l10n_it_vat_registries-18.0.1.0.2.dist-info → odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info}/RECORD +14 -13
- {odoo_addon_l10n_it_vat_registries-18.0.1.0.2.dist-info → odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info}/WHEEL +1 -1
- {odoo_addon_l10n_it_vat_registries-18.0.1.0.2.dist-info → odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info}/top_level.txt +0 -0
@@ -11,7 +11,7 @@ ITA - Registri IVA
|
|
11
11
|
!! This file is generated by oca-gen-addon-readme !!
|
12
12
|
!! changes will be overwritten. !!
|
13
13
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
14
|
-
!! source digest: sha256:
|
14
|
+
!! source digest: sha256:8a3455eafdafa0f7c5848cfe4fd73b09c475aad1de1075672537969d0b5c4610
|
15
15
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
16
16
|
|
17
17
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
7
7
|
|
8
8
|
{
|
9
|
-
"version": "18.0.1.0
|
9
|
+
"version": "18.0.1.1.0",
|
10
10
|
"name": "ITA - Registri IVA",
|
11
11
|
"category": "Localization/Italy",
|
12
12
|
"author": "Agile Business Group, Odoo Community Association (OCA), LinkIt Srl",
|
@@ -21,6 +21,7 @@
|
|
21
21
|
"web",
|
22
22
|
"account_tax_balance",
|
23
23
|
"date_range",
|
24
|
+
"report_xlsx_helper",
|
24
25
|
],
|
25
26
|
"data": [
|
26
27
|
"security/ir.model.access.csv",
|
@@ -19,6 +19,8 @@ msgid "A VAT registry is used to group several journals in one registry."
|
|
19
19
|
msgstr ""
|
20
20
|
|
21
21
|
#. module: l10n_it_vat_registries
|
22
|
+
#. odoo-python
|
23
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
22
24
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
23
25
|
msgid "BUSINESS NAME"
|
24
26
|
msgstr ""
|
@@ -121,11 +123,15 @@ msgid "ID"
|
|
121
123
|
msgstr ""
|
122
124
|
|
123
125
|
#. module: l10n_it_vat_registries
|
126
|
+
#. odoo-python
|
127
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
124
128
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
125
129
|
msgid "INV. DATE"
|
126
130
|
msgstr ""
|
127
131
|
|
128
132
|
#. module: l10n_it_vat_registries
|
133
|
+
#. odoo-python
|
134
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
129
135
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
130
136
|
msgid "INV. NUM."
|
131
137
|
msgstr ""
|
@@ -141,6 +147,11 @@ msgstr ""
|
|
141
147
|
msgid "Invoices VAT Registry"
|
142
148
|
msgstr ""
|
143
149
|
|
150
|
+
#. module: l10n_it_vat_registries
|
151
|
+
#: model:ir.actions.report,name:l10n_it_vat_registries.action_report_registro_iva_xlsx
|
152
|
+
msgid "Invoices VAT Registry XLSX"
|
153
|
+
msgstr ""
|
154
|
+
|
144
155
|
#. module: l10n_it_vat_registries
|
145
156
|
#: model:ir.model,name:l10n_it_vat_registries.model_account_journal
|
146
157
|
msgid "Journal"
|
@@ -195,6 +206,12 @@ msgstr ""
|
|
195
206
|
msgid "Move line %s has too many base taxes"
|
196
207
|
msgstr ""
|
197
208
|
|
209
|
+
#. module: l10n_it_vat_registries
|
210
|
+
#. odoo-python
|
211
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
212
|
+
msgid "N/A"
|
213
|
+
msgstr ""
|
214
|
+
|
198
215
|
#. module: l10n_it_vat_registries
|
199
216
|
#: model:ir.model.fields,field_description:l10n_it_vat_registries.field_account_tax_registry__name
|
200
217
|
msgid "Name"
|
@@ -218,6 +235,11 @@ msgstr ""
|
|
218
235
|
msgid "Print"
|
219
236
|
msgstr ""
|
220
237
|
|
238
|
+
#. module: l10n_it_vat_registries
|
239
|
+
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.wizard_registro_iva
|
240
|
+
msgid "Print XLSX"
|
241
|
+
msgstr ""
|
242
|
+
|
221
243
|
#. module: l10n_it_vat_registries
|
222
244
|
#: model:ir.model.fields,field_description:l10n_it_vat_registries.field_wizard_registro_iva__only_totals
|
223
245
|
msgid "Prints only totals"
|
@@ -230,16 +252,22 @@ msgid "RC Journals"
|
|
230
252
|
msgstr ""
|
231
253
|
|
232
254
|
#. module: l10n_it_vat_registries
|
255
|
+
#. odoo-python
|
256
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
233
257
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
234
258
|
msgid "REASON"
|
235
259
|
msgstr ""
|
236
260
|
|
237
261
|
#. module: l10n_it_vat_registries
|
262
|
+
#. odoo-python
|
263
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
238
264
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
239
265
|
msgid "REG. DATE"
|
240
266
|
msgstr ""
|
241
267
|
|
242
268
|
#. module: l10n_it_vat_registries
|
269
|
+
#. odoo-python
|
270
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
243
271
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
244
272
|
msgid "REG. NUM."
|
245
273
|
msgstr ""
|
@@ -288,16 +316,22 @@ msgid "Supplier Invoices"
|
|
288
316
|
msgstr ""
|
289
317
|
|
290
318
|
#. module: l10n_it_vat_registries
|
319
|
+
#. odoo-python
|
320
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
291
321
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
292
322
|
msgid "TIN"
|
293
323
|
msgstr ""
|
294
324
|
|
295
325
|
#. module: l10n_it_vat_registries
|
326
|
+
#. odoo-python
|
327
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
296
328
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
297
329
|
msgid "TOTAL"
|
298
330
|
msgstr ""
|
299
331
|
|
300
332
|
#. module: l10n_it_vat_registries
|
333
|
+
#. odoo-python
|
334
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
301
335
|
#: model:ir.model,name:l10n_it_vat_registries.model_account_tax
|
302
336
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
303
337
|
msgid "Tax"
|
@@ -309,6 +343,8 @@ msgid "Tax Journal"
|
|
309
343
|
msgstr ""
|
310
344
|
|
311
345
|
#. module: l10n_it_vat_registries
|
346
|
+
#. odoo-python
|
347
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
312
348
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
313
349
|
msgid "Tax description"
|
314
350
|
msgstr ""
|
@@ -319,6 +355,8 @@ msgid "Tax registry"
|
|
319
355
|
msgstr ""
|
320
356
|
|
321
357
|
#. module: l10n_it_vat_registries
|
358
|
+
#. odoo-python
|
359
|
+
#: code:addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py:0
|
322
360
|
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
|
323
361
|
msgid "Taxable"
|
324
362
|
msgstr ""
|
@@ -365,6 +403,11 @@ msgstr ""
|
|
365
403
|
msgid "Value printed near number of page in the footer"
|
366
404
|
msgstr ""
|
367
405
|
|
406
|
+
#. module: l10n_it_vat_registries
|
407
|
+
#: model:ir.model,name:l10n_it_vat_registries.model_report_l10n_it_vat_registries_report_registro_iva_xlsx
|
408
|
+
msgid "XLSX report for VAT registries"
|
409
|
+
msgstr ""
|
410
|
+
|
368
411
|
#. module: l10n_it_vat_registries
|
369
412
|
#: model:ir.model.fields,field_description:l10n_it_vat_registries.field_wizard_registro_iva__year_footer
|
370
413
|
msgid "Year for Footer"
|
@@ -11,4 +11,16 @@
|
|
11
11
|
ref="l10n_it_account.l10n_it_account_a4_landscape"
|
12
12
|
/>
|
13
13
|
</record>
|
14
|
+
|
15
|
+
<record id="action_report_registro_iva_xlsx" model="ir.actions.report">
|
16
|
+
<field name="name">Invoices VAT Registry XLSX</field>
|
17
|
+
<field name="model">account.move</field>
|
18
|
+
<field name="report_type">xlsx</field>
|
19
|
+
<field
|
20
|
+
name="report_name"
|
21
|
+
>l10n_it_vat_registries.report_registro_iva_xlsx</field>
|
22
|
+
<field
|
23
|
+
name="report_file"
|
24
|
+
>l10n_it_vat_registries.report_registro_iva_xlsx</field>
|
25
|
+
</record>
|
14
26
|
</odoo>
|
@@ -372,7 +372,7 @@ ul.auto-toc {
|
|
372
372
|
!! This file is generated by oca-gen-addon-readme !!
|
373
373
|
!! changes will be overwritten. !!
|
374
374
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
375
|
-
!! source digest: sha256:
|
375
|
+
!! source digest: sha256:8a3455eafdafa0f7c5848cfe4fd73b09c475aad1de1075672537969d0b5c4610
|
376
376
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
377
377
|
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_vat_registries"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_vat_registries"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
378
378
|
<p>Law: Decreto del Presidente della Repubblica del 26 ottobre 1972 n. 633
|
@@ -1,35 +1,42 @@
|
|
1
1
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
2
2
|
|
3
|
+
import io
|
4
|
+
from zipfile import ZipFile
|
5
|
+
|
3
6
|
from odoo import fields
|
4
7
|
from odoo.tests.common import TransactionCase
|
5
8
|
|
6
9
|
|
7
10
|
class TestRegistry(TransactionCase):
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
+
@classmethod
|
12
|
+
def setUpClass(cls):
|
13
|
+
super().setUpClass()
|
14
|
+
|
15
|
+
cls.test_date = fields.Date.today()
|
16
|
+
cls.journal = cls.env["account.journal"].search(
|
11
17
|
[("type", "=", "sale")], limit=1
|
12
18
|
)
|
13
|
-
|
19
|
+
cls.ova = cls.env["account.account"].search(
|
14
20
|
[("account_type", "=", "asset_current")],
|
15
21
|
limit=1,
|
16
22
|
)
|
17
|
-
tax =
|
23
|
+
cls.tax = cls.env["account.tax"].create(
|
18
24
|
{
|
19
25
|
"name": "Tax 10.0",
|
20
26
|
"amount": 10.0,
|
21
27
|
"amount_type": "fixed",
|
22
28
|
}
|
23
29
|
)
|
24
|
-
tax_registry =
|
30
|
+
cls.tax_registry = cls.env["account.tax.registry"].create(
|
25
31
|
{
|
26
32
|
"name": "Sales",
|
27
33
|
"layout_type": "customer",
|
28
|
-
"journal_ids": [(6, 0, [
|
34
|
+
"journal_ids": [(6, 0, [cls.journal.id])],
|
29
35
|
}
|
30
36
|
)
|
31
|
-
|
32
|
-
|
37
|
+
|
38
|
+
cls.invoice_line_account = (
|
39
|
+
cls.env["account.account"]
|
33
40
|
.search(
|
34
41
|
[("account_type", "=", "expense")],
|
35
42
|
limit=1,
|
@@ -37,35 +44,36 @@ class TestRegistry(TransactionCase):
|
|
37
44
|
.id
|
38
45
|
)
|
39
46
|
|
40
|
-
invoice =
|
47
|
+
cls.invoice = cls.env["account.move"].create(
|
41
48
|
{
|
42
|
-
"partner_id":
|
43
|
-
"invoice_date": test_date,
|
49
|
+
"partner_id": cls.env.ref("base.res_partner_2").id,
|
50
|
+
"invoice_date": cls.test_date,
|
44
51
|
"move_type": "out_invoice",
|
45
|
-
"journal_id":
|
52
|
+
"journal_id": cls.journal.id,
|
46
53
|
"invoice_line_ids": [
|
47
54
|
(
|
48
55
|
0,
|
49
56
|
None,
|
50
57
|
{
|
51
|
-
"product_id":
|
58
|
+
"product_id": cls.env.ref("product.product_product_4").id,
|
52
59
|
"quantity": 1.0,
|
53
60
|
"price_unit": 100.0,
|
54
61
|
"name": "product that cost 100",
|
55
|
-
"account_id": invoice_line_account,
|
56
|
-
"tax_ids": [(6, 0, [tax.id])],
|
62
|
+
"account_id": cls.invoice_line_account,
|
63
|
+
"tax_ids": [(6, 0, [cls.tax.id])],
|
57
64
|
},
|
58
65
|
)
|
59
66
|
],
|
60
67
|
}
|
61
68
|
)
|
62
|
-
invoice.action_post()
|
69
|
+
cls.invoice.action_post()
|
63
70
|
|
71
|
+
def test_invoice_and_report(self):
|
64
72
|
wizard = self.env["wizard.registro.iva"].create(
|
65
73
|
{
|
66
|
-
"from_date": test_date,
|
67
|
-
"to_date": test_date,
|
68
|
-
"tax_registry_id": tax_registry.id,
|
74
|
+
"from_date": self.test_date,
|
75
|
+
"to_date": self.test_date,
|
76
|
+
"tax_registry_id": self.tax_registry.id,
|
69
77
|
"layout_type": "supplier",
|
70
78
|
"fiscal_page_base": 0,
|
71
79
|
}
|
@@ -84,6 +92,24 @@ class TestRegistry(TransactionCase):
|
|
84
92
|
|
85
93
|
self.assertTrue(b"Tax 10.0" in html[0])
|
86
94
|
|
95
|
+
# XLSX
|
96
|
+
res = wizard.print_registro_xlsx()
|
97
|
+
|
98
|
+
report_name = "l10n_it_vat_registries.report_registro_iva_xlsx"
|
99
|
+
domain = [
|
100
|
+
("report_type", "=", "xlsx"),
|
101
|
+
("report_name", "=", report_name),
|
102
|
+
]
|
103
|
+
report = self.env["ir.actions.report"].search(domain)
|
104
|
+
data = res["context"]["report_action"]["data"]
|
105
|
+
xlsx, _type = report._render_xlsx(report_name, data["ids"], data)
|
106
|
+
|
107
|
+
# basic reading of a file
|
108
|
+
# we don't want to depend on other non-standard libraries such as openpyxl
|
109
|
+
f = io.BytesIO(xlsx)
|
110
|
+
with ZipFile(f, "r").open("xl/sharedStrings.xml", "r") as wf:
|
111
|
+
self.assertTrue(self.invoice.partner_id.name.encode("utf8") in wf.read())
|
112
|
+
|
87
113
|
def test_no_report_from_invoice(self):
|
88
114
|
"""Check that the report is not available from invoice context menu."""
|
89
115
|
report_id = self.ref("l10n_it_vat_registries.action_report_registro_iva")
|
@@ -126,27 +126,24 @@ class WizardRegistroIva(models.TransientModel):
|
|
126
126
|
moves = moves.sorted(order)
|
127
127
|
return moves.ids
|
128
128
|
|
129
|
-
def
|
129
|
+
def _get_datas_form(self):
|
130
130
|
self.ensure_one()
|
131
|
-
|
132
|
-
if not wizard.journal_ids:
|
131
|
+
if not self.journal_ids:
|
133
132
|
raise UserError(
|
134
133
|
_(
|
135
134
|
"No journals found in the current selection.\n"
|
136
135
|
"Please load them before to retry!"
|
137
136
|
)
|
138
137
|
)
|
139
|
-
move_ids = self._get_move_ids(wizard)
|
140
|
-
|
141
138
|
datas_form = {}
|
142
|
-
datas_form["from_date"] =
|
143
|
-
datas_form["to_date"] =
|
144
|
-
datas_form["journal_ids"] = [j.id for j in
|
145
|
-
if
|
146
|
-
datas_form["rc_journal_ids"] = [j.id for j in
|
147
|
-
datas_form["fiscal_page_base"] =
|
148
|
-
datas_form["registry_type"] =
|
149
|
-
datas_form["year_footer"] =
|
139
|
+
datas_form["from_date"] = self.from_date
|
140
|
+
datas_form["to_date"] = self.to_date
|
141
|
+
datas_form["journal_ids"] = [j.id for j in self.journal_ids]
|
142
|
+
if self._include_rc_journals():
|
143
|
+
datas_form["rc_journal_ids"] = [j.id for j in self.rc_journal_ids]
|
144
|
+
datas_form["fiscal_page_base"] = self.fiscal_page_base
|
145
|
+
datas_form["registry_type"] = self.layout_type
|
146
|
+
datas_form["year_footer"] = self.year_footer
|
150
147
|
|
151
148
|
lang_code = self.env.company.partner_id.lang
|
152
149
|
lang = self.env["res.lang"]
|
@@ -154,14 +151,27 @@ class WizardRegistroIva(models.TransientModel):
|
|
154
151
|
date_format = lang_id.date_format
|
155
152
|
datas_form["date_format"] = date_format
|
156
153
|
|
157
|
-
if
|
158
|
-
datas_form["tax_registry_name"] =
|
154
|
+
if self.tax_registry_id:
|
155
|
+
datas_form["tax_registry_name"] = self.tax_registry_id.name
|
159
156
|
else:
|
160
157
|
datas_form["tax_registry_name"] = ""
|
161
|
-
datas_form["only_totals"] =
|
162
|
-
datas_form["entry_order"] =
|
163
|
-
datas_form["show_full_contact_addess"] =
|
164
|
-
|
158
|
+
datas_form["only_totals"] = self.only_totals
|
159
|
+
datas_form["entry_order"] = self.entry_order
|
160
|
+
datas_form["show_full_contact_addess"] = self.show_full_contact_addess
|
161
|
+
return datas_form
|
162
|
+
|
163
|
+
def print_registro(self):
|
164
|
+
move_ids = self._get_move_ids(self)
|
165
|
+
datas_form = self._get_datas_form()
|
166
|
+
|
165
167
|
report_name = "l10n_it_vat_registries.action_report_registro_iva"
|
166
168
|
datas = {"ids": move_ids, "model": "account.move", "form": datas_form}
|
167
169
|
return self.env.ref(report_name).report_action(self, data=datas)
|
170
|
+
|
171
|
+
def print_registro_xlsx(self):
|
172
|
+
move_ids = self._get_move_ids(self)
|
173
|
+
datas_form = self._get_datas_form()
|
174
|
+
report_name = "l10n_it_vat_registries.action_report_registro_iva_xlsx"
|
175
|
+
datas = {"ids": move_ids, "model": "account.move", "form": datas_form}
|
176
|
+
moves = self.env["account.move"].browse(move_ids)
|
177
|
+
return self.env.ref(report_name).report_action(moves, data=datas)
|
@@ -64,6 +64,13 @@
|
|
64
64
|
name="print_registro"
|
65
65
|
type="object"
|
66
66
|
class="oe_highlight"
|
67
|
+
/>
|
68
|
+
or
|
69
|
+
<button
|
70
|
+
string="Print XLSX"
|
71
|
+
name="print_registro_xlsx"
|
72
|
+
type="object"
|
73
|
+
class="oe_highlight"
|
67
74
|
/>
|
68
75
|
or
|
69
76
|
<button string="Cancel" class="oe_link" special="cancel" />
|
@@ -0,0 +1,161 @@
|
|
1
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
2
|
+
|
3
|
+
import logging
|
4
|
+
|
5
|
+
from odoo import _, models
|
6
|
+
from odoo.tools.misc import formatLang
|
7
|
+
|
8
|
+
from odoo.addons.report_xlsx_helper.report.report_xlsx_format import (
|
9
|
+
FORMATS,
|
10
|
+
XLS_HEADERS,
|
11
|
+
)
|
12
|
+
|
13
|
+
_logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
|
16
|
+
class ReportRegistroIvaXlsx(models.AbstractModel):
|
17
|
+
_name = "report.l10n_it_vat_registries.report_registro_iva_xlsx"
|
18
|
+
_inherit = [
|
19
|
+
"report.report_xlsx.abstract",
|
20
|
+
"report.l10n_it_vat_registries.report_registro_iva",
|
21
|
+
]
|
22
|
+
_description = "XLSX report for VAT registries"
|
23
|
+
|
24
|
+
# to override
|
25
|
+
def _get_vat_settlement_date_col_spec(self):
|
26
|
+
return {}
|
27
|
+
|
28
|
+
def _get_ws_params(self, workbook, data, objects):
|
29
|
+
registry_type = data["form"]["registry_type"]
|
30
|
+
titles = {
|
31
|
+
"customer": "Registro IVA vendite",
|
32
|
+
"supplier": "Registro IVA acquisti",
|
33
|
+
"corrispettivi": "Registro corrispettivi",
|
34
|
+
}
|
35
|
+
title = data["form"]["tax_registry_name"] or titles.get(registry_type, _("N/A"))
|
36
|
+
|
37
|
+
col_specs = {
|
38
|
+
"date": {
|
39
|
+
"header": {"value": _("REG. DATE")},
|
40
|
+
"lines": {"value": self._render("format_date(move.date,date_format)")},
|
41
|
+
"width": 20,
|
42
|
+
},
|
43
|
+
"no": {
|
44
|
+
"header": {"value": _("REG. NUM.")},
|
45
|
+
"lines": {"value": self._render("move.name")},
|
46
|
+
"width": 20,
|
47
|
+
},
|
48
|
+
"reason": {
|
49
|
+
"header": {"value": _("REASON")},
|
50
|
+
"lines": {"value": self._render("line['invoice_type']")},
|
51
|
+
"width": 20,
|
52
|
+
},
|
53
|
+
"inv_date": {
|
54
|
+
"header": {"value": _("INV. DATE")},
|
55
|
+
"lines": {
|
56
|
+
"value": self._render(
|
57
|
+
"format_date(line['invoice_date'],date_format)"
|
58
|
+
)
|
59
|
+
},
|
60
|
+
"width": 20,
|
61
|
+
},
|
62
|
+
"inv_name": {
|
63
|
+
"header": {"value": _("INV. NUM.")},
|
64
|
+
"lines": {
|
65
|
+
"value": self._render(
|
66
|
+
"move.ref if move.journal_id.type == 'purchase' "
|
67
|
+
"else move.name"
|
68
|
+
)
|
69
|
+
},
|
70
|
+
"width": 20,
|
71
|
+
},
|
72
|
+
"partner": {
|
73
|
+
"header": {"value": _("BUSINESS NAME")},
|
74
|
+
"lines": {"value": self._render("move.partner_id.name")},
|
75
|
+
"width": 20,
|
76
|
+
},
|
77
|
+
"tin": {
|
78
|
+
"header": {"value": _("TIN")},
|
79
|
+
"lines": {"value": self._render("move.partner_id.vat")},
|
80
|
+
"width": 20,
|
81
|
+
},
|
82
|
+
"total": {
|
83
|
+
"header": {"value": _("TOTAL")},
|
84
|
+
"lines": {
|
85
|
+
"value": self._render("formatLang(env, invoice_total(move))")
|
86
|
+
},
|
87
|
+
"width": 20,
|
88
|
+
},
|
89
|
+
"tax_name": {
|
90
|
+
"header": {"value": _("Tax description")},
|
91
|
+
"lines": {"value": self._render("line['tax_code_name']")},
|
92
|
+
"width": 20,
|
93
|
+
},
|
94
|
+
"taxable": {
|
95
|
+
"header": {"value": _("Taxable")},
|
96
|
+
"lines": {"value": self._render("formatLang(env, line['base'])")},
|
97
|
+
"width": 20,
|
98
|
+
},
|
99
|
+
"tax": {
|
100
|
+
"header": {"value": _("Tax")},
|
101
|
+
"lines": {"value": self._render("formatLang(env, line['tax'])")},
|
102
|
+
"width": 20,
|
103
|
+
},
|
104
|
+
}
|
105
|
+
|
106
|
+
col_specs.update(self._get_vat_settlement_date_col_spec())
|
107
|
+
wanted = col_specs.keys()
|
108
|
+
if registry_type == "corrispettivi":
|
109
|
+
wanted -= ["reason", "inv_date", "inv_name", "partner", "tin"]
|
110
|
+
|
111
|
+
return [
|
112
|
+
{
|
113
|
+
"ws_name": "vat_registry",
|
114
|
+
"title": title,
|
115
|
+
"wanted_list": wanted,
|
116
|
+
"col_specs": col_specs,
|
117
|
+
"generate_ws_method": "generate_ws",
|
118
|
+
}
|
119
|
+
]
|
120
|
+
|
121
|
+
def generate_ws(self, workbook, ws, ws_params, data, objects):
|
122
|
+
ws.set_landscape()
|
123
|
+
ws.fit_to_pages(1, 0)
|
124
|
+
ws.set_header(XLS_HEADERS["xls_headers"]["standard"])
|
125
|
+
ws.set_footer(XLS_HEADERS["xls_footers"]["standard"])
|
126
|
+
|
127
|
+
self._set_column_width(ws, ws_params)
|
128
|
+
|
129
|
+
row_pos = 0
|
130
|
+
row_pos = self._write_ws_title(ws, row_pos, ws_params)
|
131
|
+
|
132
|
+
row_pos = self._write_line(
|
133
|
+
ws,
|
134
|
+
row_pos,
|
135
|
+
ws_params,
|
136
|
+
col_specs_section="header",
|
137
|
+
default_format=FORMATS["format_theader_yellow_left"],
|
138
|
+
)
|
139
|
+
|
140
|
+
ws.freeze_panes(row_pos, 0)
|
141
|
+
|
142
|
+
for move in objects:
|
143
|
+
inv_taxes, used_taxes = self._get_tax_lines(move, data["form"])
|
144
|
+
|
145
|
+
for line in inv_taxes:
|
146
|
+
row_pos = self._write_line(
|
147
|
+
ws,
|
148
|
+
row_pos,
|
149
|
+
ws_params,
|
150
|
+
col_specs_section="lines",
|
151
|
+
render_space={
|
152
|
+
"env": self.env,
|
153
|
+
"move": move,
|
154
|
+
"line": line,
|
155
|
+
"format_date": self._format_date,
|
156
|
+
"date_format": data["form"]["date_format"],
|
157
|
+
"formatLang": formatLang,
|
158
|
+
"invoice_total": self._get_move_total,
|
159
|
+
},
|
160
|
+
default_format=FORMATS["format_tcell_left"],
|
161
|
+
)
|
@@ -1,10 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: odoo-addon-l10n_it_vat_registries
|
3
|
-
Version: 18.0.1.0
|
3
|
+
Version: 18.0.1.1.0
|
4
4
|
Requires-Python: >=3.10
|
5
5
|
Requires-Dist: odoo-addon-account_tax_balance==18.0.*
|
6
6
|
Requires-Dist: odoo-addon-date_range==18.0.*
|
7
7
|
Requires-Dist: odoo-addon-l10n_it_account==18.0.*
|
8
|
+
Requires-Dist: odoo-addon-report_xlsx_helper==18.0.*
|
8
9
|
Requires-Dist: odoo==18.0.*
|
9
10
|
Summary: ITA - Registri IVA
|
10
11
|
Home-page: https://github.com/OCA/l10n-italy
|
@@ -16,6 +17,7 @@ Classifier: Framework :: Odoo
|
|
16
17
|
Classifier: Framework :: Odoo :: 18.0
|
17
18
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
18
19
|
Classifier: Development Status :: 5 - Production/Stable
|
20
|
+
Description-Content-Type: text/x-rst
|
19
21
|
|
20
22
|
.. image:: https://odoo-community.org/readme-banner-image
|
21
23
|
:target: https://odoo-community.org/get-involved?utm_source=readme
|
@@ -30,7 +32,7 @@ ITA - Registri IVA
|
|
30
32
|
!! This file is generated by oca-gen-addon-readme !!
|
31
33
|
!! changes will be overwritten. !!
|
32
34
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
33
|
-
!! source digest: sha256:
|
35
|
+
!! source digest: sha256:8a3455eafdafa0f7c5848cfe4fd73b09c475aad1de1075672537969d0b5c4610
|
34
36
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
35
37
|
|
36
38
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
@@ -1,6 +1,6 @@
|
|
1
|
-
odoo/addons/l10n_it_vat_registries/README.rst,sha256=
|
1
|
+
odoo/addons/l10n_it_vat_registries/README.rst,sha256=ku28MAfs-O8gSjPJxAk3TcAub2YiSj7EpFisW3QXqrA,6474
|
2
2
|
odoo/addons/l10n_it_vat_registries/__init__.py,sha256=JqDSCLCkAweuTaARbhG1B8Lkrgg-ZjR4Jbkty4ySwok,107
|
3
|
-
odoo/addons/l10n_it_vat_registries/__manifest__.py,sha256=
|
3
|
+
odoo/addons/l10n_it_vat_registries/__manifest__.py,sha256=nOOOQ48176g8_IPxQTzNgrPljqamwClpTd4L99sZ71g,1234
|
4
4
|
odoo/addons/l10n_it_vat_registries/i18n/am.po,sha256=WSOaUM9dqbuAtMfVaIZobLtQGt7A34XNRDAHh2GEmGI,13362
|
5
5
|
odoo/addons/l10n_it_vat_registries/i18n/ar.po,sha256=xtcNUJQqSCS9IYb1So6yekqrPHJItYXHc1nVlp_15no,13520
|
6
6
|
odoo/addons/l10n_it_vat_registries/i18n/bg.po,sha256=6Bc3CcemvSoutcf9vYiBojgLTEjMGZBjC9hrkp56gHw,13494
|
@@ -44,7 +44,7 @@ odoo/addons/l10n_it_vat_registries/i18n/id.po,sha256=ZBRhDOsjcVHXZF-1bf0N0k3jHpd
|
|
44
44
|
odoo/addons/l10n_it_vat_registries/i18n/it.po,sha256=xU3F-oWmkUszGdiLa2_1Zmvd1Ww2KukMGY1vTG1O05M,16021
|
45
45
|
odoo/addons/l10n_it_vat_registries/i18n/ja.po,sha256=RCldAxXo9zvNlFZt_ZSzw5SLoGr2fgfXcL3TtpHZuk8,13372
|
46
46
|
odoo/addons/l10n_it_vat_registries/i18n/ko.po,sha256=-kbVO3RITQRxD98U3GhVrECJjOb-uKgJxHhBdjGOMDU,13373
|
47
|
-
odoo/addons/l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot,sha256=
|
47
|
+
odoo/addons/l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot,sha256=xOIMJff7Z15weXaMsHi78NNE_iLLGTkT_8kL5Ygisj0,15641
|
48
48
|
odoo/addons/l10n_it_vat_registries/i18n/lo.po,sha256=fkmL0691B7LHKA3RYGtfPVN6qyXI4P-0pCQQagVHswA,13296
|
49
49
|
odoo/addons/l10n_it_vat_registries/i18n/lt.po,sha256=wWHbtTdJu5lBJyYIpQCCkdVb-DhKLwyoBZJa_SV6QYA,13487
|
50
50
|
odoo/addons/l10n_it_vat_registries/i18n/lt_LT.po,sha256=zeMkSjKtcUBqktAywwHGBPVRrtEXsJzd8gFMNnErJMs,13449
|
@@ -84,20 +84,21 @@ odoo/addons/l10n_it_vat_registries/readme/CREDITS.md,sha256=Q372BU26Eqhkt_xq5BKv
|
|
84
84
|
odoo/addons/l10n_it_vat_registries/readme/DESCRIPTION.md,sha256=wtW9ElobuDdencAdgRd6QzLDx1C5eeDzQOnDOLK-C4Q,96
|
85
85
|
odoo/addons/l10n_it_vat_registries/readme/USAGE.md,sha256=DtBGHIk1gM695eu4_SwWqSeIyuX1mf4M5kArnojCkpY,792
|
86
86
|
odoo/addons/l10n_it_vat_registries/report/report_registro_iva.xml,sha256=EFFmIIvAl9L9aZ95zinX5ib6VSoRDlz7zIj1-yfUEiM,24818
|
87
|
-
odoo/addons/l10n_it_vat_registries/report/reports.xml,sha256=
|
87
|
+
odoo/addons/l10n_it_vat_registries/report/reports.xml,sha256=RLmY07WcmsR8wERMwsaV45XggD868DBUyX4WIV5diAE,1057
|
88
88
|
odoo/addons/l10n_it_vat_registries/security/ir.model.access.csv,sha256=60vgVGdBp4z_DW3k8g10Xsqn_lC3ISmsXRS8yFMIVSw,651
|
89
89
|
odoo/addons/l10n_it_vat_registries/security/vat_registry_security.xml,sha256=0roce_QYNWfU6tZ_y3qCrMdmm5cUD21AjouP909Jjck,439
|
90
90
|
odoo/addons/l10n_it_vat_registries/static/description/icon.png,sha256=xbRU_cSM3yeaxH2HArBlJ9csFUu0GYQitvLydbJnpAM,6167
|
91
|
-
odoo/addons/l10n_it_vat_registries/static/description/index.html,sha256=
|
91
|
+
odoo/addons/l10n_it_vat_registries/static/description/index.html,sha256=x60MIdPznZewbMRobA74MCZ_wLgVXicQzd2odeb9m-U,17198
|
92
92
|
odoo/addons/l10n_it_vat_registries/tests/__init__.py,sha256=dZJwSFx0LQvIqMT8R2Pw_Z0kaW0spztW5C03jAy5bPY,93
|
93
|
-
odoo/addons/l10n_it_vat_registries/tests/test_registry.py,sha256=
|
93
|
+
odoo/addons/l10n_it_vat_registries/tests/test_registry.py,sha256=JRJXzMcWjEKTPhNskNkl4uWAz60QF9hqgr0FX44sMY4,4233
|
94
94
|
odoo/addons/l10n_it_vat_registries/views/account_journal_view.xml,sha256=BjjzCo_3C_9s1b86B3QGQK4qs-BXFJqf2RpxwBbfkPQ,574
|
95
95
|
odoo/addons/l10n_it_vat_registries/views/account_tax_registry_view.xml,sha256=2uWszXs9WA2vQAj8Tw51vCcOT7F4D-78_ilijQkxjpE,1794
|
96
96
|
odoo/addons/l10n_it_vat_registries/views/account_view.xml,sha256=0S_xjdHYN20Gi-KOxIQYVRxviQvu5Qe4_O76NA5fyRE,468
|
97
|
-
odoo/addons/l10n_it_vat_registries/wizard/__init__.py,sha256=
|
98
|
-
odoo/addons/l10n_it_vat_registries/wizard/print_registro_iva.py,sha256=
|
99
|
-
odoo/addons/l10n_it_vat_registries/wizard/print_registro_iva.xml,sha256=
|
100
|
-
|
101
|
-
odoo_addon_l10n_it_vat_registries-18.0.1.0.
|
102
|
-
odoo_addon_l10n_it_vat_registries-18.0.1.0.
|
103
|
-
odoo_addon_l10n_it_vat_registries-18.0.1.0.
|
97
|
+
odoo/addons/l10n_it_vat_registries/wizard/__init__.py,sha256=mGqx5yofct5XGCZHYycLIyem9PVQYnLqcByZZgGQ8a0,137
|
98
|
+
odoo/addons/l10n_it_vat_registries/wizard/print_registro_iva.py,sha256=Z1F9Bq35ze3i1XcVDpla0dGVUnobSaFIbYKASPrJY1k,6649
|
99
|
+
odoo/addons/l10n_it_vat_registries/wizard/print_registro_iva.xml,sha256=dAHZizWAb_GOoIJjXlkDG29w_10MuVgs8Iw3WxgFm4E,3924
|
100
|
+
odoo/addons/l10n_it_vat_registries/wizard/report_registro_iva_xlsx.py,sha256=Z5kJMyiwpNUiuOUZCaEFxxtSTKqPxIPfw95QzT6N0g4,5479
|
101
|
+
odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info/METADATA,sha256=dKK0xXlZpZD06IBsEoM86W-ChglCFxnl6SK_wy7KKiw,7296
|
102
|
+
odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
|
103
|
+
odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
104
|
+
odoo_addon_l10n_it_vat_registries-18.0.1.1.0.dist-info/RECORD,,
|