diff --git a/l10n_it_payment_reason/README.rst b/l10n_it_payment_reason/README.rst new file mode 100644 index 000000000000..a91c363bed8c --- /dev/null +++ b/l10n_it_payment_reason/README.rst @@ -0,0 +1,212 @@ +======================= +ITA - Causali pagamento +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_payment_reason + :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-14-0/l10n-italy-14-0-l10n_it_payment_reason + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/122/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Tabelle delle causali di pagamento da usare, ad esempio, nelle ritenute d'acconto. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +**Italiano** + +Qualora questo modulo venisse installato in un DB dove ``l10n_it_causali_pagamento`` è già installato, è necessario eseguire la seguente procedura. + +#. Installare ``openupgradelib``: + + .. code:: + + pip3 install git+https://github.com/OCA/openupgradelib.git@master + +#. Lanciare Odoo con il paramentro ``shell`` +#. Eseguire i seguenti comandi: + + .. code:: python + + >>> from openupgradelib import openupgrade + >>> openupgrade.rename_xmlids( + env.cr, + [ + ( + "l10n_it_causali_pagamento.view_causale_pagamento_tree", + "l10n_it_payment_reason.view_payment_reason_tree", + ), + ( + "l10n_it_causali_pagamento.view_causale_pagamento_form", + "l10n_it_payment_reason.view_payment_reason_form", + ), + ( + "l10n_it_causali_pagamento.action_causale_pagamento", + "l10n_it_payment_reason.action_payment_reason", + ), + ( + "l10n_it_causali_pagamento.menu_causale_pagamento", + "l10n_it_payment_reason.menu_payment_reason", + ), + ], + ) + >>> openupgrade.update_module_names( + env.cr, + [ + ("l10n_it_causali_pagamento", "l10n_it_payment_reason"), + ], + ) + >>> openupgrade.rename_models( + env.cr, + [ + ("causale.pagamento", "payment.reason"), + ], + ) + >>> openupgrade.rename_tables( + env.cr, + [ + ("causale_pagamento", "payment_reason"), + ], + ) + >>> env.cr.commit() + +#. Riavviare Odoo +#. Aggiornare ``l10n_it_payment_reason`` + +**English** + +When ``l10n_it_causali_pagamento`` is installed in the database you need to follow the following steps. + +1. Install ``openupgradelib``: + + .. code:: + + pip3 install git+https://github.com/OCA/openupgradelib.git@master + +2. Run Odoo with the ``shell`` command +3. Execute the following commands: + + .. code:: python + + >>> from openupgradelib import openupgrade + >>> openupgrade.rename_xmlids( + >>> openupgrade.rename_xmlids( + env.cr, + [ + ( + "l10n_it_causali_pagamento.view_causale_pagamento_tree", + "l10n_it_payment_reason.view_payment_reason_tree", + ), + ( + "l10n_it_causali_pagamento.view_causale_pagamento_form", + "l10n_it_payment_reason.view_payment_reason_form", + ), + ( + "l10n_it_causali_pagamento.action_causale_pagamento", + "l10n_it_payment_reason.action_payment_reason", + ), + ( + "l10n_it_causali_pagamento.menu_causale_pagamento", + "l10n_it_payment_reason.menu_payment_reason", + ), + ], + ) + >>> openupgrade.update_module_names( + env.cr, + [ + ("l10n_it_causali_pagamento", "l10n_it_payment_reason"), + ], + ) + >>> openupgrade.rename_models( + env.cr, + [ + ("causale.pagamento", "payment.reason"), + ], + ) + >>> openupgrade.rename_tables( + env.cr, + [ + ("causale_pagamento", "payment_reason"), + ], + ) + >>> env.cr.commit() + +4. Restart Odoo +5. Update ``l10n_it_payment_reason`` module + +Configuration +============= + +La tabella viene aggiunta nell'area contabilità, ed è raggiungibile nella +sezione configurazione. Occorre avere i privilegi di account manager. + +Usage +===== + +Installando il modulo vengono precaricati i codici disponibili. +È possibile aggiungere nuovi codici o modificare quelli esistenti. +Non è possibile avere più di un elemento con lo stesso codice. + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Agile Business Group + +Contributors +~~~~~~~~~~~~ + +* Lorenzo Battistini +* Alex Comba +* Marco Colombo + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_it_payment_reason/__init__.py b/l10n_it_payment_reason/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/l10n_it_payment_reason/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_it_payment_reason/__manifest__.py b/l10n_it_payment_reason/__manifest__.py new file mode 100644 index 000000000000..f42260396727 --- /dev/null +++ b/l10n_it_payment_reason/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2018 Lorenzo Battistini - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "ITA - Causali pagamento", + "summary": "Aggiunge la tabella delle causali di pagamento da usare ad esempio " + "nelle ritenute d'acconto", + "version": "14.0.1.0.1", + "development_status": "Production/Stable", + "category": "Account", + "author": "Agile Business Group," "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-italy", + "license": "AGPL-3", + "depends": [ + "l10n_it_account", + ], + "data": [ + "security/ir.model.access.csv", + "data/payment_reason_data.xml", + "views/payment_reason_view.xml", + ], + "installable": True, +} diff --git a/l10n_it_payment_reason/data/payment_reason_data.xml b/l10n_it_payment_reason/data/payment_reason_data.xml new file mode 100644 index 000000000000..4d7ac23252ad --- /dev/null +++ b/l10n_it_payment_reason/data/payment_reason_data.xml @@ -0,0 +1,184 @@ + + + + A + Prestazioni di lavoro autonomo rientranti nell'esercizio di arte o professione abituale + + + B + Utilizzazione economica, da parte dell'autore o dell'inventore, di opere dell'ingegno, di brevetti industriali e di processi, formule o informazioni relativi a esperienze acquisite in campo industriale, commerciale o scientifico + + + + C + Utili derivanti da contratti di associazione in partecipazione e da contratti di cointeressenza, quando l'apporto è costituito esclusivamente dalla prestazione di lavoro + + + D + Utili spettanti ai soci promotori e ai soci fondatori delle società di capitali + + + + E + Levata di protesti cambiari da parte dei segretari comunali + + + + G + Indennità corrisposte per la cessazione di attività sportiva professionale + + + + H + Indennità corrisposte per la cessazione dei rapporti di agenzia delle persone fisiche e delle società di persone, con esclusione delle somme maturate entro il 31.12.2003, già imputate per competenza e tassate come reddito d'impresa + + + I + Indennità corrisposte per la cessazione da funzioni notarili + + + L + Redditi derivanti dall’utilizzazione economica di opere dell’ingegno, di brevetti industriali e di processi, formule e informazioni relativi a esperienze acquisite in campo industriale, commerciale o scientifico, che sono percepiti dagli aventi causa a titolo gratuito (ad es. eredi e legatari dell’autore e inventore) + + + M + Prestazioni di lavoro autonomo non esercitate abitualmente, obblighi di fare, di non fare o permettere + + + + N + Indennità di trasferta, rimborso forfetario di spese, premi e compensi erogati: .. nell'esercizio diretto di attività sportive dilettantistiche + + + + O + Prestazioni di lavoro autonomo non esercitate abitualmente, obblighi di fare, di non fare o permettere, per le quali non sussiste l'obbligo di iscrizione alla gestione separata (Circ. Inps 104/2001) + + + + P + Compensi corrisposti a soggetti non residenti privi di stabile organizzazione per l'uso o la concessione in uso di attrezzature industriali, commerciali o scientifiche che si trovano nel territorio dello + + + Q + Provvigioni corrisposte ad agente o rappresentante di commercio monomandatario + + + + R + Provvigioni corrisposte ad agente o rappresentante di commercio plurimandatario + + + + S + Provvigioni corrisposte a commissionario + + + + T + Provvigioni corrisposte a mediatore + + + + U + Provvigioni corrisposte a procacciatore di affari + + + + V + Provvigioni corrisposte a incaricato per le vendite a domicilio e provvigioni corrisposte a incaricato per la vendita porta a porta e per la vendita ambulante di giornali quotidiani e periodici (L. 25.02.1987, n. 67) + + + + W + Corrispettivi erogati nel 2013 per prestazioni relative a contratti d'appalto cui si sono resi applicabili le disposizioni contenute nell'art. 25-ter D.P.R. 600/1973 + + + + X + Canoni corrisposti nel 2004 da società o enti residenti, ovvero da stabili organizzazioni di società estere di cui all'art. 26-quater, c. 1, lett. a) e b) D.P.R. 600/1973, a società o stabili organizzazioni di società, situate in altro Stato membro dell'Unione Europea in presenza dei relativi requisiti richiesti, per i quali è stato effettuato nel 2006 il rimborso della ritenuta ai sensi dell'art. 4 D. Lgs. 143/2005 + + + + Y + Canoni corrisposti dal 1.01.2005 al 26.07.2005 da soggetti di cui al punto precedente + + + + ZO + Titolo diverso dai precedenti + + + + L1 + Redditi derivanti dall’utilizzazione economica di opere dell’ingegno, di brevetti industriali e di processi, formule e informazioni relativi a esperienze acquisite in campo industriale, commerciale o scientifico, che sono percepiti da soggetti che abbiano acquistato a titolo oneroso i diritti alla loro utilizzazione + + + + M1 + Redditi derivanti dall’assunzione di obblighi di fare, di non fare o permettere + + + + M2 + Prestazioni di lavoro autonomo non esercitate abitualmente per le quali sussiste l’obbligo di iscrizione alla Gestione Separata ENPAPI + + + + O1 + Redditi derivanti dall’assunzione di obblighi di fare, di non fare o permettere, per le quali non sussiste l’obbligo di iscrizione alla gestione separata (Circ. INPS n. 104/2001) + + + + V1 + Redditi derivanti da attività commerciali non esercitate abitualmente (ad esempio, provvigioni corrisposte per prestazioni occasionali ad agente o rappresentante di commercio, mediatore, procacciatore d’affari) + + + + diff --git a/l10n_it_payment_reason/i18n/l10n_it_payment_reason.pot b/l10n_it_payment_reason/i18n/l10n_it_payment_reason.pot new file mode 100644 index 000000000000..64b7217de034 --- /dev/null +++ b/l10n_it_payment_reason/i18n/l10n_it_payment_reason.pot @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_payment_reason +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-15 11:45+0000\n" +"PO-Revision-Date: 2021-04-15 11:45+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__code +msgid "Code" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__create_uid +msgid "Created by" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__create_date +msgid "Created on" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__name +msgid "Description" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__id +msgid "ID" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model.fields,field_description:l10n_it_payment_reason.field_payment_reason__write_date +msgid "Last Updated on" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.model,name:l10n_it_payment_reason.model_payment_reason +#: model_terms:ir.ui.view,arch_db:l10n_it_payment_reason.view_payment_reason_form +#: model_terms:ir.ui.view,arch_db:l10n_it_payment_reason.view_payment_reason_tree +msgid "Payment Reason" +msgstr "" + +#. module: l10n_it_payment_reason +#: model:ir.actions.act_window,name:l10n_it_payment_reason.action_payment_reason +#: model:ir.ui.menu,name:l10n_it_payment_reason.menu_payment_reason +msgid "Payment Reasons" +msgstr "" + +#. module: l10n_it_payment_reason +#: code:addons/l10n_it_payment_reason/models/causale_pagamento.py:0 +#: code:addons/l10n_it_payment_reason/models/payment_reason.py:0 +#, python-format +msgid "The element with code %s already exists" +msgstr "" diff --git a/l10n_it_payment_reason/models/__init__.py b/l10n_it_payment_reason/models/__init__.py new file mode 100644 index 000000000000..beba532c7db0 --- /dev/null +++ b/l10n_it_payment_reason/models/__init__.py @@ -0,0 +1 @@ +from . import payment_reason diff --git a/l10n_it_payment_reason/models/payment_reason.py b/l10n_it_payment_reason/models/payment_reason.py new file mode 100644 index 000000000000..aaa71961ee7a --- /dev/null +++ b/l10n_it_payment_reason/models/payment_reason.py @@ -0,0 +1,29 @@ +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class PaymentReason(models.Model): + _name = "payment.reason" + _description = "Payment Reason" + + @api.constrains("code") + def _check_code(self): + for reason in self: + domain = [("code", "=", reason.code)] + elements = self.search(domain) + if len(elements) > 1: + raise ValidationError( + _("The element with code %s already exists") % reason.code + ) + + def name_get(self): + res = [] + for cau in self: + name = "{} - {}".format(cau.code, cau.name) + if len(name) > 50: + name = name[:50] + "..." + res.append((cau.id, name)) + return res + + code = fields.Char(string="Code", size=2, required=True) + name = fields.Text(string="Description", required=True) diff --git a/l10n_it_payment_reason/readme/CONFIGURE.rst b/l10n_it_payment_reason/readme/CONFIGURE.rst new file mode 100644 index 000000000000..323dadee62e7 --- /dev/null +++ b/l10n_it_payment_reason/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +La tabella viene aggiunta nell'area contabilità, ed è raggiungibile nella +sezione configurazione. Occorre avere i privilegi di account manager. diff --git a/l10n_it_payment_reason/readme/CONTRIBUTORS.rst b/l10n_it_payment_reason/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..14201216ac6b --- /dev/null +++ b/l10n_it_payment_reason/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Lorenzo Battistini +* Alex Comba +* Marco Colombo diff --git a/l10n_it_payment_reason/readme/DESCRIPTION.rst b/l10n_it_payment_reason/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..bdd626f3266e --- /dev/null +++ b/l10n_it_payment_reason/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Tabelle delle causali di pagamento da usare, ad esempio, nelle ritenute d'acconto. diff --git a/l10n_it_payment_reason/readme/INSTALL.rst b/l10n_it_payment_reason/readme/INSTALL.rst new file mode 100644 index 000000000000..0e5aab32cf8d --- /dev/null +++ b/l10n_it_payment_reason/readme/INSTALL.rst @@ -0,0 +1,120 @@ +**Italiano** + +Qualora questo modulo venisse installato in un DB dove ``l10n_it_causali_pagamento`` è già installato, è necessario eseguire la seguente procedura. + +#. Installare ``openupgradelib``: + + .. code:: + + pip3 install git+https://github.com/OCA/openupgradelib.git@master + +#. Lanciare Odoo con il paramentro ``shell`` +#. Eseguire i seguenti comandi: + + .. code:: python + + >>> from openupgradelib import openupgrade + >>> openupgrade.rename_xmlids( + env.cr, + [ + ( + "l10n_it_causali_pagamento.view_causale_pagamento_tree", + "l10n_it_payment_reason.view_payment_reason_tree", + ), + ( + "l10n_it_causali_pagamento.view_causale_pagamento_form", + "l10n_it_payment_reason.view_payment_reason_form", + ), + ( + "l10n_it_causali_pagamento.action_causale_pagamento", + "l10n_it_payment_reason.action_payment_reason", + ), + ( + "l10n_it_causali_pagamento.menu_causale_pagamento", + "l10n_it_payment_reason.menu_payment_reason", + ), + ], + ) + >>> openupgrade.update_module_names( + env.cr, + [ + ("l10n_it_causali_pagamento", "l10n_it_payment_reason"), + ], + ) + >>> openupgrade.rename_models( + env.cr, + [ + ("causale.pagamento", "payment.reason"), + ], + ) + >>> openupgrade.rename_tables( + env.cr, + [ + ("causale_pagamento", "payment_reason"), + ], + ) + >>> env.cr.commit() + +#. Riavviare Odoo +#. Aggiornare ``l10n_it_payment_reason`` + +**English** + +When ``l10n_it_causali_pagamento`` is installed in the database you need to follow the following steps. + +1. Install ``openupgradelib``: + + .. code:: + + pip3 install git+https://github.com/OCA/openupgradelib.git@master + +2. Run Odoo with the ``shell`` command +3. Execute the following commands: + + .. code:: python + + >>> from openupgradelib import openupgrade + >>> openupgrade.rename_xmlids( + >>> openupgrade.rename_xmlids( + env.cr, + [ + ( + "l10n_it_causali_pagamento.view_causale_pagamento_tree", + "l10n_it_payment_reason.view_payment_reason_tree", + ), + ( + "l10n_it_causali_pagamento.view_causale_pagamento_form", + "l10n_it_payment_reason.view_payment_reason_form", + ), + ( + "l10n_it_causali_pagamento.action_causale_pagamento", + "l10n_it_payment_reason.action_payment_reason", + ), + ( + "l10n_it_causali_pagamento.menu_causale_pagamento", + "l10n_it_payment_reason.menu_payment_reason", + ), + ], + ) + >>> openupgrade.update_module_names( + env.cr, + [ + ("l10n_it_causali_pagamento", "l10n_it_payment_reason"), + ], + ) + >>> openupgrade.rename_models( + env.cr, + [ + ("causale.pagamento", "payment.reason"), + ], + ) + >>> openupgrade.rename_tables( + env.cr, + [ + ("causale_pagamento", "payment_reason"), + ], + ) + >>> env.cr.commit() + +4. Restart Odoo +5. Update ``l10n_it_payment_reason`` module diff --git a/l10n_it_payment_reason/readme/USAGE.rst b/l10n_it_payment_reason/readme/USAGE.rst new file mode 100644 index 000000000000..d65efcc63183 --- /dev/null +++ b/l10n_it_payment_reason/readme/USAGE.rst @@ -0,0 +1,3 @@ +Installando il modulo vengono precaricati i codici disponibili. +È possibile aggiungere nuovi codici o modificare quelli esistenti. +Non è possibile avere più di un elemento con lo stesso codice. diff --git a/l10n_it_payment_reason/security/ir.model.access.csv b/l10n_it_payment_reason/security/ir.model.access.csv new file mode 100644 index 000000000000..d1a539d23511 --- /dev/null +++ b/l10n_it_payment_reason/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_payment_reason_user,payment_reason user,model_payment_reason,base.group_user,1,0,0,0 +access_payment_reason_manager,payment_reason manager,model_payment_reason,account.group_account_manager,1,1,1,1 diff --git a/l10n_it_payment_reason/static/description/icon.png b/l10n_it_payment_reason/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/l10n_it_payment_reason/static/description/icon.png differ diff --git a/l10n_it_payment_reason/static/description/index.html b/l10n_it_payment_reason/static/description/index.html new file mode 100644 index 000000000000..e7cc08dfbf16 --- /dev/null +++ b/l10n_it_payment_reason/static/description/index.html @@ -0,0 +1,559 @@ + + + + + + +ITA - Causali pagamento + + + +
+

ITA - Causali pagamento

+ + +

Production/Stable License: AGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runbot

+

Tabelle delle causali di pagamento da usare, ad esempio, nelle ritenute d’acconto.

+

Table of contents

+ +
+

Installation

+

Italiano

+

Qualora questo modulo venisse installato in un DB dove l10n_it_causali_pagamento è già installato, è necessario eseguire la seguente procedura.

+
    +
  1. Installare openupgradelib:

    +
    +pip3 install git+https://github.com/OCA/openupgradelib.git@master
    +
    +
  2. +
  3. Lanciare Odoo con il paramentro shell

    +
  4. +
  5. Eseguire i seguenti comandi:

    +
    + >>> from openupgradelib import openupgrade
    + >>> openupgrade.rename_xmlids(
    +       env.cr,
    +       [
    +           (
    +               "l10n_it_causali_pagamento.view_causale_pagamento_tree",
    +               "l10n_it_payment_reason.view_payment_reason_tree",
    +           ),
    +           (
    +               "l10n_it_causali_pagamento.view_causale_pagamento_form",
    +               "l10n_it_payment_reason.view_payment_reason_form",
    +           ),
    +           (
    +               "l10n_it_causali_pagamento.action_causale_pagamento",
    +               "l10n_it_payment_reason.action_payment_reason",
    +           ),
    +           (
    +               "l10n_it_causali_pagamento.menu_causale_pagamento",
    +               "l10n_it_payment_reason.menu_payment_reason",
    +           ),
    +       ],
    +)
    +>>> openupgrade.update_module_names(
    +       env.cr,
    +       [
    +           ("l10n_it_causali_pagamento", "l10n_it_payment_reason"),
    +       ],
    +)
    +>>> openupgrade.rename_models(
    +       env.cr,
    +       [
    +           ("causale.pagamento", "payment.reason"),
    +       ],
    +)
    +>>> openupgrade.rename_tables(
    +     env.cr,
    +     [
    +         ("causale_pagamento", "payment_reason"),
    +     ],
    +)
    +>>> env.cr.commit()
    +
    +
  6. +
  7. Riavviare Odoo

    +
  8. +
  9. Aggiornare l10n_it_payment_reason

    +
  10. +
+

English

+

When l10n_it_causali_pagamento is installed in the database you need to follow the following steps.

+
    +
  1. Install openupgradelib:

    +
    +pip3 install git+https://github.com/OCA/openupgradelib.git@master
    +
    +
  2. +
  3. Run Odoo with the shell command

    +
  4. +
  5. Execute the following commands:

    +
    + >>> from openupgradelib import openupgrade
    + >>> openupgrade.rename_xmlids(
    + >>> openupgrade.rename_xmlids(
    +       env.cr,
    +       [
    +           (
    +               "l10n_it_causali_pagamento.view_causale_pagamento_tree",
    +               "l10n_it_payment_reason.view_payment_reason_tree",
    +           ),
    +           (
    +               "l10n_it_causali_pagamento.view_causale_pagamento_form",
    +               "l10n_it_payment_reason.view_payment_reason_form",
    +           ),
    +           (
    +               "l10n_it_causali_pagamento.action_causale_pagamento",
    +               "l10n_it_payment_reason.action_payment_reason",
    +           ),
    +           (
    +               "l10n_it_causali_pagamento.menu_causale_pagamento",
    +               "l10n_it_payment_reason.menu_payment_reason",
    +           ),
    +       ],
    +)
    +>>> openupgrade.update_module_names(
    +       env.cr,
    +       [
    +           ("l10n_it_causali_pagamento", "l10n_it_payment_reason"),
    +       ],
    +)
    +>>> openupgrade.rename_models(
    +       env.cr,
    +       [
    +           ("causale.pagamento", "payment.reason"),
    +       ],
    +)
    +>>> openupgrade.rename_tables(
    +     env.cr,
    +     [
    +         ("causale_pagamento", "payment_reason"),
    +     ],
    +)
    +>>> env.cr.commit()
    +
    +
  6. +
  7. Restart Odoo

    +
  8. +
  9. Update l10n_it_payment_reason module

    +
  10. +
+
+
+

Configuration

+

La tabella viene aggiunta nell’area contabilità, ed è raggiungibile nella +sezione configurazione. Occorre avere i privilegi di account manager.

+
+
+

Usage

+

Installando il modulo vengono precaricati i codici disponibili. +È possibile aggiungere nuovi codici o modificare quelli esistenti. +Non è possibile avere più di un elemento con lo stesso codice.

+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Agile Business Group
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

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

+
+
+
+ + diff --git a/l10n_it_payment_reason/tests/__init__.py b/l10n_it_payment_reason/tests/__init__.py new file mode 100644 index 000000000000..acfd0ecd9096 --- /dev/null +++ b/l10n_it_payment_reason/tests/__init__.py @@ -0,0 +1 @@ +from . import test_reason diff --git a/l10n_it_payment_reason/tests/test_reason.py b/l10n_it_payment_reason/tests/test_reason.py new file mode 100644 index 000000000000..99401b10fe95 --- /dev/null +++ b/l10n_it_payment_reason/tests/test_reason.py @@ -0,0 +1,23 @@ +from odoo.exceptions import ValidationError +from odoo.tests.common import TransactionCase + + +class TestReasons(TransactionCase): + def setUp(self): + super(TestReasons, self).setUp() + self.reason_model = self.env["payment.reason"] + self.reason_b = self.env.ref("l10n_it_payment_reason.b") + + def test_reasons(self): + with self.assertRaises(ValidationError): + self.reason_model.create({"code": "B", "name": "Test"}) + name = self.reason_b.name_get() + self.assertEqual( + name, + [ + ( + self.reason_b.id, + "B - Utilizzazione economica, da parte dell'autore ...", + ) + ], + ) diff --git a/l10n_it_payment_reason/views/payment_reason_view.xml b/l10n_it_payment_reason/views/payment_reason_view.xml new file mode 100644 index 000000000000..abaf7d337cff --- /dev/null +++ b/l10n_it_payment_reason/views/payment_reason_view.xml @@ -0,0 +1,45 @@ + + + + + view.payment.reason.tree + payment.reason + + + + + + + + + + view.payment.reason.form + payment.reason + +
+ + + + + + +
+
+
+ + + Payment Reasons + payment.reason + + + + + +
diff --git a/setup/l10n_it_payment_reason/odoo/addons/l10n_it_payment_reason b/setup/l10n_it_payment_reason/odoo/addons/l10n_it_payment_reason new file mode 120000 index 000000000000..44c46cc6c850 --- /dev/null +++ b/setup/l10n_it_payment_reason/odoo/addons/l10n_it_payment_reason @@ -0,0 +1 @@ +../../../../l10n_it_payment_reason \ No newline at end of file diff --git a/setup/l10n_it_payment_reason/setup.py b/setup/l10n_it_payment_reason/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/l10n_it_payment_reason/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)