From 4bd4fc54ebacf69a93579bf3d26934e25eedee3f Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Thu, 12 Sep 2024 11:26:50 +0200 Subject: [PATCH] [MIG] l10n_it_account_stamp: Migration to 18.0 Align with Odoo standard terminology Co-authored-by: Sergio Zanchetta --- l10n_it_account_stamp/README.rst | 41 ++- l10n_it_account_stamp/__manifest__.py | 2 +- l10n_it_account_stamp/data/data.xml | 12 +- l10n_it_account_stamp/i18n/it.po | 267 ++++++------------ .../i18n/l10n_it_account_stamp.pot | 164 +++++------ .../18.0.1.0.0/noupdate_changes.xml | 12 + .../migrations/18.0.1.0.0/post-migration.py | 14 + .../migrations/18.0.1.0.0/pre-migration.py | 77 +++++ l10n_it_account_stamp/models/account_move.py | 106 ++++--- l10n_it_account_stamp/models/company.py | 16 +- l10n_it_account_stamp/models/product.py | 33 ++- l10n_it_account_stamp/readme/CONFIGURE.md | 10 +- l10n_it_account_stamp/readme/DESCRIPTION.md | 2 +- l10n_it_account_stamp/readme/ROADMAP.md | 7 + l10n_it_account_stamp/readme/USAGE.md | 6 +- .../static/description/index.html | 54 ++-- .../tests/test_account_stamp_invoicing.py | 37 ++- .../views/account_move_report.xml | 14 +- .../views/account_move_view.xml | 48 ++-- l10n_it_account_stamp/views/company_view.xml | 41 +-- l10n_it_account_stamp/views/product_view.xml | 28 +- 21 files changed, 512 insertions(+), 479 deletions(-) create mode 100644 l10n_it_account_stamp/migrations/18.0.1.0.0/noupdate_changes.xml create mode 100644 l10n_it_account_stamp/migrations/18.0.1.0.0/post-migration.py create mode 100644 l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migration.py create mode 100644 l10n_it_account_stamp/readme/ROADMAP.md diff --git a/l10n_it_account_stamp/README.rst b/l10n_it_account_stamp/README.rst index 569f374f1da..faad5619699 100644 --- a/l10n_it_account_stamp/README.rst +++ b/l10n_it_account_stamp/README.rst @@ -17,13 +17,13 @@ ITA - Imposta di bollo :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_account_stamp + :target: https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_account_stamp :alt: OCA/l10n-italy .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_account_stamp + :target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_account_stamp :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -35,7 +35,7 @@ fatture e nelle ricevute. **English** -This module adds Italian Tax Stamp support in invoices and receipts. +This module adds Italian Stamp Duty support in invoices and receipts. **Table of contents** @@ -58,7 +58,7 @@ necessario abilitare le funzioni complete per la contabilità: Modalità automatica: - andare sul prodotto "Imposta di bollo 2 euro" e configurare "Imposte - marca da bollo" (Imposte in esenzione). + per bollo" (Imposte in esenzione). - per ciascuna fattura o ricevuta, l'applicabilità dell'imposta di bollo verrà calcolata in modo automatico in base alla somma degli imponibili relativi alle imposte selezionate. @@ -77,7 +77,7 @@ generalmente ricavo="Debiti per bolli" e costo="Valori bollati". **English** -In order to change Tax Stamp 2 euro product settings, enable full +In order to change 'Stamp duty 2 euro' product settings, enable full accounting features: 1. Settings -> Users & Companies -> Groups @@ -86,7 +86,7 @@ accounting features: Automatic mode: -- Go to 'Tax Stamp 2 euro' product and configure 'Stamp taxes' +- Go to 'Stamp duty 2 euro' product and configure 'Stamp taxes' (exemption taxes). - For each invoice or receipt, the base amount for each selected tax will be added up and used to determine the application of the account @@ -94,9 +94,9 @@ Automatic mode: Manual mode: -- Go to 'Tax Stamp 2 euro' product and deselect 'Auto-compute' +- Go to 'Stamp duty 2 euro' product and deselect 'Auto-compute' checkbox. -- For each invoice or receipt, manually enable 'Tax Stamp' checkbox. +- For each invoice or receipt, manually enable 'Stamp Duty' checkbox. Also set income/expense accounts, typically income = 'Debiti per bolli' and expense = 'Valori bollati'. @@ -115,19 +115,32 @@ verrà addebitata al cliente. **English** -In invoice or receipt form, when applicable, click 'Add tax stamp line' -button to add tax stamp as invoice line, thus charging customer. +In invoice or receipt form, when applicable, click 'Add stamp duty line' +button to add stamp duty as invoice line, thus charging customer. -Otherwise, tax stamp will be anyway accounted, without charging +Otherwise, stamp duty will be anyway accounted, without charging customer. +Known issues / Roadmap +====================== + +\*\* Italiano \*\* + +Sono stati aggiunti gli script di migrazione, da provare quando saranno +rilasciati quelli relativi ad ``account``. + +\*\* English \*\* + +Migration scripts have been added, to be tested when ``account`` related +ones will be released. + Bug Tracker =========== Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -169,6 +182,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/l10n-italy `_ project on GitHub. +This module is part of the `OCA/l10n-italy `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_it_account_stamp/__manifest__.py b/l10n_it_account_stamp/__manifest__.py index cb9f6772180..8a30e44b764 100644 --- a/l10n_it_account_stamp/__manifest__.py +++ b/l10n_it_account_stamp/__manifest__.py @@ -8,7 +8,7 @@ { "name": "ITA - Imposta di bollo", - "version": "16.0.1.1.0", + "version": "18.0.1.0.0", "category": "Localization/Italy", "summary": "Gestione automatica dell'imposta di bollo", "author": "Ermanno Gnan, Sergio Corato, Enrico Ganzaroli, " diff --git a/l10n_it_account_stamp/data/data.xml b/l10n_it_account_stamp/data/data.xml index e41f449416c..356ca4d064b 100644 --- a/l10n_it_account_stamp/data/data.xml +++ b/l10n_it_account_stamp/data/data.xml @@ -1,8 +1,7 @@ - - Tax Stamp 2 euro + Stamp duty 2 euro service @@ -11,18 +10,17 @@ >Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree June 17, 2014 - - - + + + - diff --git a/l10n_it_account_stamp/i18n/it.po b/l10n_it_account_stamp/i18n/it.po index 07234f28b68..f301f55cbc2 100644 --- a/l10n_it_account_stamp/i18n/it.po +++ b/l10n_it_account_stamp/i18n/it.po @@ -6,79 +6,54 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-24 15:03+0000\n" -"PO-Revision-Date: 2024-07-15 09:58+0000\n" -"Last-Translator: mymage \n" +"POT-Creation-Date: 2024-09-23 15:50+0000\n" +"PO-Revision-Date: 2024-09-23 18:01+0200\n" +"Last-Translator: Sergio Zanchetta \n" "Language-Team: \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.6.2\n" +"X-Generator: Poedit 3.0.1\n" #. module: l10n_it_account_stamp #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp msgid "" -"\n" -" Stamp can only be charged to customer when " -"invoice is in draft state\n" -" " -msgstr "" -"\n" -" Il bollo può essere addebitato al cliente solo " -"quando la fattura è nello stato bozza\n" -" " - -#. module: l10n_it_account_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp -msgid "" -"\n" -" " - -#. module: l10n_it_account_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.report_invoice_document_custom_fields_ext +#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp msgid "" -"Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 " -"del DPR 642/1972 e del DM 17/06/2014" +"\n" +" Stamp can only be charged to customer when " +"invoice is in draft state\n" +" " msgstr "" -"Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 " -"del DPR 642/1972 e del DM 17/06/2014" +"\n" +" Il bollo può essere addebitato al cliente solo " +"quando la fattura è nello stato bozza\n" +" " #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__manually_apply_tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__manually_apply_tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__manually_apply_tax_stamp -msgid "Apply tax stamp" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_manually_apply_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_manually_apply_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_manually_apply_stamp_duty +msgid "Apply stamp duty" msgstr "Applica imposta di bollo" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__auto_compute_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__auto_compute_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__auto_compute_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__auto_compute -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__auto_compute +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_auto_compute_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_auto_compute_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_auto_compute_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_auto_compute +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_auto_compute msgid "Auto-compute" msgstr "Calcolo automatico" @@ -99,7 +74,7 @@ msgstr "Impostazioni di configurazione" #. module: l10n_it_account_stamp #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp -msgid "Configuration for Tax stamp" +msgid "Configuration for stamp duty" msgstr "Configurazione imposta di bollo" #. module: l10n_it_account_stamp @@ -114,14 +89,23 @@ msgstr "" " all'interno di ciascuna fattura, per determinare " "l'applicabilità della marca da bollo." +#. module: l10n_it_account_stamp +#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.report_invoice_document_custom_fields_ext +msgid "" +"Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 del DPR " +"642/1972 e del DM 17/06/2014" +msgstr "" +"Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 del DPR " +"642/1972 e del DM 17/06/2014" + #. module: l10n_it_account_stamp #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move_line__is_stamp_line msgid "Is Stamp Line" msgstr "È una riga di bollo" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__is_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__is_stamp +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_is_stamp +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_is_stamp msgid "Is a stamp" msgstr "È un bollo" @@ -138,15 +122,13 @@ msgstr "Movimento contabile" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format msgid "Missing account income configuration for %s" msgstr "Configurazione mancante del conto di ricavo per %s" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Missing tax stamp product in company settings!" +msgid "Missing stamp duty product in company settings!" msgstr "Prodotto imposta di bollo mancante nelle impostazioni dell'azienda!" #. module: l10n_it_account_stamp @@ -157,165 +139,100 @@ msgstr "Prodotto" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format msgid "Product %s must have income and expense accounts" msgstr "È necessario impostare i conti di ricavo e di costo per il prodotto %s" #. module: l10n_it_account_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp -msgid "Product used as Tax Stamp in customer invoices" -msgstr "Prodotto usato come imposta di bollo nelle fatture cliente" - -#. module: l10n_it_account_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_company__tax_stamp_product_id -#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_config_settings__tax_stamp_product_id -msgid "Product used as Tax Stamp in customer invoices." +#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id +#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id +msgid "Product used as stamp duty in customer invoices." msgstr "Prodotto usato come imposta di bollo nelle fatture cliente." #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__stamp_apply_min_total_base -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__stamp_apply_min_total_base -msgid "Stamp applicability min total base" -msgstr "Totale imponibile minimo per applicabilità bollo" - -#. module: l10n_it_account_stamp -#: model:product.template,description_sale:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template -msgid "" -"Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree " -"June\n" -" 17, 2014\n" -" " -msgstr "" -"Assolvimento dell’imposta di bollo ai sensi dell’articolo 6, comma 2, del D." -"M.\n" -" 17 giugno 2014\n" -" " - -#. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp_line_present -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__tax_stamp_line_present -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__tax_stamp_line_present -msgid "Stamp line is present in invoice" -msgstr "La riga bollo è presente in fattura" - -#. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__stamp_apply_tax_ids -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__stamp_apply_tax_ids -msgid "Stamp taxes" -msgstr "Imposte di bollo" - -#. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__tax_stamp -msgid "Tax Stamp" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_is_stamp_duty_applied +#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp +#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.product_template_form_view_account_stamp +msgid "Stamp Duty" msgstr "Imposta di bollo" -#. module: l10n_it_account_stamp -#: model:product.template,name:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template -msgid "Tax Stamp 2 euro" -msgstr "Imposta di bollo 2 euro" - #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax Stamp Expense" +msgid "Stamp Duty Expense" msgstr "Costo imposta di bollo" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax Stamp Income" +msgid "Stamp Duty Income" msgstr "Ricavo imposta di bollo" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_company__tax_stamp_product_id -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_config_settings__tax_stamp_product_id -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp -msgid "Tax Stamp Product" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id +msgid "Stamp Duty Product" msgstr "Prodotto imposta di bollo" #. module: l10n_it_account_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.product_template_form_view_account_stamp -msgid "Tax stamp" -msgstr "Imposta di bollo" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_tax_apply_min_total_base +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_tax_apply_min_total_base +msgid "Stamp applicability min total base" +msgstr "Totale imponibile minimo per applicabilità bollo" #. module: l10n_it_account_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_move__tax_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_payment__tax_stamp -msgid "Tax stamp is applied to this invoice." +#: model:product.template,name:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template +msgid "Stamp duty 2 euro" +msgstr "Imposta di bollo 2 euro" + +#. module: l10n_it_account_stamp +#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_is_stamp_duty_applied +msgid "Stamp duty is applied to this invoice." msgstr "L'imposta di bollo è applicata a questa fattura." #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax stamp is not applicable" +msgid "Stamp duty is not applicable" msgstr "Imposta di bollo non applicabile" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax stamp line %s already present. Remove it first." +msgid "Stamp duty line %s already present. Remove it first." msgstr "Riga per l'imposta di bollo %s già presente, prima rimuoverla." +#. module: l10n_it_account_stamp +#: model:product.template,description_sale:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template +msgid "" +"Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree " +"June\n" +" 17, 2014\n" +" " +msgstr "" +"Assolvimento dell’imposta di bollo ai sensi dell’articolo 6, comma 2, del D." +"M.\n" +" 17 giugno 2014\n" +" " + +#. module: l10n_it_account_stamp +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_present +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_present +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_is_stamp_duty_present +msgid "Stamp line is present in invoice" +msgstr "La riga bollo è presente in fattura" + +#. module: l10n_it_account_stamp +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_stamp_duty_apply_tax_ids +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_stamp_duty_apply_tax_ids +msgid "Stamp taxes" +msgstr "Imposte di bollo" + #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/product.py:0 -#, python-format msgid "The product %s must be a stamp to apply set taxes!" msgstr "Il prodotto %s deve essere un bollo per applicare le imposte definite!" - -#~ msgid "Add tax stamp line" -#~ msgstr "Aggiungi riga imposta di bollo" - -#~ msgid "" -#~ "Configuration for Tax stamp\n" -#~ " " -#~ msgstr "" -#~ "Configurazione per l'imposta di bollo\n" -#~ " " - -#~ msgid "" -#~ "For each invoice, the base amount for each selected tax will be added up " -#~ "and used to determine the application of the account stamp." -#~ msgstr "" -#~ "Per ciascuna fattura, l'applicabilità dell'imposta di bollo verrà " -#~ "calcolata in modo automatico in base alla somma degli imponibili relativi " -#~ "alle imposte selezionate." - -#~ msgid "Invoice" -#~ msgstr "Fattura" - -#~ msgid "Invoice Line" -#~ msgstr "Riga fattura" - -#~ msgid "Product Template" -#~ msgstr "Modello prodotto" - -#~ msgid "" -#~ "Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree " -#~ "June\n" -#~ "17, 2014" -#~ msgstr "" -#~ "Assolvimento dell’imposta di bollo ai sensi dell’articolo 6, comma 2, del " -#~ "D.M.\n" -#~ "17 giugno 2014" - -#~ msgid "Unit(s)" -#~ msgstr "Unità" - -#~ msgid "kg" -#~ msgstr "kg" diff --git a/l10n_it_account_stamp/i18n/l10n_it_account_stamp.pot b/l10n_it_account_stamp/i18n/l10n_it_account_stamp.pot index 1a52e9ef20e..9368df2a7c6 100644 --- a/l10n_it_account_stamp/i18n/l10n_it_account_stamp.pot +++ b/l10n_it_account_stamp/i18n/l10n_it_account_stamp.pot @@ -4,8 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 17.5alpha1\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-23 15:50+0000\n" +"PO-Revision-Date: 2024-09-23 15:50+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,47 +18,32 @@ msgstr "" #. module: l10n_it_account_stamp #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp msgid "" -"\n" -" Stamp can only be charged to customer when invoice is in draft state\n" -" " -msgstr "" - -#. module: l10n_it_account_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp -msgid "" -"" +"\n" +" Stamp can only be charged to customer when invoice is in draft state\n" +" " msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__manually_apply_tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__manually_apply_tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__manually_apply_tax_stamp -msgid "Apply tax stamp" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_manually_apply_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_manually_apply_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_manually_apply_stamp_duty +msgid "Apply stamp duty" msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__auto_compute_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__auto_compute_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__auto_compute_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__auto_compute -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__auto_compute +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_auto_compute_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_auto_compute_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_auto_compute_stamp_duty +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_auto_compute +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_auto_compute msgid "Auto-compute" msgstr "" @@ -77,7 +64,7 @@ msgstr "" #. module: l10n_it_account_stamp #: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp -msgid "Configuration for Tax stamp" +msgid "Configuration for stamp duty" msgstr "" #. module: l10n_it_account_stamp @@ -87,14 +74,21 @@ msgid "" " the application of the account stamp." msgstr "" +#. module: l10n_it_account_stamp +#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.report_invoice_document_custom_fields_ext +msgid "" +"Imposta di bollo assolta in modo virtuale ai sensi dell'articolo 15 del DPR " +"642/1972 e del DM 17/06/2014" +msgstr "" + #. module: l10n_it_account_stamp #: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move_line__is_stamp_line msgid "Is Stamp Line" msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__is_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__is_stamp +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_is_stamp +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_is_stamp msgid "Is a stamp" msgstr "" @@ -111,17 +105,13 @@ msgstr "" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format msgid "Missing account income configuration for %s" msgstr "" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Missing tax stamp product in company settings!" +msgid "Missing stamp duty product in company settings!" msgstr "" #. module: l10n_it_account_stamp @@ -132,111 +122,95 @@ msgstr "" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format msgid "Product %s must have income and expense accounts" msgstr "" #. module: l10n_it_account_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp -msgid "Product used as Tax Stamp in customer invoices" +#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id +#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id +msgid "Product used as stamp duty in customer invoices." msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_company__tax_stamp_product_id -#: model:ir.model.fields,help:l10n_it_account_stamp.field_res_config_settings__tax_stamp_product_id -msgid "Product used as Tax Stamp in customer invoices." +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_is_stamp_duty_applied +#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp +#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.product_template_form_view_account_stamp +msgid "Stamp Duty" msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__stamp_apply_min_total_base -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__stamp_apply_min_total_base -msgid "Stamp applicability min total base" +#. odoo-python +#: code:addons/l10n_it_account_stamp/models/account_move.py:0 +msgid "Stamp Duty Expense" msgstr "" #. module: l10n_it_account_stamp -#: model:product.template,description_sale:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template -msgid "" -"Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree June\n" -" 17, 2014\n" -" " +#. odoo-python +#: code:addons/l10n_it_account_stamp/models/account_move.py:0 +msgid "Stamp Duty Income" msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp_line_present -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__tax_stamp_line_present -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__tax_stamp_line_present -msgid "Stamp line is present in invoice" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_company__l10n_it_account_stamp_stamp_duty_product_id +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_config_settings__l10n_it_account_stamp_stamp_duty_product_id +msgid "Stamp Duty Product" msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__stamp_apply_tax_ids -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__stamp_apply_tax_ids -msgid "Stamp taxes" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_tax_apply_min_total_base +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_tax_apply_min_total_base +msgid "Stamp applicability min total base" msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__tax_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__tax_stamp -msgid "Tax Stamp" +#: model:product.template,name:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template +msgid "Stamp duty 2 euro" msgstr "" #. module: l10n_it_account_stamp -#: model:product.template,name:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template -msgid "Tax Stamp 2 euro" +#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_applied +#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_is_stamp_duty_applied +msgid "Stamp duty is applied to this invoice." msgstr "" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax Stamp Expense" +msgid "Stamp duty is not applicable" msgstr "" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax Stamp Income" -msgstr "" - -#. module: l10n_it_account_stamp -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_company__tax_stamp_product_id -#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_res_config_settings__tax_stamp_product_id -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.view_account_config_settings_stamp -msgid "Tax Stamp Product" -msgstr "" - -#. module: l10n_it_account_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.account_move_form_stamp -#: model_terms:ir.ui.view,arch_db:l10n_it_account_stamp.product_template_form_view_account_stamp -msgid "Tax stamp" +msgid "Stamp duty line %s already present. Remove it first." msgstr "" #. module: l10n_it_account_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_bank_statement_line__tax_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_move__tax_stamp -#: model:ir.model.fields,help:l10n_it_account_stamp.field_account_payment__tax_stamp -msgid "Tax stamp is applied to this invoice." +#: model:product.template,description_sale:l10n_it_account_stamp.l10n_it_account_stamp_2_euro_product_template +msgid "" +"Stamp duty payment under the terms of Art. 6, Subsection 2 of MEF Decree June\n" +" 17, 2014\n" +" " msgstr "" #. module: l10n_it_account_stamp -#. odoo-python -#: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax stamp is not applicable" +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_bank_statement_line__l10n_it_account_stamp_is_stamp_duty_present +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_move__l10n_it_account_stamp_is_stamp_duty_present +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_account_payment__l10n_it_account_stamp_is_stamp_duty_present +msgid "Stamp line is present in invoice" msgstr "" #. module: l10n_it_account_stamp -#. odoo-python -#: code:addons/l10n_it_account_stamp/models/account_move.py:0 -#, python-format -msgid "Tax stamp line %s already present. Remove it first." +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_product__l10n_it_account_stamp_stamp_duty_apply_tax_ids +#: model:ir.model.fields,field_description:l10n_it_account_stamp.field_product_template__l10n_it_account_stamp_stamp_duty_apply_tax_ids +msgid "Stamp taxes" msgstr "" #. module: l10n_it_account_stamp #. odoo-python #: code:addons/l10n_it_account_stamp/models/product.py:0 -#, python-format msgid "The product %s must be a stamp to apply set taxes!" msgstr "" diff --git a/l10n_it_account_stamp/migrations/18.0.1.0.0/noupdate_changes.xml b/l10n_it_account_stamp/migrations/18.0.1.0.0/noupdate_changes.xml new file mode 100644 index 00000000000..23947d9e03b --- /dev/null +++ b/l10n_it_account_stamp/migrations/18.0.1.0.0/noupdate_changes.xml @@ -0,0 +1,12 @@ + + + + Stamp duty 2 euro + + + + + diff --git a/l10n_it_account_stamp/migrations/18.0.1.0.0/post-migration.py b/l10n_it_account_stamp/migrations/18.0.1.0.0/post-migration.py new file mode 100644 index 00000000000..20fedb546fe --- /dev/null +++ b/l10n_it_account_stamp/migrations/18.0.1.0.0/post-migration.py @@ -0,0 +1,14 @@ +# Copyright 2024 Sergio Zanchetta +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data( + env.cr, "l10n_it_account_stamp", "18.0.1.0.0/noupdate_changes.xml" + ) + openupgrade.delete_record_translations( + env.cr, "l10n_it_account_stamp", ["l10n_it_account_stamp_2_euro"] + ) diff --git a/l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migration.py b/l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migration.py new file mode 100644 index 00000000000..4527fae26e9 --- /dev/null +++ b/l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migration.py @@ -0,0 +1,77 @@ +# Copyright 2024 Sergio Zanchetta +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +def _rename_fields(env): + openupgrade.rename_fields( + env, + [ + ( + "account.move", + "account_move", + "tax_stamp", + "l10n_it_account_stamp_is_stamp_duty_applied", + ), + ( + "account.move", + "account_move", + "tax_stamp_line_present", + "l10n_it_account_stamp_is_stamp_duty_present", + ), + ( + "account.move", + "account_move", + "auto_compute_stamp", + "l10n_it_account_stamp_auto_compute_stamp_duty", + ), + ( + "account.move", + "account_move", + "manually_apply_tax_stamp", + "l10n_it_account_stamp_manually_apply_stamp_duty", + ), + ( + "res.company", + "res_company", + "tax_stamp_product_id", + "l10n_it_account_stamp_stamp_duty_product_id", + ), + ( + "res.config.settings", + "res_config_settings", + "tax_stamp_product_id", + "l10n_it_account_stamp_stamp_duty_product_id", + ), + ( + "product.template", + "product_template", + "stamp_apply_tax_ids", + "l10n_it_account_stamp_stamp_duty_apply_tax_ids", + ), + ( + "product.template", + "product_template", + "stamp_apply_min_total_base", + "l10n_it_account_stamp_tax_apply_min_total_base", + ), + ( + "product.template", + "product_template", + "is_stamp", + "l10n_it_account_stamp_is_stamp", + ), + ( + "product.template", + "product_template", + "auto_compute", + "l10n_it_account_stamp_auto_compute", + ), + ], + ) + + +@openupgrade.migrate() +def migrate(env, version): + _rename_fields(env) diff --git a/l10n_it_account_stamp/models/account_move.py b/l10n_it_account_stamp/models/account_move.py index 68e8f8ffd29..eb2180ab52c 100644 --- a/l10n_it_account_stamp/models/account_move.py +++ b/l10n_it_account_stamp/models/account_move.py @@ -8,38 +8,46 @@ class AccountMove(models.Model): _inherit = "account.move" - tax_stamp = fields.Boolean( - help="Tax stamp is applied to this invoice.", + l10n_it_account_stamp_is_stamp_duty_applied = fields.Boolean( + string="Stamp Duty", + help="Stamp duty is applied to this invoice.", readonly=False, - compute="_compute_tax_stamp", + compute="_compute_l10n_it_account_stamp_is_stamp_duty_applied", store=True, ) - tax_stamp_line_present = fields.Boolean( + l10n_it_account_stamp_is_stamp_duty_present = fields.Boolean( string="Stamp line is present in invoice", - compute="_compute_tax_stamp_line_present", + compute="_compute_l10n_it_account_stamp_is_stamp_duty_present", ) - auto_compute_stamp = fields.Boolean( - related="company_id.tax_stamp_product_id.auto_compute" + l10n_it_account_stamp_auto_compute_stamp_duty = fields.Boolean( + related="company_id.l10n_it_account_stamp_stamp_duty_product_id.l10n_it_account_stamp_auto_compute", + ) + l10n_it_account_stamp_manually_apply_stamp_duty = fields.Boolean( + string="Apply stamp duty", ) - manually_apply_tax_stamp = fields.Boolean("Apply tax stamp") - def is_tax_stamp_applicable(self): + def is_stamp_duty_applicable(self): stamp_product_id = self.company_id.with_context( lang=self.partner_id.lang - ).tax_stamp_product_id + ).l10n_it_account_stamp_stamp_duty_product_id if not stamp_product_id: - raise UserError(_("Missing tax stamp product in company settings!")) + raise UserError(_("Missing stamp duty product in company settings!")) total_tax_base = sum( ( inv_tax.price_subtotal for inv_tax in self.line_ids.filtered( lambda line: set(line.tax_ids.ids) - & set(stamp_product_id.stamp_apply_tax_ids.ids) + & set( + stamp_product_id.l10n_it_account_stamp_stamp_duty_apply_tax_ids.ids + ) ) ), 0.0, ) - return total_tax_base >= stamp_product_id.stamp_apply_min_total_base + return ( + total_tax_base + >= stamp_product_id.l10n_it_account_stamp_tax_apply_min_total_base + ) @api.depends( "invoice_line_ids.price_subtotal", @@ -48,31 +56,33 @@ def is_tax_stamp_applicable(self): "company_id", "invoice_date", "move_type", - "manually_apply_tax_stamp", + "l10n_it_account_stamp_manually_apply_stamp_duty", "invoice_line_ids.tax_ids", ) - def _compute_tax_stamp(self): + def _compute_l10n_it_account_stamp_is_stamp_duty_applied(self): for invoice in self: - invoice.tax_stamp = False - if invoice.auto_compute_stamp: - invoice.tax_stamp = invoice.is_tax_stamp_applicable() + invoice.l10n_it_account_stamp_is_stamp_duty_applied = False + if invoice.l10n_it_account_stamp_auto_compute_stamp_duty: + invoice.l10n_it_account_stamp_is_stamp_duty_applied = ( + invoice.is_stamp_duty_applicable() + ) else: - if invoice.manually_apply_tax_stamp: - invoice.tax_stamp = True + if invoice.l10n_it_account_stamp_manually_apply_stamp_duty: + invoice.l10n_it_account_stamp_is_stamp_duty_applied = True - def add_tax_stamp_line(self): + def add_stamp_duty_line(self): for inv in self: - if not inv.tax_stamp: - raise UserError(_("Tax stamp is not applicable")) + if not inv.l10n_it_account_stamp_is_stamp_duty_applied: + raise UserError(_("Stamp duty is not applicable")) stamp_product_id = inv.company_id.with_context( lang=inv.partner_id.lang - ).tax_stamp_product_id + ).l10n_it_account_stamp_stamp_duty_product_id if not stamp_product_id: - raise UserError(_("Missing tax stamp product in company settings!")) + raise UserError(_("Missing stamp duty product in company settings!")) for line in inv.invoice_line_ids: - if line.product_id and line.product_id.is_stamp: + if line.product_id and line.product_id.l10n_it_account_stamp_is_stamp: raise UserError( - _("Tax stamp line %s already present. Remove it first.") + _("Stamp duty line %s already present. Remove it first.") % line.name ) stamp_account = stamp_product_id.property_account_income_id @@ -96,7 +106,7 @@ def add_tax_stamp_line(self): } inv.write({"invoice_line_ids": [(0, 0, invoice_line_vals)]}) - def is_tax_stamp_line_present(self): + def is_stamp_duty_line_present(self): self.ensure_one() for line in self.line_ids: if line.is_stamp_line: @@ -106,21 +116,23 @@ def is_tax_stamp_line_present(self): @api.depends( "invoice_line_ids", "invoice_line_ids.product_id", - "invoice_line_ids.product_id.is_stamp", + "invoice_line_ids.product_id.l10n_it_account_stamp_is_stamp", ) - def _compute_tax_stamp_line_present(self): + def _compute_l10n_it_account_stamp_is_stamp_duty_present(self): for invoice in self: - invoice.tax_stamp_line_present = invoice.is_tax_stamp_line_present() + invoice.l10n_it_account_stamp_is_stamp_duty_present = ( + invoice.is_stamp_duty_line_present() + ) - def is_tax_stamp_product_present(self): + def is_stamp_duty_product_present(self): product_stamp = self.invoice_line_ids.filtered( - lambda line: line.product_id.is_stamp + lambda line: line.product_id.l10n_it_account_stamp_is_stamp ) if product_stamp: return True return False - def _build_tax_stamp_lines(self, product): + def _build_stamp_duty_lines(self, product): if ( not product.property_account_income_id or not product.property_account_expense_id @@ -130,7 +142,7 @@ def _build_tax_stamp_lines(self, product): ) income_vals = { - "name": _("Tax Stamp Income"), + "name": _("Stamp Duty Income"), "is_stamp_line": True, "partner_id": self.partner_id.id, "account_id": product.property_account_income_id.id, @@ -146,7 +158,7 @@ def _build_tax_stamp_lines(self, product): income_vals["credit"] = 0 expense_vals = { - "name": _("Tax Stamp Expense"), + "name": _("Stamp Duty Expense"), "is_stamp_line": True, "partner_id": self.partner_id.id, "account_id": product.property_account_expense_id.id, @@ -168,9 +180,9 @@ def _post(self, soft=True): for inv in self: posted = False if ( - inv.tax_stamp - and not inv.is_tax_stamp_line_present() - and not inv.is_tax_stamp_product_present() + inv.l10n_it_account_stamp_is_stamp_duty_applied + and not inv.is_stamp_duty_line_present() + and not inv.is_stamp_duty_product_present() ): if inv.state == "posted": posted = True @@ -178,10 +190,14 @@ def _post(self, soft=True): line_model = self.env["account.move.line"] stamp_product_id = inv.company_id.with_context( lang=inv.partner_id.lang - ).tax_stamp_product_id + ).l10n_it_account_stamp_stamp_duty_product_id if not stamp_product_id: - raise UserError(_("Missing tax stamp product in company settings!")) - income_vals, expense_vals = inv._build_tax_stamp_lines(stamp_product_id) + raise UserError( + _("Missing stamp duty product in company settings!") + ) + income_vals, expense_vals = inv._build_stamp_duty_lines( + stamp_product_id + ) income_vals["move_id"] = inv.id expense_vals["move_id"] = inv.id line_model.with_context(check_move_validity=False).create(income_vals) @@ -193,10 +209,10 @@ def _post(self, soft=True): def button_draft(self): res = super().button_draft() for account_move in self: - move_line_tax_stamp_ids = account_move.line_ids.filtered( + move_line_stamp_duty_ids = account_move.line_ids.filtered( lambda line: line.is_stamp_line ) - move_line_tax_stamp_ids.unlink() + move_line_stamp_duty_ids.unlink() return res @@ -205,4 +221,4 @@ class AccountInvoiceLine(models.Model): is_stamp_line = fields.Boolean( readonly=True - ) # used only with automatic tax stamp active + ) # used only with automatic stamp duty active diff --git a/l10n_it_account_stamp/models/company.py b/l10n_it_account_stamp/models/company.py index e1ed6d39209..185504fcf38 100644 --- a/l10n_it_account_stamp/models/company.py +++ b/l10n_it_account_stamp/models/company.py @@ -6,19 +6,19 @@ class ResCompany(models.Model): _inherit = "res.company" - tax_stamp_product_id = fields.Many2one( - "product.product", - "Tax Stamp Product", - help="Product used as Tax Stamp in customer invoices.", + l10n_it_account_stamp_stamp_duty_product_id = fields.Many2one( + comodel_name="product.product", + string="Stamp Duty Product", + help="Product used as stamp duty in customer invoices.", ) class AccountConfigSettings(models.TransientModel): _inherit = "res.config.settings" - tax_stamp_product_id = fields.Many2one( - related="company_id.tax_stamp_product_id", - string="Tax Stamp Product", - help="Product used as Tax Stamp in customer invoices.", + l10n_it_account_stamp_stamp_duty_product_id = fields.Many2one( + related="company_id.l10n_it_account_stamp_stamp_duty_product_id", + string="Stamp Duty Product", + help="Product used as stamp duty in customer invoices.", readonly=False, ) diff --git a/l10n_it_account_stamp/models/product.py b/l10n_it_account_stamp/models/product.py index a7c7c18bbbf..0dd2f7d6604 100644 --- a/l10n_it_account_stamp/models/product.py +++ b/l10n_it_account_stamp/models/product.py @@ -6,24 +6,35 @@ class ProductTemplate(models.Model): _inherit = "product.template" - @api.constrains("stamp_apply_tax_ids", "is_stamp") + @api.constrains( + "l10n_it_account_stamp_stamp_duty_apply_tax_ids", + "l10n_it_account_stamp_is_stamp", + ) def _check_stamp_apply_tax(self): for template in self: - if template.stamp_apply_tax_ids and not template.is_stamp: + if ( + template.l10n_it_account_stamp_stamp_duty_apply_tax_ids + and not template.l10n_it_account_stamp_is_stamp + ): raise exceptions.ValidationError( _("The product %s must be a stamp to apply set taxes!") % template.name ) - stamp_apply_tax_ids = fields.Many2many( - "account.tax", - "product_tax_account_tax__rel", - "product_id", - "tax_id", + l10n_it_account_stamp_stamp_duty_apply_tax_ids = fields.Many2many( + comodel_name="account.tax", + relation="l10n_it_account_stamp_product_tax_account_tax_rel", + column1="product_id", + column2="tax_id", string="Stamp taxes", ) - stamp_apply_min_total_base = fields.Float( - "Stamp applicability min total base", digits="Account" + l10n_it_account_stamp_tax_apply_min_total_base = fields.Float( + string="Stamp applicability min total base", + digits="Account", + ) + l10n_it_account_stamp_is_stamp = fields.Boolean( + string="Is a stamp", + ) + l10n_it_account_stamp_auto_compute = fields.Boolean( + string="Auto-compute", ) - is_stamp = fields.Boolean("Is a stamp") - auto_compute = fields.Boolean("Auto-compute") diff --git a/l10n_it_account_stamp/readme/CONFIGURE.md b/l10n_it_account_stamp/readme/CONFIGURE.md index 74c61e80e73..c55f64b35ba 100644 --- a/l10n_it_account_stamp/readme/CONFIGURE.md +++ b/l10n_it_account_stamp/readme/CONFIGURE.md @@ -11,7 +11,7 @@ necessario abilitare le funzioni complete per la contabilità: Modalità automatica: - andare sul prodotto "Imposta di bollo 2 euro" e configurare "Imposte - marca da bollo" (Imposte in esenzione). + per bollo" (Imposte in esenzione). - per ciascuna fattura o ricevuta, l'applicabilità dell'imposta di bollo verrà calcolata in modo automatico in base alla somma degli imponibili relativi alle imposte selezionate. @@ -30,7 +30,7 @@ generalmente ricavo="Debiti per bolli" e costo="Valori bollati". **English** -In order to change Tax Stamp 2 euro product settings, enable full +In order to change 'Stamp duty 2 euro' product settings, enable full accounting features: 1. Settings -\> Users & Companies -\> Groups @@ -39,7 +39,7 @@ accounting features: Automatic mode: -- Go to 'Tax Stamp 2 euro' product and configure 'Stamp taxes' +- Go to 'Stamp duty 2 euro' product and configure 'Stamp taxes' (exemption taxes). - For each invoice or receipt, the base amount for each selected tax will be added up and used to determine the application of the account @@ -47,8 +47,8 @@ Automatic mode: Manual mode: -- Go to 'Tax Stamp 2 euro' product and deselect 'Auto-compute' checkbox. -- For each invoice or receipt, manually enable 'Tax Stamp' checkbox. +- Go to 'Stamp duty 2 euro' product and deselect 'Auto-compute' checkbox. +- For each invoice or receipt, manually enable 'Stamp Duty' checkbox. Also set income/expense accounts, typically income = 'Debiti per bolli' and expense = 'Valori bollati'. diff --git a/l10n_it_account_stamp/readme/DESCRIPTION.md b/l10n_it_account_stamp/readme/DESCRIPTION.md index 8b5e7282bf2..734f1adf130 100644 --- a/l10n_it_account_stamp/readme/DESCRIPTION.md +++ b/l10n_it_account_stamp/readme/DESCRIPTION.md @@ -5,4 +5,4 @@ fatture e nelle ricevute. **English** -This module adds Italian Tax Stamp support in invoices and receipts. +This module adds Italian Stamp Duty support in invoices and receipts. diff --git a/l10n_it_account_stamp/readme/ROADMAP.md b/l10n_it_account_stamp/readme/ROADMAP.md new file mode 100644 index 00000000000..3ad4781293f --- /dev/null +++ b/l10n_it_account_stamp/readme/ROADMAP.md @@ -0,0 +1,7 @@ +** Italiano ** + +Sono stati aggiunti gli script di migrazione, da provare quando saranno rilasciati quelli relativi ad `account`. + +** English ** + +Migration scripts have been added, to be tested when `account` related ones will be released. diff --git a/l10n_it_account_stamp/readme/USAGE.md b/l10n_it_account_stamp/readme/USAGE.md index fe211a4df00..eb07ffa1e0e 100644 --- a/l10n_it_account_stamp/readme/USAGE.md +++ b/l10n_it_account_stamp/readme/USAGE.md @@ -9,8 +9,8 @@ verrà addebitata al cliente. **English** -In invoice or receipt form, when applicable, click 'Add tax stamp line' -button to add tax stamp as invoice line, thus charging customer. +In invoice or receipt form, when applicable, click 'Add stamp duty line' +button to add stamp duty as invoice line, thus charging customer. -Otherwise, tax stamp will be anyway accounted, without charging +Otherwise, stamp duty will be anyway accounted, without charging customer. diff --git a/l10n_it_account_stamp/static/description/index.html b/l10n_it_account_stamp/static/description/index.html index 45061639b6f..a4e50989d8a 100644 --- a/l10n_it_account_stamp/static/description/index.html +++ b/l10n_it_account_stamp/static/description/index.html @@ -369,22 +369,23 @@

ITA - Imposta di bollo

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:a81fbb48d1af1704b5039d1b6239009736a6f4983e7441b65359d85f54064061 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: LGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runboat

+

Beta License: LGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runboat

Italiano

Questo modulo aggiunge il supporto all’imposta di bollo italiana nelle fatture e nelle ricevute.

English

-

This module adds Italian Tax Stamp support in invoices and receipts.

+

This module adds Italian Stamp Duty support in invoices and receipts.

Table of contents

  • Configuration
  • Usage
  • -
  • Bug Tracker
  • -
  • Credits @@ -403,7 +404,7 @@

    Configuration

    Modalità automatica:

    • andare sul prodotto “Imposta di bollo 2 euro” e configurare “Imposte -marca da bollo” (Imposte in esenzione).
    • +per bollo” (Imposte in esenzione).
    • per ciascuna fattura o ricevuta, l’applicabilità dell’imposta di bollo verrà calcolata in modo automatico in base alla somma degli imponibili relativi alle imposte selezionate.
    • @@ -420,7 +421,7 @@

      Configuration

      Impostare i conti di ricavo/costo nella scheda “Contabilità”, generalmente ricavo=”Debiti per bolli” e costo=”Valori bollati”.

      English

      -

      In order to change Tax Stamp 2 euro product settings, enable full +

      In order to change ‘Stamp duty 2 euro’ product settings, enable full accounting features:

      1. Settings -> Users & Companies -> Groups
      2. @@ -429,7 +430,7 @@

        Configuration

      Automatic mode:

        -
      • Go to ‘Tax Stamp 2 euro’ product and configure ‘Stamp taxes’ +
      • Go to ‘Stamp duty 2 euro’ product and configure ‘Stamp taxes’ (exemption taxes).
      • For each invoice or receipt, the base amount for each selected tax will be added up and used to determine the application of the account @@ -437,9 +438,9 @@

        Configuration

      Manual mode:

        -
      • Go to ‘Tax Stamp 2 euro’ product and deselect ‘Auto-compute’ +
      • Go to ‘Stamp duty 2 euro’ product and deselect ‘Auto-compute’ checkbox.
      • -
      • For each invoice or receipt, manually enable ‘Tax Stamp’ checkbox.
      • +
      • For each invoice or receipt, manually enable ‘Stamp Duty’ checkbox.

      Also set income/expense accounts, typically income = ‘Debiti per bolli’ and expense = ‘Valori bollati’.

      @@ -453,23 +454,32 @@

      Usage

      In caso contrario, l’imposta di bollo verrà comunque considerata ma non verrà addebitata al cliente.

      English

      -

      In invoice or receipt form, when applicable, click ‘Add tax stamp line’ -button to add tax stamp as invoice line, thus charging customer.

      -

      Otherwise, tax stamp will be anyway accounted, without charging +

      In invoice or receipt form, when applicable, click ‘Add stamp duty line’ +button to add stamp duty as invoice line, thus charging customer.

      +

      Otherwise, stamp duty will be anyway accounted, without charging customer.

+
+

Known issues / Roadmap

+

** Italiano **

+

Sono stati aggiunti gli script di migrazione, da provare quando saranno +rilasciati quelli relativi ad account.

+

** English **

+

Migration scripts have been added, to be tested when account related +ones will be released.

+
-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Ermanno Gnan
  • Sergio Corato
  • @@ -477,7 +487,7 @@

    Authors

-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -502,7 +512,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/l10n-italy project on GitHub.

+

This module is part of the OCA/l10n-italy project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/l10n_it_account_stamp/tests/test_account_stamp_invoicing.py b/l10n_it_account_stamp/tests/test_account_stamp_invoicing.py index 3dceb6e8973..a50544bcb75 100644 --- a/l10n_it_account_stamp/tests/test_account_stamp_invoicing.py +++ b/l10n_it_account_stamp/tests/test_account_stamp_invoicing.py @@ -18,7 +18,7 @@ def setUp(self): account_revenue_id = self.env["account.account"].search( [ - ("company_id", "=", self.env.company.id), + ("company_ids", "child_of", self.env.company.id), ( "account_type", "=", @@ -29,7 +29,7 @@ def setUp(self): ) account_expense_id = self.env["account.account"].search( [ - ("company_id", "=", self.env.company.id), + ("company_ids", "child_of", self.env.company.id), ( "account_type", "=", @@ -40,12 +40,14 @@ def setUp(self): ) stamp_product_id.write( { - "stamp_apply_tax_ids": [(6, 0, [self.tax_id.id])], + "l10n_it_account_stamp_stamp_duty_apply_tax_ids": [ + (6, 0, [self.tax_id.id]) + ], "property_account_income_id": account_revenue_id.id, "property_account_expense_id": account_expense_id.id, } ) - self.env.company.tax_stamp_product_id = stamp_product_id + self.env.company.l10n_it_account_stamp_stamp_duty_product_id = stamp_product_id def test_post_invoicing(self): invoice = first( @@ -59,7 +61,7 @@ def test_post_invoicing(self): self.assertEqual( len(invoice.line_ids.filtered(lambda line: line.is_stamp_line)), 0 ) - self.assertTrue(invoice.tax_stamp) + self.assertTrue(invoice.l10n_it_account_stamp_is_stamp_duty_applied) invoice.action_post() self.assertEqual( @@ -84,27 +86,31 @@ def test_keep_lines_description(self): invoice.action_post() # Add stamp and check that edited description is kept - invoice.add_tax_stamp_line() + invoice.button_draft() + invoice.add_stamp_duty_line() self.assertEqual(invoice.invoice_line_ids[0].name, edited_descr) def test_amount_total_changing_currency(self): """Modify invoice currency and check that amount_total does not change after action_post""" - self.env.company.tax_stamp_product_id.auto_compute = False + stamp_duty_product = ( + self.env.company.l10n_it_account_stamp_stamp_duty_product_id + ) + stamp_duty_product.l10n_it_account_stamp_auto_compute = False invoice = first( self.invoices.filtered(lambda inv: inv.move_type == "out_invoice") ) invoice_form = Form(invoice) - invoice_form.manually_apply_tax_stamp = False + invoice_form.l10n_it_account_stamp_manually_apply_stamp_duty = False invoice_form.currency_id = self.env.ref("base.USD") invoice = invoice_form.save() total = invoice.amount_total invoice.action_post() self.assertEqual(total, invoice.amount_total) - def test_tax_stamp_line_button(self): + def test_stamp_duty_line_button(self): """Stamp fields show when stamp is added with the button to the invoice.""" - # Arrange: Create an invoice eligible for tax stamp but without it + # Arrange: Create an invoice eligible for stamp duty but without it stamp_tax = self.tax_id invoice = self.init_invoice( "out_invoice", @@ -114,15 +120,16 @@ def test_tax_stamp_line_button(self): ], ) # pre-condition - self.assertTrue(invoice.tax_stamp) - self.assertFalse(invoice.tax_stamp_line_present) + self.assertTrue(invoice.l10n_it_account_stamp_is_stamp_duty_applied) + self.assertFalse(invoice.l10n_it_account_stamp_is_stamp_duty_present) # Act - invoice.add_tax_stamp_line() + invoice.add_stamp_duty_line() + invoice.action_post() # Assert - self.assertTrue(invoice.tax_stamp_line_present) + self.assertTrue(invoice.l10n_it_account_stamp_is_stamp_duty_present) # Resetting to draft removes the stamp invoice.button_draft() - self.assertFalse(invoice.tax_stamp_line_present) + self.assertFalse(invoice.l10n_it_account_stamp_is_stamp_duty_present) diff --git a/l10n_it_account_stamp/views/account_move_report.xml b/l10n_it_account_stamp/views/account_move_report.xml index 7a17c34e1b3..ce16d8efc27 100644 --- a/l10n_it_account_stamp/views/account_move_report.xml +++ b/l10n_it_account_stamp/views/account_move_report.xml @@ -1,15 +1,17 @@ - diff --git a/l10n_it_account_stamp/views/account_move_view.xml b/l10n_it_account_stamp/views/account_move_view.xml index a6de558a64c..2946386a85a 100644 --- a/l10n_it_account_stamp/views/account_move_view.xml +++ b/l10n_it_account_stamp/views/account_move_view.xml @@ -4,7 +4,6 @@ ~ License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). --> - account.move.form.stamp @@ -12,50 +11,56 @@ - + - + CadetBlue:is_stamp_line==True; - - + + + -
Tax stamp - - + +
@@ -66,9 +71,8 @@ expr="//form/sheet/notebook/page[@id='invoice_tab']/field/form/sheet/group/field[@name='product_id']" position="after" > - +
-
diff --git a/l10n_it_account_stamp/views/company_view.xml b/l10n_it_account_stamp/views/company_view.xml index d52d26e2856..6ab7344c5fb 100644 --- a/l10n_it_account_stamp/views/company_view.xml +++ b/l10n_it_account_stamp/views/company_view.xml @@ -1,44 +1,19 @@ - view_account_config_settings_stamp res.config.settings -
-
+ -
-
- Configuration for Tax stamp - - -
- Product used as Tax Stamp in customer invoices -
-
-
-
-
-
-
-
+ + + - diff --git a/l10n_it_account_stamp/views/product_view.xml b/l10n_it_account_stamp/views/product_view.xml index dacfcb7b41b..4126363c93e 100644 --- a/l10n_it_account_stamp/views/product_view.xml +++ b/l10n_it_account_stamp/views/product_view.xml @@ -1,33 +1,32 @@ - product.template.form.inherit product.template - - - + +

For each invoice, the base amount for each selected tax will be added up and used to determine the application of the account stamp.

@@ -37,19 +36,16 @@ expr="//field[@name='property_account_income_id']" position="attributes" > - {'required': [('is_stamp', '=', True)]} - + l10n_it_account_stamp_is_stamp
- {'required': [('is_stamp', '=', True)]} + l10n_it_account_stamp_is_stamp -
-