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
@@ -6,19 +6,19 @@ from odoo import fields, models
6
6
  class ResCompany(models.Model):
7
7
  _inherit = "res.company"
8
8
 
9
- tax_stamp_product_id = fields.Many2one(
10
- "product.product",
11
- "Tax Stamp Product",
12
- help="Product used as Tax Stamp in customer invoices.",
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
- tax_stamp_product_id = fields.Many2one(
20
- related="company_id.tax_stamp_product_id",
21
- string="Tax Stamp Product",
22
- help="Product used as Tax Stamp in customer invoices.",
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
  )
@@ -6,24 +6,35 @@ from odoo import _, api, exceptions, fields, models
6
6
  class ProductTemplate(models.Model):
7
7
  _inherit = "product.template"
8
8
 
9
- @api.constrains("stamp_apply_tax_ids", "is_stamp")
9
+ @api.constrains(
10
+ "l10n_it_account_stamp_stamp_duty_apply_tax_ids",
11
+ "l10n_it_account_stamp_is_stamp",
12
+ )
10
13
  def _check_stamp_apply_tax(self):
11
14
  for template in self:
12
- if template.stamp_apply_tax_ids and not template.is_stamp:
15
+ if (
16
+ template.l10n_it_account_stamp_stamp_duty_apply_tax_ids
17
+ and not template.l10n_it_account_stamp_is_stamp
18
+ ):
13
19
  raise exceptions.ValidationError(
14
20
  _("The product %s must be a stamp to apply set taxes!")
15
21
  % template.name
16
22
  )
17
23
 
18
- stamp_apply_tax_ids = fields.Many2many(
19
- "account.tax",
20
- "product_tax_account_tax__rel",
21
- "product_id",
22
- "tax_id",
24
+ l10n_it_account_stamp_stamp_duty_apply_tax_ids = fields.Many2many(
25
+ comodel_name="account.tax",
26
+ relation="l10n_it_account_stamp_product_tax_account_tax_rel",
27
+ column1="product_id",
28
+ column2="tax_id",
23
29
  string="Stamp taxes",
24
30
  )
25
- stamp_apply_min_total_base = fields.Float(
26
- "Stamp applicability min total base", digits="Account"
31
+ l10n_it_account_stamp_tax_apply_min_total_base = fields.Float(
32
+ string="Stamp applicability min total base",
33
+ digits="Account",
34
+ )
35
+ l10n_it_account_stamp_is_stamp = fields.Boolean(
36
+ string="Is a stamp",
37
+ )
38
+ l10n_it_account_stamp_auto_compute = fields.Boolean(
39
+ string="Auto-compute",
27
40
  )
28
- is_stamp = fields.Boolean("Is a stamp")
29
- auto_compute = fields.Boolean("Auto-compute")
@@ -11,7 +11,7 @@ necessario abilitare le funzioni complete per la contabilità:
11
11
  Modalità automatica:
12
12
 
13
13
  - andare sul prodotto "Imposta di bollo 2 euro" e configurare "Imposte
14
- marca da bollo" (Imposte in esenzione).
14
+ per bollo" (Imposte in esenzione).
15
15
  - per ciascuna fattura o ricevuta, l'applicabilità dell'imposta di bollo
16
16
  verrà calcolata in modo automatico in base alla somma degli imponibili
17
17
  relativi alle imposte selezionate.
@@ -30,7 +30,7 @@ generalmente ricavo="Debiti per bolli" e costo="Valori bollati".
30
30
 
31
31
  **English**
32
32
 
33
- In order to change Tax Stamp 2 euro product settings, enable full
33
+ In order to change 'Stamp duty 2 euro' product settings, enable full
34
34
  accounting features:
35
35
 
36
36
  1. Settings -\> Users & Companies -\> Groups
@@ -39,7 +39,7 @@ accounting features:
39
39
 
40
40
  Automatic mode:
41
41
 
42
- - Go to 'Tax Stamp 2 euro' product and configure 'Stamp taxes'
42
+ - Go to 'Stamp duty 2 euro' product and configure 'Stamp taxes'
43
43
  (exemption taxes).
44
44
  - For each invoice or receipt, the base amount for each selected tax
45
45
  will be added up and used to determine the application of the account
@@ -47,8 +47,8 @@ Automatic mode:
47
47
 
48
48
  Manual mode:
49
49
 
50
- - Go to 'Tax Stamp 2 euro' product and deselect 'Auto-compute' checkbox.
51
- - For each invoice or receipt, manually enable 'Tax Stamp' checkbox.
50
+ - Go to 'Stamp duty 2 euro' product and deselect 'Auto-compute' checkbox.
51
+ - For each invoice or receipt, manually enable 'Stamp Duty' checkbox.
52
52
 
53
53
  Also set income/expense accounts, typically income = 'Debiti per bolli'
54
54
  and expense = 'Valori bollati'.
@@ -8,3 +8,4 @@
8
8
  - Giovanni Serra \<<giovanni@gslab.it>\>
9
9
  - [Aion Tech](https://aiontech.company/):
10
10
  - Simone Rubino \<<simone.rubino@aion-tech.it>\>
11
+ - [Nextev Srl](https://www.nextev.it)
@@ -1,8 +1,9 @@
1
1
  **Italiano**
2
2
 
3
- Questo modulo aggiunge il supporto all'imposta di bollo italiana nelle
4
- fatture e nelle ricevute.
3
+ Questo modulo permette di calcolare automaticamente ed addebitare al cliente l'imposta di bollo italiana nelle fatture e nelle ricevute mantenendo la sincronizzazione con il campo "Dati Bollo" (`l10n_it_stamp_duty`) di `l10n_it_edi`.
4
+ In questo modo l'elemento XML `<DatiBollo>` verrà valorizzato correttamente.
5
5
 
6
6
  **English**
7
7
 
8
- This module adds Italian Tax Stamp support in invoices and receipts.
8
+ This module allows to automatically compute and charge the Italian stamp duty to customers in invoices and receipts while maintaining synchronization with the "Stamp Duty Data" field (`l10n_it_stamp_duty`) of `l10n_it_edi`.
9
+ In this way XML tag `<DatiBollo>` will be correctly set.
@@ -0,0 +1,7 @@
1
+ ** Italiano **
2
+
3
+ Sono stati aggiunti gli script di migrazione, da provare quando saranno rilasciati quelli relativi ad `account`.
4
+
5
+ ** English **
6
+
7
+ Migration scripts have been added, to be tested when `account` related ones will be released.
@@ -9,8 +9,8 @@ verrà addebitata al cliente.
9
9
 
10
10
  **English**
11
11
 
12
- In invoice or receipt form, when applicable, click 'Add tax stamp line'
13
- button to add tax stamp as invoice line, thus charging customer.
12
+ In invoice or receipt form, when applicable, click 'Add stamp duty line'
13
+ button to add stamp duty as invoice line, thus charging customer.
14
14
 
15
- Otherwise, tax stamp will be anyway accounted, without charging
15
+ Otherwise, stamp duty will be anyway accounted, without charging
16
16
  customer.
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
5
  <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
- <title>ITA - Imposta di bollo</title>
6
+ <title>README.rst</title>
7
7
  <style type="text/css">
8
8
 
9
9
  /*
@@ -360,37 +360,50 @@ ul.auto-toc {
360
360
  </style>
361
361
  </head>
362
362
  <body>
363
- <div class="document" id="ita-imposta-di-bollo">
364
- <h1 class="title">ITA - Imposta di bollo</h1>
363
+ <div class="document">
365
364
 
365
+
366
+ <a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367
+ <img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368
+ </a>
369
+ <div class="section" id="ita-imposta-di-bollo">
370
+ <h1>ITA - Imposta di bollo</h1>
366
371
  <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
372
  !! This file is generated by oca-gen-addon-readme !!
368
373
  !! changes will be overwritten. !!
369
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:a81fbb48d1af1704b5039d1b6239009736a6f4983e7441b65359d85f54064061
375
+ !! source digest: sha256:d29741720c8c8b6a1ad2db28a9979cf34a4cf2868852f58103fe19eaf7c4bd74
371
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
- <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_account_stamp"><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-16-0/l10n-italy-16-0-l10n_it_account_stamp"><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&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_account_stamp"><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_account_stamp"><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&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
378
  <p><strong>Italiano</strong></p>
374
- <p>Questo modulo aggiunge il supporto all’imposta di bollo italiana nelle
375
- fatture e nelle ricevute.</p>
379
+ <p>Questo modulo permette di calcolare automaticamente ed addebitare al
380
+ cliente l’imposta di bollo italiana nelle fatture e nelle ricevute
381
+ mantenendo la sincronizzazione con il campo “Dati Bollo”
382
+ (<tt class="docutils literal">l10n_it_stamp_duty</tt>) di <tt class="docutils literal">l10n_it_edi</tt>. In questo modo l’elemento
383
+ XML <tt class="docutils literal">&lt;DatiBollo&gt;</tt> verrà valorizzato correttamente.</p>
376
384
  <p><strong>English</strong></p>
377
- <p>This module adds Italian Tax Stamp support in invoices and receipts.</p>
385
+ <p>This module allows to automatically compute and charge the Italian stamp
386
+ duty to customers in invoices and receipts while maintaining
387
+ synchronization with the “Stamp Duty Data” field
388
+ (<tt class="docutils literal">l10n_it_stamp_duty</tt>) of <tt class="docutils literal">l10n_it_edi</tt>. In this way XML tag
389
+ <tt class="docutils literal">&lt;DatiBollo&gt;</tt> will be correctly set.</p>
378
390
  <p><strong>Table of contents</strong></p>
379
391
  <div class="contents local topic" id="contents">
380
392
  <ul class="simple">
381
393
  <li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
382
394
  <li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
383
- <li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
384
- <li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
385
- <li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
386
- <li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
387
- <li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
395
+ <li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
396
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
397
+ <li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
398
+ <li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
399
+ <li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
400
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
388
401
  </ul>
389
402
  </li>
390
403
  </ul>
391
404
  </div>
392
405
  <div class="section" id="configuration">
393
- <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
406
+ <h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
394
407
  <p><strong>Italiano</strong></p>
395
408
  <p>Per modificare le impostazioni sul prodotto “Imposta di bollo 2 euro” è
396
409
  necessario abilitare le funzioni complete per la contabilità:</p>
@@ -403,10 +416,10 @@ selezionarlo</li>
403
416
  <p>Modalità automatica:</p>
404
417
  <ul class="simple">
405
418
  <li>andare sul prodotto “Imposta di bollo 2 euro” e configurare “Imposte
406
- marca da bollo” (Imposte in esenzione).</li>
407
- <li>per ciascuna fattura o ricevuta, l’applicabilità dell’imposta di
408
- bollo verrà calcolata in modo automatico in base alla somma degli
409
- imponibili relativi alle imposte selezionate.</li>
419
+ per bollo” (Imposte in esenzione).</li>
420
+ <li>per ciascuna fattura o ricevuta, l’applicabilità dell’imposta di bollo
421
+ verrà calcolata in modo automatico in base alla somma degli imponibili
422
+ relativi alle imposte selezionate.</li>
410
423
  </ul>
411
424
  <p>Modalità manuale:</p>
412
425
  <ul class="simple">
@@ -420,7 +433,7 @@ imposte selezionate.</li>
420
433
  <p>Impostare i conti di ricavo/costo nella scheda “Contabilità”,
421
434
  generalmente ricavo=”Debiti per bolli” e costo=”Valori bollati”.</p>
422
435
  <p><strong>English</strong></p>
423
- <p>In order to change Tax Stamp 2 euro product settings, enable full
436
+ <p>In order to change Stamp duty 2 euro product settings, enable full
424
437
  accounting features:</p>
425
438
  <ol class="arabic simple">
426
439
  <li>Settings -&gt; Users &amp; Companies -&gt; Groups</li>
@@ -429,7 +442,7 @@ accounting features:</p>
429
442
  </ol>
430
443
  <p>Automatic mode:</p>
431
444
  <ul class="simple">
432
- <li>Go to ‘Tax Stamp 2 euro’ product and configure ‘Stamp taxes’
445
+ <li>Go to ‘Stamp duty 2 euro’ product and configure ‘Stamp taxes’
433
446
  (exemption taxes).</li>
434
447
  <li>For each invoice or receipt, the base amount for each selected tax
435
448
  will be added up and used to determine the application of the account
@@ -437,15 +450,15 @@ stamp.</li>
437
450
  </ul>
438
451
  <p>Manual mode:</p>
439
452
  <ul class="simple">
440
- <li>Go to ‘Tax Stamp 2 euro’ product and deselect ‘Auto-compute’
453
+ <li>Go to ‘Stamp duty 2 euro’ product and deselect ‘Auto-compute’
441
454
  checkbox.</li>
442
- <li>For each invoice or receipt, manually enable ‘Tax Stamp’ checkbox.</li>
455
+ <li>For each invoice or receipt, manually enable ‘Stamp Duty’ checkbox.</li>
443
456
  </ul>
444
457
  <p>Also set income/expense accounts, typically income = ‘Debiti per bolli’
445
458
  and expense = ‘Valori bollati’.</p>
446
459
  </div>
447
460
  <div class="section" id="usage">
448
- <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
461
+ <h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
449
462
  <p><strong>Italiano</strong></p>
450
463
  <p>Se nella fattura o ricevuta è previsto l’addebito dell’imposta di bollo
451
464
  al cliente, fare clic sul pulsante “Aggiungi riga bollo” per aggiungere
@@ -453,23 +466,32 @@ una riga relativa all’imposta di bollo.</p>
453
466
  <p>In caso contrario, l’imposta di bollo verrà comunque considerata ma non
454
467
  verrà addebitata al cliente.</p>
455
468
  <p><strong>English</strong></p>
456
- <p>In invoice or receipt form, when applicable, click ‘Add tax stamp line’
457
- button to add tax stamp as invoice line, thus charging customer.</p>
458
- <p>Otherwise, tax stamp will be anyway accounted, without charging
469
+ <p>In invoice or receipt form, when applicable, click ‘Add stamp duty line’
470
+ button to add stamp duty as invoice line, thus charging customer.</p>
471
+ <p>Otherwise, stamp duty will be anyway accounted, without charging
459
472
  customer.</p>
460
473
  </div>
474
+ <div class="section" id="known-issues-roadmap">
475
+ <h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
476
+ <p>** Italiano **</p>
477
+ <p>Sono stati aggiunti gli script di migrazione, da provare quando saranno
478
+ rilasciati quelli relativi ad <tt class="docutils literal">account</tt>.</p>
479
+ <p>** English **</p>
480
+ <p>Migration scripts have been added, to be tested when <tt class="docutils literal">account</tt> related
481
+ ones will be released.</p>
482
+ </div>
461
483
  <div class="section" id="bug-tracker">
462
- <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
484
+ <h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
463
485
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
464
486
  In case of trouble, please check there if your issue has already been reported.
465
487
  If you spotted it first, help us to smash it by providing a detailed and welcomed
466
- <a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_account_stamp%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
488
+ <a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_account_stamp%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
467
489
  <p>Do not contact contributors directly about support or help with technical issues.</p>
468
490
  </div>
469
491
  <div class="section" id="credits">
470
- <h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
492
+ <h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
471
493
  <div class="section" id="authors">
472
- <h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
494
+ <h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
473
495
  <ul class="simple">
474
496
  <li>Ermanno Gnan</li>
475
497
  <li>Sergio Corato</li>
@@ -477,7 +499,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
477
499
  </ul>
478
500
  </div>
479
501
  <div class="section" id="contributors">
480
- <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
502
+ <h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
481
503
  <ul class="simple">
482
504
  <li>Lorenzo Battistini &lt;<a class="reference external" href="https://github.com/eLBati">https://github.com/eLBati</a>&gt;</li>
483
505
  <li>Sergio Corato</li>
@@ -491,10 +513,11 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
491
513
  <li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;aion-tech.it">simone.rubino&#64;aion-tech.it</a>&gt;</li>
492
514
  </ul>
493
515
  </li>
516
+ <li><a class="reference external" href="https://www.nextev.it">Nextev Srl</a></li>
494
517
  </ul>
495
518
  </div>
496
519
  <div class="section" id="maintainers">
497
- <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
520
+ <h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
498
521
  <p>This module is maintained by the OCA.</p>
499
522
  <a class="reference external image-reference" href="https://odoo-community.org">
500
523
  <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -502,10 +525,11 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
502
525
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
503
526
  mission is to support the collaborative development of Odoo features and
504
527
  promote its widespread use.</p>
505
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_account_stamp">OCA/l10n-italy</a> project on GitHub.</p>
528
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_account_stamp">OCA/l10n-italy</a> project on GitHub.</p>
506
529
  <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
507
530
  </div>
508
531
  </div>
509
532
  </div>
533
+ </div>
510
534
  </body>
511
535
  </html>
@@ -18,7 +18,7 @@ class InvoicingTest(TestAccountInvoiceReport):
18
18
 
19
19
  account_revenue_id = self.env["account.account"].search(
20
20
  [
21
- ("company_id", "=", self.env.company.id),
21
+ ("company_ids", "child_of", self.env.company.id),
22
22
  (
23
23
  "account_type",
24
24
  "=",
@@ -29,7 +29,7 @@ class InvoicingTest(TestAccountInvoiceReport):
29
29
  )
30
30
  account_expense_id = self.env["account.account"].search(
31
31
  [
32
- ("company_id", "=", self.env.company.id),
32
+ ("company_ids", "child_of", self.env.company.id),
33
33
  (
34
34
  "account_type",
35
35
  "=",
@@ -40,12 +40,14 @@ class InvoicingTest(TestAccountInvoiceReport):
40
40
  )
41
41
  stamp_product_id.write(
42
42
  {
43
- "stamp_apply_tax_ids": [(6, 0, [self.tax_id.id])],
43
+ "l10n_it_account_stamp_stamp_duty_apply_tax_ids": [
44
+ (6, 0, [self.tax_id.id])
45
+ ],
44
46
  "property_account_income_id": account_revenue_id.id,
45
47
  "property_account_expense_id": account_expense_id.id,
46
48
  }
47
49
  )
48
- self.env.company.tax_stamp_product_id = stamp_product_id
50
+ self.env.company.l10n_it_account_stamp_stamp_duty_product_id = stamp_product_id
49
51
 
50
52
  def test_post_invoicing(self):
51
53
  invoice = first(
@@ -59,7 +61,7 @@ class InvoicingTest(TestAccountInvoiceReport):
59
61
  self.assertEqual(
60
62
  len(invoice.line_ids.filtered(lambda line: line.is_stamp_line)), 0
61
63
  )
62
- self.assertTrue(invoice.tax_stamp)
64
+ self.assertTrue(invoice.l10n_it_account_stamp_is_stamp_duty_applied)
63
65
  invoice.action_post()
64
66
 
65
67
  self.assertEqual(
@@ -84,45 +86,131 @@ class InvoicingTest(TestAccountInvoiceReport):
84
86
  invoice.action_post()
85
87
 
86
88
  # Add stamp and check that edited description is kept
87
- invoice.add_tax_stamp_line()
89
+ invoice.button_draft()
90
+ invoice.add_stamp_duty_invoice_line()
88
91
  self.assertEqual(invoice.invoice_line_ids[0].name, edited_descr)
89
92
 
90
93
  def test_amount_total_changing_currency(self):
91
94
  """Modify invoice currency and check that amount_total does not change after
92
95
  action_post"""
93
- self.env.company.tax_stamp_product_id.auto_compute = False
96
+ stamp_duty_product = (
97
+ self.env.company.l10n_it_account_stamp_stamp_duty_product_id
98
+ )
99
+ stamp_duty_product.l10n_it_account_stamp_auto_compute = False
94
100
  invoice = first(
95
101
  self.invoices.filtered(lambda inv: inv.move_type == "out_invoice")
96
102
  )
97
103
  invoice_form = Form(invoice)
98
- invoice_form.manually_apply_tax_stamp = False
104
+ invoice_form.l10n_it_account_stamp_manually_apply_stamp_duty = False
99
105
  invoice_form.currency_id = self.env.ref("base.USD")
100
106
  invoice = invoice_form.save()
101
107
  total = invoice.amount_total
102
108
  invoice.action_post()
103
109
  self.assertEqual(total, invoice.amount_total)
104
110
 
105
- def test_tax_stamp_line_button(self):
106
- """Stamp fields show when stamp is added with the button to the invoice."""
107
- # Arrange: Create an invoice eligible for tax stamp but without it
108
- stamp_tax = self.tax_id
109
- invoice = self.init_invoice(
110
- "out_invoice",
111
- taxes=stamp_tax,
112
- amounts=[
113
- 100,
114
- ],
111
+ def test_reset_invoice_to_draft(self):
112
+ """Reset an invoice to draft and check that relative tax stamp accounting lines
113
+ has been deleted."""
114
+ invoice = first(
115
+ self.invoices.filtered(lambda inv: inv.move_type == "out_invoice")
115
116
  )
116
- # pre-condition
117
- self.assertTrue(invoice.tax_stamp)
118
- self.assertFalse(invoice.tax_stamp_line_present)
119
117
 
120
- # Act
121
- invoice.add_tax_stamp_line()
118
+ self.assertEqual(len(invoice), 1)
119
+ self.assertEqual(len(invoice.invoice_line_ids), 2)
122
120
 
123
- # Assert
124
- self.assertTrue(invoice.tax_stamp_line_present)
121
+ invoice.invoice_line_ids[0].write({"tax_ids": [(6, 0, [self.tax_id.id])]})
122
+ invoice.action_post()
123
+
124
+ self.assertEqual(
125
+ len(invoice.line_ids.filtered(lambda line: line.is_stamp_line)), 2
126
+ )
125
127
 
126
- # Resetting to draft removes the stamp
127
128
  invoice.button_draft()
128
- self.assertFalse(invoice.tax_stamp_line_present)
129
+
130
+ self.assertEqual(
131
+ len(invoice.line_ids.filtered(lambda line: line.is_stamp_line)), 0
132
+ )
133
+
134
+ def test_compute_l10n_it_stamp_duty(self):
135
+ """Test that l10n_it_stamp_duty is correctly computed based on stamp
136
+ application and product price."""
137
+ stamp_product = self.env.company.l10n_it_account_stamp_stamp_duty_product_id
138
+ stamp_price = stamp_product.list_price
139
+
140
+ # Test 1: Invoice in draft with stamp duty applied
141
+ invoice = first(
142
+ self.invoices.filtered(lambda inv: inv.move_type == "out_invoice")
143
+ )
144
+ invoice.invoice_line_ids[0].write({"tax_ids": [(6, 0, [self.tax_id.id])]})
145
+ self.assertTrue(invoice.l10n_it_account_stamp_is_stamp_duty_applied)
146
+ self.assertEqual(invoice.state, "draft")
147
+ self.assertEqual(
148
+ invoice.l10n_it_stamp_duty,
149
+ stamp_price,
150
+ "Stamp duty should equal product price when applied in draft",
151
+ )
152
+
153
+ # Test 2: Invoice in draft without stamp duty applied
154
+ invoice2 = self.env["account.move"].create(
155
+ {
156
+ "move_type": "out_invoice",
157
+ "partner_id": self.partner_a.id,
158
+ "invoice_date": "2024-01-01",
159
+ "invoice_line_ids": [
160
+ (
161
+ 0,
162
+ 0,
163
+ {
164
+ "name": "Test Product Without Stamp",
165
+ "price_unit": 100.0,
166
+ "quantity": 1,
167
+ },
168
+ )
169
+ ],
170
+ }
171
+ )
172
+ self.assertFalse(invoice2.l10n_it_account_stamp_is_stamp_duty_applied)
173
+ self.assertEqual(invoice2.state, "draft")
174
+ self.assertEqual(
175
+ invoice2.l10n_it_stamp_duty,
176
+ 0,
177
+ "Stamp duty should be 0 when not applied",
178
+ )
179
+
180
+ # Test 3: Posted invoice should keep value from draft
181
+ invoice.action_post()
182
+ self.assertEqual(invoice.state, "posted")
183
+ self.assertEqual(
184
+ invoice.l10n_it_stamp_duty,
185
+ stamp_price,
186
+ "Stamp duty should be preserved after posting",
187
+ )
188
+
189
+ # Test 4: Change stamp product price and verify recomputation
190
+ new_price = 5.0
191
+ stamp_product.list_price = new_price
192
+ invoice3 = self.env["account.move"].create(
193
+ {
194
+ "move_type": "out_invoice",
195
+ "partner_id": self.partner_a.id,
196
+ "invoice_date": "2024-01-01",
197
+ "invoice_line_ids": [
198
+ (
199
+ 0,
200
+ 0,
201
+ {
202
+ "name": "Test Product",
203
+ "price_unit": 100.0,
204
+ "quantity": 1,
205
+ "tax_ids": [(6, 0, [self.tax_id.id])],
206
+ },
207
+ )
208
+ ],
209
+ }
210
+ )
211
+ self.assertTrue(invoice3.l10n_it_account_stamp_is_stamp_duty_applied)
212
+ self.assertEqual(
213
+ invoice3.l10n_it_stamp_duty,
214
+ new_price,
215
+ "Stamp duty should reflect updated product price",
216
+ )
@@ -1,15 +1,17 @@
1
1
  <?xml version="1.0" encoding="utf-8" ?>
2
2
  <odoo>
3
-
4
3
  <template
5
4
  id="report_invoice_document_custom_fields_ext"
6
5
  inherit_id="account.report_invoice_document"
7
6
  >
8
- <xpath expr="//p[@t-if='o.invoice_incoterm_id']" position="before">
9
- <p t-if="o.tax_stamp" name="tax_stamp">
10
- <span
11
- >Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 del DPR 642/1972 e del DM 17/06/2014</span>
12
- </p>
7
+ <xpath expr="//div[@name='incoterm_id']" position="before">
8
+ <div
9
+ t-if="o.l10n_it_account_stamp_is_stamp_duty_applied"
10
+ name="l10n_it_account_stamp_is_stamp_duty_applied"
11
+ class="col"
12
+ >
13
+ Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 del DPR 642/1972 e del DM 17/06/2014
14
+ </div>
13
15
  </xpath>
14
16
  </template>
15
17
  </odoo>