odoo-addon-l10n-it-account-stamp 16.0.1.1.0.1__py3-none-any.whl → 18.0.1.0.0.2__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. odoo/addons/l10n_it_account_stamp/README.rst +53 -40
  2. odoo/addons/l10n_it_account_stamp/__manifest__.py +1 -1
  3. odoo/addons/l10n_it_account_stamp/data/data.xml +5 -7
  4. odoo/addons/l10n_it_account_stamp/i18n/it.po +96 -172
  5. odoo/addons/l10n_it_account_stamp/i18n/l10n_it_account_stamp.pot +62 -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/models/account_move.py +61 -45
  10. odoo/addons/l10n_it_account_stamp/models/company.py +8 -8
  11. odoo/addons/l10n_it_account_stamp/models/product.py +22 -11
  12. odoo/addons/l10n_it_account_stamp/readme/CONFIGURE.md +5 -5
  13. odoo/addons/l10n_it_account_stamp/readme/DESCRIPTION.md +1 -1
  14. odoo/addons/l10n_it_account_stamp/readme/ROADMAP.md +7 -0
  15. odoo/addons/l10n_it_account_stamp/readme/USAGE.md +3 -3
  16. odoo/addons/l10n_it_account_stamp/static/description/index.html +36 -26
  17. odoo/addons/l10n_it_account_stamp/tests/test_account_stamp_invoicing.py +22 -15
  18. odoo/addons/l10n_it_account_stamp/views/account_move_report.xml +8 -6
  19. odoo/addons/l10n_it_account_stamp/views/account_move_view.xml +26 -22
  20. odoo/addons/l10n_it_account_stamp/views/company_view.xml +8 -33
  21. odoo/addons/l10n_it_account_stamp/views/product_view.xml +12 -16
  22. {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.1.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.0.0.2.dist-info}/METADATA +56 -43
  23. odoo_addon_l10n_it_account_stamp-18.0.1.0.0.2.dist-info/RECORD +30 -0
  24. {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.1.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.0.0.2.dist-info}/WHEEL +1 -1
  25. odoo_addon_l10n_it_account_stamp-16.0.1.1.0.1.dist-info/RECORD +0 -26
  26. {odoo_addon_l10n_it_account_stamp-16.0.1.1.0.1.dist-info → odoo_addon_l10n_it_account_stamp-18.0.1.0.0.2.dist-info}/top_level.txt +0 -0
@@ -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'.
@@ -5,4 +5,4 @@ fatture e nelle ricevute.
5
5
 
6
6
  **English**
7
7
 
8
- This module adds Italian Tax Stamp support in invoices and receipts.
8
+ This module adds Italian Stamp Duty support in invoices and receipts.
@@ -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.
@@ -367,24 +367,25 @@ ul.auto-toc {
367
367
  !! This file is generated by oca-gen-addon-readme !!
368
368
  !! changes will be overwritten. !!
369
369
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:a81fbb48d1af1704b5039d1b6239009736a6f4983e7441b65359d85f54064061
370
+ !! source digest: sha256:3a2471018d0fb7b4e1cbba40630ae81e67aa027440f5c2bcd3e080010dbd773d
371
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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>
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/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
373
  <p><strong>Italiano</strong></p>
374
374
  <p>Questo modulo aggiunge il supporto all’imposta di bollo italiana nelle
375
375
  fatture e nelle ricevute.</p>
376
376
  <p><strong>English</strong></p>
377
- <p>This module adds Italian Tax Stamp support in invoices and receipts.</p>
377
+ <p>This module adds Italian Stamp Duty support in invoices and receipts.</p>
378
378
  <p><strong>Table of contents</strong></p>
379
379
  <div class="contents local topic" id="contents">
380
380
  <ul class="simple">
381
381
  <li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
382
382
  <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>
383
+ <li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
384
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
385
+ <li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
386
+ <li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
387
+ <li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
388
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
388
389
  </ul>
389
390
  </li>
390
391
  </ul>
@@ -403,10 +404,10 @@ selezionarlo</li>
403
404
  <p>Modalità automatica:</p>
404
405
  <ul class="simple">
405
406
  <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>
407
+ per bollo” (Imposte in esenzione).</li>
408
+ <li>per ciascuna fattura o ricevuta, l’applicabilità dell’imposta di bollo
409
+ verrà calcolata in modo automatico in base alla somma degli imponibili
410
+ relativi alle imposte selezionate.</li>
410
411
  </ul>
411
412
  <p>Modalità manuale:</p>
412
413
  <ul class="simple">
@@ -420,7 +421,7 @@ imposte selezionate.</li>
420
421
  <p>Impostare i conti di ricavo/costo nella scheda “Contabilità”,
421
422
  generalmente ricavo=”Debiti per bolli” e costo=”Valori bollati”.</p>
422
423
  <p><strong>English</strong></p>
423
- <p>In order to change Tax Stamp 2 euro product settings, enable full
424
+ <p>In order to change Stamp duty 2 euro product settings, enable full
424
425
  accounting features:</p>
425
426
  <ol class="arabic simple">
426
427
  <li>Settings -&gt; Users &amp; Companies -&gt; Groups</li>
@@ -429,7 +430,7 @@ accounting features:</p>
429
430
  </ol>
430
431
  <p>Automatic mode:</p>
431
432
  <ul class="simple">
432
- <li>Go to ‘Tax Stamp 2 euro’ product and configure ‘Stamp taxes’
433
+ <li>Go to ‘Stamp duty 2 euro’ product and configure ‘Stamp taxes’
433
434
  (exemption taxes).</li>
434
435
  <li>For each invoice or receipt, the base amount for each selected tax
435
436
  will be added up and used to determine the application of the account
@@ -437,9 +438,9 @@ stamp.</li>
437
438
  </ul>
438
439
  <p>Manual mode:</p>
439
440
  <ul class="simple">
440
- <li>Go to ‘Tax Stamp 2 euro’ product and deselect ‘Auto-compute’
441
+ <li>Go to ‘Stamp duty 2 euro’ product and deselect ‘Auto-compute’
441
442
  checkbox.</li>
442
- <li>For each invoice or receipt, manually enable ‘Tax Stamp’ checkbox.</li>
443
+ <li>For each invoice or receipt, manually enable ‘Stamp Duty’ checkbox.</li>
443
444
  </ul>
444
445
  <p>Also set income/expense accounts, typically income = ‘Debiti per bolli’
445
446
  and expense = ‘Valori bollati’.</p>
@@ -453,23 +454,32 @@ una riga relativa all’imposta di bollo.</p>
453
454
  <p>In caso contrario, l’imposta di bollo verrà comunque considerata ma non
454
455
  verrà addebitata al cliente.</p>
455
456
  <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
457
+ <p>In invoice or receipt form, when applicable, click ‘Add stamp duty line’
458
+ button to add stamp duty as invoice line, thus charging customer.</p>
459
+ <p>Otherwise, stamp duty will be anyway accounted, without charging
459
460
  customer.</p>
460
461
  </div>
462
+ <div class="section" id="known-issues-roadmap">
463
+ <h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
464
+ <p>** Italiano **</p>
465
+ <p>Sono stati aggiunti gli script di migrazione, da provare quando saranno
466
+ rilasciati quelli relativi ad <tt class="docutils literal">account</tt>.</p>
467
+ <p>** English **</p>
468
+ <p>Migration scripts have been added, to be tested when <tt class="docutils literal">account</tt> related
469
+ ones will be released.</p>
470
+ </div>
461
471
  <div class="section" id="bug-tracker">
462
- <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
472
+ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
463
473
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
464
474
  In case of trouble, please check there if your issue has already been reported.
465
475
  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>
476
+ <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
477
  <p>Do not contact contributors directly about support or help with technical issues.</p>
468
478
  </div>
469
479
  <div class="section" id="credits">
470
- <h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
480
+ <h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
471
481
  <div class="section" id="authors">
472
- <h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
482
+ <h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
473
483
  <ul class="simple">
474
484
  <li>Ermanno Gnan</li>
475
485
  <li>Sergio Corato</li>
@@ -477,7 +487,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
477
487
  </ul>
478
488
  </div>
479
489
  <div class="section" id="contributors">
480
- <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
490
+ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
481
491
  <ul class="simple">
482
492
  <li>Lorenzo Battistini &lt;<a class="reference external" href="https://github.com/eLBati">https://github.com/eLBati</a>&gt;</li>
483
493
  <li>Sergio Corato</li>
@@ -494,7 +504,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
494
504
  </ul>
495
505
  </div>
496
506
  <div class="section" id="maintainers">
497
- <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
507
+ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
498
508
  <p>This module is maintained by the OCA.</p>
499
509
  <a class="reference external image-reference" href="https://odoo-community.org">
500
510
  <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -502,7 +512,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
502
512
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
503
513
  mission is to support the collaborative development of Odoo features and
504
514
  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>
515
+ <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
516
  <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
517
  </div>
508
518
  </div>
@@ -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,27 +86,31 @@ 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_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):
111
+ def test_stamp_duty_line_button(self):
106
112
  """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
113
+ # Arrange: Create an invoice eligible for stamp duty but without it
108
114
  stamp_tax = self.tax_id
109
115
  invoice = self.init_invoice(
110
116
  "out_invoice",
@@ -114,15 +120,16 @@ class InvoicingTest(TestAccountInvoiceReport):
114
120
  ],
115
121
  )
116
122
  # pre-condition
117
- self.assertTrue(invoice.tax_stamp)
118
- self.assertFalse(invoice.tax_stamp_line_present)
123
+ self.assertTrue(invoice.l10n_it_account_stamp_is_stamp_duty_applied)
124
+ self.assertFalse(invoice.l10n_it_account_stamp_is_stamp_duty_present)
119
125
 
120
126
  # Act
121
- invoice.add_tax_stamp_line()
127
+ invoice.add_stamp_duty_line()
128
+ invoice.action_post()
122
129
 
123
130
  # Assert
124
- self.assertTrue(invoice.tax_stamp_line_present)
131
+ self.assertTrue(invoice.l10n_it_account_stamp_is_stamp_duty_present)
125
132
 
126
133
  # Resetting to draft removes the stamp
127
134
  invoice.button_draft()
128
- self.assertFalse(invoice.tax_stamp_line_present)
135
+ self.assertFalse(invoice.l10n_it_account_stamp_is_stamp_duty_present)
@@ -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>
@@ -4,7 +4,6 @@
4
4
  ~ License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
5
5
  -->
6
6
  <odoo>
7
-
8
7
  <!-- Form: Invoice Customer -->
9
8
  <record id="account_move_form_stamp" model="ir.ui.view">
10
9
  <field name="name">account.move.form.stamp</field>
@@ -12,50 +11,56 @@
12
11
  <field name="inherit_id" ref="account.view_move_form" />
13
12
  <field name="arch" type="xml">
14
13
  <xpath
15
- expr="//field[@name='invoice_line_ids']/tree/field[@name='sequence']"
14
+ expr="//field[@name='invoice_line_ids']/list/field[@name='sequence']"
16
15
  position="after"
17
16
  >
18
- <field name="is_stamp_line" invisible="1" />
17
+ <field name="is_stamp_line" column_invisible="True" />
19
18
  </xpath>
20
- <xpath expr="//field[@name='invoice_line_ids']/tree" position="attributes">
19
+ <xpath expr="//field[@name='invoice_line_ids']/list" position="attributes">
21
20
  <attribute name="colors">CadetBlue:is_stamp_line==True;</attribute>
22
21
  </xpath>
23
22
  <xpath expr="//group[@id='header_right_group']" position="inside">
24
- <field name="auto_compute_stamp" invisible="1" />
25
- <field name="tax_stamp" string="Tax stamp" invisible="1" />
26
23
  <field
27
- name="manually_apply_tax_stamp"
28
- attrs="{'invisible': [('auto_compute_stamp', '=', True)]}"
24
+ name="l10n_it_account_stamp_auto_compute_stamp_duty"
25
+ invisible="1"
26
+ />
27
+ <field
28
+ name="l10n_it_account_stamp_is_stamp_duty_applied"
29
+ string="Stamp Duty"
30
+ invisible="1"
31
+ />
32
+ <field
33
+ name="l10n_it_account_stamp_manually_apply_stamp_duty"
34
+ invisible="l10n_it_account_stamp_auto_compute_stamp_duty"
35
+ />
36
+ <field
37
+ name="l10n_it_account_stamp_is_stamp_duty_present"
38
+ invisible="1"
29
39
  />
30
- <field name="tax_stamp_line_present" invisible="1" />
31
40
  </xpath>
32
41
  <field name="narration" position="before">
33
42
  <div
34
43
  name="stamp_applicability"
35
- attrs="{'invisible': [('tax_stamp', '=', False)]}"
44
+ invisible="not l10n_it_account_stamp_is_stamp_duty_applied"
36
45
  colspan="2"
37
46
  >
38
47
  <img
39
48
  src="/l10n_it_account_stamp/static/description/icon.png"
40
- alt="Tax stamp"
49
+ alt="Stamp Duty"
41
50
  />
42
- <span
43
- attrs="{'invisible': [('tax_stamp_line_present', '=', True)]}"
44
- >
45
- <span attrs="{'invisible': [('state', 'not in', 'draft')]}">
51
+ <span invisible="l10n_it_account_stamp_is_stamp_duty_present">
52
+ <span invisible="state != 'draft'">
46
53
  <button
47
54
  type="object"
48
55
  string="Charge stamp to customer"
49
- name="add_tax_stamp_line"
56
+ name="add_stamp_duty_line"
50
57
  />
51
58
  </span>
52
- <span attrs="{'invisible': [('state', '=', 'draft')]}">
59
+ <span invisible="state == 'draft'">
53
60
  Stamp can only be charged to customer when invoice is in draft state
54
61
  </span>
55
62
  </span>
56
- <span
57
- attrs="{'invisible': [('tax_stamp_line_present', '=', False)]}"
58
- >
63
+ <span invisible="not l10n_it_account_stamp_is_stamp_duty_present">
59
64
  Stamp charged to customer
60
65
  </span>
61
66
  </div>
@@ -66,9 +71,8 @@
66
71
  expr="//form/sheet/notebook/page[@id='invoice_tab']/field/form/sheet/group/field[@name='product_id']"
67
72
  position="after"
68
73
  >
69
- <field name="is_stamp_line" invisible="1" />
74
+ <field name="is_stamp_line" column_invisible="True" />
70
75
  </xpath>
71
76
  </field>
72
77
  </record>
73
-
74
78
  </odoo>
@@ -1,44 +1,19 @@
1
1
  <?xml version="1.0" encoding="utf-8" ?>
2
2
  <odoo>
3
-
4
3
  <record model="ir.ui.view" id="view_account_config_settings_stamp">
5
4
  <field name="name">view_account_config_settings_stamp</field>
6
5
  <field name="model">res.config.settings</field>
7
6
  <field name="inherit_id" ref="account.res_config_settings_view_form" />
8
7
  <field name="arch" type="xml">
9
- <div id="eu_service" position="after">
10
- <div
11
- class="col-12 col-lg-6 o_setting_box"
12
- title="Configuration for Tax stamp"
8
+ <block name="default_taxes_setting_container" position="inside">
9
+ <setting
10
+ id="l10n_it_account_stamp_stamp_product"
11
+ title="Configuration for stamp duty"
12
+ company_dependent="1"
13
13
  >
14
- <div class="o_setting_left_pane" />
15
- <div class="o_setting_right_pane">
16
- <span class="o_form_label">Configuration for Tax stamp
17
- </span>
18
- <span
19
- class="fa fa-lg fa-building-o"
20
- title="Values set here are company-specific."
21
- aria-label="Values set here are company-specific."
22
- groups="base.group_multi_company"
23
- role="img"
24
- />
25
- <div class="text-muted">
26
- Product used as Tax Stamp in customer invoices
27
- </div>
28
- <div class="content-group">
29
- <div class="row mt16">
30
- <label
31
- string="Tax Stamp Product"
32
- for="tax_stamp_product_id"
33
- class="col-lg-3 o_light_label"
34
- />
35
- <field name="tax_stamp_product_id" />
36
- </div>
37
- </div>
38
- </div>
39
- </div>
40
- </div>
14
+ <field name="l10n_it_account_stamp_stamp_duty_product_id" />
15
+ </setting>
16
+ </block>
41
17
  </field>
42
18
  </record>
43
-
44
19
  </odoo>
@@ -1,33 +1,32 @@
1
1
  <?xml version="1.0" encoding="utf-8" ?>
2
2
  <odoo>
3
-
4
3
  <record id="product_template_form_view_account_stamp" model="ir.ui.view">
5
4
  <field name="name">product.template.form.inherit</field>
6
5
  <field name="model">product.template</field>
7
6
  <field name="inherit_id" ref="account.product_template_form_view" />
8
7
  <field name="arch" type="xml">
9
-
10
8
  <xpath expr="//group[@name='payables']" position="after">
11
- <group string="Tax stamp">
12
- <field name="is_stamp" />
9
+ <group string="Stamp Duty">
10
+ <field name="l10n_it_account_stamp_is_stamp" />
13
11
  <field
14
- name="auto_compute"
15
- attrs="{'invisible': [('is_stamp', '=', False)]}"
12
+ name="l10n_it_account_stamp_auto_compute"
13
+ invisible="not l10n_it_account_stamp_is_stamp"
16
14
  />
17
15
  <p
18
- attrs="{'invisible': ['|',('auto_compute', '=', False), ('is_stamp', '=', False)]}"
16
+ invisible="(not l10n_it_account_stamp_auto_compute) or (not l10n_it_account_stamp_is_stamp)"
19
17
  colspan="2"
20
18
  >
21
19
  For each invoice, the base amount for each selected tax will be added up and used to determine
22
20
  the application of the account stamp.
23
21
  </p>
24
22
  <field
25
- name="stamp_apply_min_total_base"
26
- attrs="{'invisible': ['|',('auto_compute', '=', False), ('is_stamp', '=', False)], 'required': [('auto_compute', '=', True)]}"
23
+ name="l10n_it_account_stamp_tax_apply_min_total_base"
24
+ invisible="(not l10n_it_account_stamp_auto_compute) or (not l10n_it_account_stamp_is_stamp)"
25
+ required="l10n_it_account_stamp_auto_compute"
27
26
  />
28
27
  <field
29
- name="stamp_apply_tax_ids"
30
- attrs="{'invisible': ['|',('auto_compute', '=', False), ('is_stamp', '=', False)]}"
28
+ name="l10n_it_account_stamp_stamp_duty_apply_tax_ids"
29
+ invisible="(not l10n_it_account_stamp_auto_compute) or (not l10n_it_account_stamp_is_stamp)"
31
30
  widget="many2many_tags"
32
31
  />
33
32
  </group>
@@ -37,19 +36,16 @@
37
36
  expr="//field[@name='property_account_income_id']"
38
37
  position="attributes"
39
38
  >
40
- <attribute name="attrs">{'required': [('is_stamp', '=', True)]}
41
- </attribute>
39
+ <attribute name="required">l10n_it_account_stamp_is_stamp</attribute>
42
40
  </xpath>
43
41
 
44
42
  <xpath
45
43
  expr="//field[@name='property_account_expense_id']"
46
44
  position="attributes"
47
45
  >
48
- <attribute name="attrs">{'required': [('is_stamp', '=', True)]}
46
+ <attribute name="required">l10n_it_account_stamp_is_stamp
49
47
  </attribute>
50
48
  </xpath>
51
-
52
49
  </field>
53
50
  </record>
54
-
55
51
  </odoo>