From 200b37937b67d1319f00141fb7a8b48a88e73718 Mon Sep 17 00:00:00 2001 From: Silvio Gregorini Date: Fri, 15 Nov 2019 19:08:19 +0100 Subject: [PATCH] [MIG] l10n_it_withholding_tax_payment: Migration to 12.0 --- l10n_it_withholding_tax_payment/README.rst | 90 ++-- l10n_it_withholding_tax_payment/__init__.py | 1 - .../__manifest__.py | 36 +- .../data/sequence.xml | 2 +- .../i18n/l10n_it_withholding_tax_payment.pot | 144 +++--- .../migrations/12.0.1.0.0/pre-migrate.py | 46 ++ .../models/__init__.py | 2 - .../models/withholding_tax.py | 84 ++-- .../readme/CONTRIBUTORS.rst | 3 + .../readme/CREDITS.rst | 3 + .../readme/DESCRIPTION.rst | 7 + .../security/security.xml | 23 +- .../static/description/index.html | 433 ++++++++++++++++++ .../views/withholding_tax.xml | 14 +- .../wizard/__init__.py | 2 - .../wizard/create_move_payment.py | 22 +- .../wizard/create_move_payment_view.xml | 65 +-- 17 files changed, 750 insertions(+), 227 deletions(-) create mode 100644 l10n_it_withholding_tax_payment/migrations/12.0.1.0.0/pre-migrate.py create mode 100644 l10n_it_withholding_tax_payment/readme/CONTRIBUTORS.rst create mode 100644 l10n_it_withholding_tax_payment/readme/CREDITS.rst create mode 100644 l10n_it_withholding_tax_payment/readme/DESCRIPTION.rst create mode 100644 l10n_it_withholding_tax_payment/static/description/index.html diff --git a/l10n_it_withholding_tax_payment/README.rst b/l10n_it_withholding_tax_payment/README.rst index ddfdc7526464..3f2b29872893 100644 --- a/l10n_it_withholding_tax_payment/README.rst +++ b/l10n_it_withholding_tax_payment/README.rst @@ -1,63 +1,89 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 +==================================== +ITA - Ritenute d'acconto - Pagamenti +==================================== -======================= -Italian Withholding Tax -======================= +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -Module for Italian Withholding Tax: Ritenute d'acconto +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |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/12.0/l10n_it_withholding_tax_payment + :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-12-0/l10n-italy-12-0-l10n_it_withholding_tax_payment + :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/12.0 + :alt: Try me on Runbot -Gestisce le ritenute sulle fatture e sui pagamenti +|badge1| |badge2| |badge3| |badge4| |badge5| -Installation -============ +**Italiano** -To install this module, you need to have l10n_it_withholding_tax +Gestisce le ritenute sulle fatture e sui pagamenti. -Usage -===== +**English** -* Go to ... +Manages the Italian withholding taxes on invoices and payments. -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/122/8.0 +**Table of contents** + +.. contents:: + :local: 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 smash it by providing detailed and welcomed feedback. +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 +~~~~~~~ + +* Openforce +* Odoo Italia Network + Contributors ------------- +~~~~~~~~~~~~ * Alessandro Camilli * Lorenzo Battistini +* Matteo Bilotta + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* `Odoo Italia Network `_ -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. - -Sponsor -------- - -'Odoo Italia Network '_ +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_withholding_tax_payment/__init__.py b/l10n_it_withholding_tax_payment/__init__.py index 99d83be725c0..ba0a966ff3bc 100644 --- a/l10n_it_withholding_tax_payment/__init__.py +++ b/l10n_it_withholding_tax_payment/__init__.py @@ -1,4 +1,3 @@ -# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models, wizard diff --git a/l10n_it_withholding_tax_payment/__manifest__.py b/l10n_it_withholding_tax_payment/__manifest__.py index 814a1a6d40b3..29594121cd54 100644 --- a/l10n_it_withholding_tax_payment/__manifest__.py +++ b/l10n_it_withholding_tax_payment/__manifest__.py @@ -1,23 +1,29 @@ # Copyright 2015 Alessandro Camilli () +# Copyright 2019 Matteo Bilotta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { - 'name': 'Italian Withholding Tax Payment', - 'version': '11.0.1.0.0', - 'category': 'Account', - 'author': 'Openforce, Odoo Italia Network, ' - 'Odoo Community Association (OCA)', - 'website': 'https://odoo-community.org/', + 'name': "ITA - Ritenuta d'acconto - Pagamenti", + 'summary': "Gestisce le ritenute sulle fatture e sui pagamenti", + 'version': '12.0.1.0.0', + 'development_status': "Beta", + 'category': "Invoicing & Payments", + 'website': 'https://github.com/OCA/l10n-italy', + 'author': "Openforce, " + "Odoo Italia Network, " + "Odoo Community Association (OCA)", 'license': 'AGPL-3', - "depends": ['account', - 'l10n_it_withholding_tax'], - "data": [ - 'views/withholding_tax.xml', - 'security/ir.model.access.csv', + 'application': False, + 'installable': True, + 'depends': [ + 'account', + 'l10n_it_withholding_tax' + ], + 'data': [ 'data/sequence.xml', - 'wizard/create_move_payment_view.xml', + 'security/ir.model.access.csv', 'security/security.xml', - ], - "active": False, - "installable": True + 'views/withholding_tax.xml', + 'wizard/create_move_payment_view.xml', + ] } diff --git a/l10n_it_withholding_tax_payment/data/sequence.xml b/l10n_it_withholding_tax_payment/data/sequence.xml index 575e77e62c87..0ae498857f41 100644 --- a/l10n_it_withholding_tax_payment/data/sequence.xml +++ b/l10n_it_withholding_tax_payment/data/sequence.xml @@ -2,7 +2,7 @@ - Withholding Tax Move Payment Number + Withholding Tax Payment Move Number withholding.tax.move.payment WTMP/ diff --git a/l10n_it_withholding_tax_payment/i18n/l10n_it_withholding_tax_payment.pot b/l10n_it_withholding_tax_payment/i18n/l10n_it_withholding_tax_payment.pot index 7f60e5d5e59c..83f30872408b 100644 --- a/l10n_it_withholding_tax_payment/i18n/l10n_it_withholding_tax_payment.pot +++ b/l10n_it_withholding_tax_payment/i18n/l10n_it_withholding_tax_payment.pot @@ -4,8 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0-20191007\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-19 08:47+0000\n" +"PO-Revision-Date: 2019-11-19 08:47+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -14,32 +16,32 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_account_id +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__account_id msgid "Account" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form msgid "Account Setting" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_move_id -msgid "Account move" +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__move_id +msgid "Account Move" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view msgid "Cancel" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_company_id +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__company_id msgid "Company" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form msgid "Confirm" msgstr "" @@ -49,51 +51,51 @@ msgid "Confirmed" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form msgid "Create Account Move" msgstr "" #. module: l10n_it_withholding_tax_payment #: model:ir.actions.act_window,name:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_action -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view -msgid "Create Move Payment" +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view +msgid "Create Payment Move" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_create_uid -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create_create_uid +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__create_uid +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create__create_uid msgid "Created by" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_create_date -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create_create_date +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__create_date +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create__create_date msgid "Created on" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_date +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__date msgid "Date" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_date_payment -msgid "Date Payment" +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__date_payment +msgid "Payment Date" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_date_start -msgid "Date Start" +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__date_start +msgid "Start Date" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_date_stop -msgid "Date Stop" +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__date_stop +msgid "Stop Date" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_display_name -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create_display_name +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__display_name +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create__display_name msgid "Display Name" msgstr "" @@ -103,116 +105,117 @@ msgid "Draft" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view msgid "Generate" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_id -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create_id +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__id +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create__id msgid "ID" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_journal_id +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__journal_id msgid "Journal" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment___last_update -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create___last_update +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment____last_update +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create____last_update msgid "Last Modified on" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_write_uid -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create_write_uid +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__write_uid +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create__write_uid msgid "Last Updated by" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_write_date -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create_write_date +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__write_date +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create__write_date msgid "Last Updated on" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_line_ids +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__line_ids msgid "Lines" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_wt_move_payment_id -msgid "Move Payment" +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move__wt_move_payment_id +msgid "Payment Move" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_name +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__name msgid "Name" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form msgid "Period" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form msgid "Set to Draft" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_state +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__state msgid "Status" msgstr "" #. module: l10n_it_withholding_tax_payment -#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:130 +#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:131 #, python-format msgid "The selected moves must have the same company!" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form msgid "Tot" msgstr "" #. module: l10n_it_withholding_tax_payment #: model:ir.ui.menu,name:l10n_it_withholding_tax_payment.menu_withholding_tax_move_payment -msgid "WT Move Payments" +msgid "WT Payment Moves" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create__wt_move_ids +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.wizard_wt_move_payment_create_view msgid "WT Moves" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment_amount -msgid "WT amount" +#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_withholding_tax_move_payment__amount +msgid "WT Amount" msgstr "" #. module: l10n_it_withholding_tax_payment #: model:ir.model,name:l10n_it_withholding_tax_payment.model_wizard_wt_move_payment_create -msgid "WT wizard create move payment" +msgid "Create WT Payment Move Wizard" msgstr "" #. module: l10n_it_withholding_tax_payment #: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:77 #, python-format -msgid "Warning! Datas required for account move creation: Date payment, journal, account" +msgid "Warning! Data required for account move creation: payment date, journal, account" msgstr "" #. module: l10n_it_withholding_tax_payment #: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:33 #, python-format -msgid "Warning! Withholding Tax moves in a payment: {}" +msgid "Warning! Withholding tax moves in a payment: {}" msgstr "" #. module: l10n_it_withholding_tax_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_tree -msgid "Withholding Move Payment" +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_tree +msgid "Withholding Payment Move" msgstr "" #. module: l10n_it_withholding_tax_payment @@ -221,49 +224,40 @@ msgid "Withholding Tax Move" msgstr "" #. module: l10n_it_withholding_tax_payment +#: model:ir.actions.act_window,name:l10n_it_withholding_tax_payment.action_withholding_tax_move_payment #: model:ir.model,name:l10n_it_withholding_tax_payment.model_withholding_tax_move_payment -#: model:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form -msgid "Withholding Tax Move Payment" +#: model_terms:ir.ui.view,arch_db:l10n_it_withholding_tax_payment.view_withholding_move_payment_form +msgid "Withholding Tax Payment Move" msgstr "" #. module: l10n_it_withholding_tax_payment -#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:109 -#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:117 -#: code:addons/l10n_it_withholding_tax_payment/wizard/create_move_payment.py:33 +#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:110 +#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:118 +#: code:addons/l10n_it_withholding_tax_payment/wizard/create_move_payment.py:29 #, python-format msgid "Withholding Tax Payment" msgstr "" #. module: l10n_it_withholding_tax_payment -#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:90 +#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:91 #, python-format -msgid "Withholding Tax Payment %s" -msgstr "" - -#. module: l10n_it_withholding_tax_payment -#: model:ir.actions.act_window,name:l10n_it_withholding_tax_payment.action_withholding_tax_move_payment -msgid "Withhoulding Tax Move Payment" -msgstr "" - -#. module: l10n_it_withholding_tax_payment -#: model:ir.model.fields,field_description:l10n_it_withholding_tax_payment.field_wizard_wt_move_payment_create_wt_move_ids -msgid "Wt Moves" +msgid "Withholding tax payment {}" msgstr "" #. module: l10n_it_withholding_tax_payment -#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:141 +#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:142 #, python-format -msgid "Wt move already in a move payment! Move paym. %s -Ref WT: %s - %s - %s" +msgid "WT move already in a payment move! Paym. move {} - Ref WT: {} - {} - {}" msgstr "" #. module: l10n_it_withholding_tax_payment -#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:135 +#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:136 #, python-format -msgid "Wt move already paid! - %s - %s - %s" +msgid "WT move already paid! - {} - {} - {}" msgstr "" #. module: l10n_it_withholding_tax_payment -#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:181 +#: code:addons/l10n_it_withholding_tax_payment/models/withholding_tax.py:183 #, python-format msgid "You can only delete draft payments" msgstr "" diff --git a/l10n_it_withholding_tax_payment/migrations/12.0.1.0.0/pre-migrate.py b/l10n_it_withholding_tax_payment/migrations/12.0.1.0.0/pre-migrate.py new file mode 100644 index 000000000000..94d3b1f570e6 --- /dev/null +++ b/l10n_it_withholding_tax_payment/migrations/12.0.1.0.0/pre-migrate.py @@ -0,0 +1,46 @@ +# Copyright 2019 Matteo Bilotta +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging + +from datetime import datetime +from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT + +_logger = logging.getLogger(__name__) + + +def _fix_date_field(cr): + cr.execute("SELECT id, date FROM withholding_tax_move_payment" + " WHERE date IS NOT NULL;") + + records = cr.fetchall() + for record in records: + record_id = record[0] + record_value = record[1] + + try: + datetime.strptime(record_value, DEFAULT_SERVER_DATE_FORMAT) + + except (TypeError, ValueError): + _logger.error("The row in table 'withholding_tax_move_payment'" + " with ID #{} and 'date' field valued" + " as '{}' will be set as NULL..." + .format(record_id, record_value)) + + cr.execute("UPDATE withholding_tax_move_payment" + " SET date = NULL WHERE id = %s;", (record_id, )) + + cr.execute("ALTER TABLE withholding_tax_move_payment" + " ALTER COLUMN date TYPE DATE USING date::DATE;") + + +def migrate(cr, version): + if not version: + _logger.warning("Does not exist any previous version for this module. " + "Skipping the migration...") + + return + + _fix_date_field(cr) + + _logger.info("Migration executed successfully. Exiting...") diff --git a/l10n_it_withholding_tax_payment/models/__init__.py b/l10n_it_withholding_tax_payment/models/__init__.py index 1e6ba7867c86..3488f5c1e644 100644 --- a/l10n_it_withholding_tax_payment/models/__init__.py +++ b/l10n_it_withholding_tax_payment/models/__init__.py @@ -1,5 +1,3 @@ -# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - from . import withholding_tax diff --git a/l10n_it_withholding_tax_payment/models/withholding_tax.py b/l10n_it_withholding_tax_payment/models/withholding_tax.py index e21ddab8db71..3ec877da9dcd 100644 --- a/l10n_it_withholding_tax_payment/models/withholding_tax.py +++ b/l10n_it_withholding_tax_payment/models/withholding_tax.py @@ -1,7 +1,7 @@ # Copyright 2015 Alessandro Camilli () +# Copyright 2019 Matteo Bilotta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - from odoo import models, fields, api, _ from odoo.exceptions import ValidationError @@ -10,16 +10,17 @@ class WithholdingTaxMove(models.Model): _inherit = 'withholding.tax.move' wt_move_payment_id = fields.Many2one( - 'withholding.tax.move.payment', 'Move Payment', readonly=True) + 'withholding.tax.move.payment', "Payment Move", readonly=True) def unlink(self): for rec in self: if rec.wt_move_payment_id: raise ValidationError( - _(('Warning! Withholding tax move in payment {}: \ - you can not delete it').format( - rec.wt_move_payment_id.name))) - return super(WithholdingTaxMove, self).unlink() + _("Warning! Withholding tax move in a payment {}:" + " you can not delete it") + .format(rec.wt_move_payment_id.name)) + + return super().unlink() @api.multi def check_unlink(self): @@ -27,17 +28,19 @@ def check_unlink(self): for move in self: if move.wt_move_payment_id: wt_moves_not_eresable.append(move) + if wt_moves_not_eresable: raise ValidationError( - _('Warning! Withholding Tax moves in a payment: {}'.format( - wt_moves_not_eresable[0].sudo().wt_move_payment_id.name - ))) - super(WithholdingTaxMove, self).check_unlink() + _("Warning! Withholding tax moves in a payment: {}") + .format(wt_moves_not_eresable[0].sudo() + .wt_move_payment_id.name)) + + super().check_unlink() class WithholdingTaxMovePayment(models.Model): _name = 'withholding.tax.move.payment' - _description = 'Withholding Tax Move Payment' + _description = "Withholding Tax Payment Move" @api.depends('line_ids.amount', 'line_ids.wt_move_payment_id') def _compute_total(self): @@ -56,16 +59,16 @@ def _compute_total(self): default=lambda self: self.env['res.company']._company_default_get('account.account')) name = fields.Char('Name') - date = fields.Char('Date') - date_payment = fields.Date('Date Payment') - date_start = fields.Date('Date Start', readonly=True) - date_stop = fields.Date('Date Stop', readonly=True) - move_id = fields.Many2one('account.move', string='Account move') + date = fields.Date(string="Date") + date_payment = fields.Date("Payment Date") + date_start = fields.Date("Start Date", readonly=True) + date_stop = fields.Date("Stop Date", readonly=True) + move_id = fields.Many2one('account.move', string="Account Move") account_id = fields.Many2one('account.account', string='Account') journal_id = fields.Many2one('account.journal', string='Journal') line_ids = fields.One2many( 'withholding.tax.move', 'wt_move_payment_id', string='Lines') - amount = fields.Float('WT amount', compute='_compute_total') + amount = fields.Float("WT Amount", compute='_compute_total') def create_account_move(self): account_move_obj = self.env['account.move'] @@ -74,8 +77,9 @@ def create_account_move(self): or not mp.journal_id\ or not mp.account_id: raise ValidationError( - _('Warning! Datas required for account move creation: \ - Date payment, journal, account')) + _("Warning! Data required for account move creation:" + " payment date, journal, account")) + # WT Moves wt_move_balance = 0 move_lines = [] @@ -87,8 +91,8 @@ def create_account_move(self): else: credit = wt_move.amount vals = { - 'name': _('Withholding Tax Payment %s') - % wt_move.partner_id.name, + 'name': _("Withholding tax payment {}") + .format(wt_move.partner_id.name), 'account_id': wt_move.withholding_tax_id.account_payable_id.id, 'credit': credit, @@ -113,12 +117,12 @@ def create_account_move(self): } move_lines.append((0, 0, vals)) # Move create - move = account_move_obj.create({ + move = account_move_obj.create([{ 'ref': _('Withholding Tax Payment'), 'journal_id': mp.journal_id.id, 'date': mp.date_payment, 'line_ids': move_lines, - }) + }]) move.post() # Ref on payement mp.move_id = move.id @@ -128,23 +132,26 @@ def generate_from_moves(self, wt_moves): if wt_moves and len(wt_moves.mapped('company_id')) > 1: raise ValidationError( _("The selected moves must have the same company!")) + sequence_obj = self.env['ir.sequence'] for wt_move in wt_moves: if wt_move.state == 'paid': raise ValidationError( - _("Wt move already paid! - %s - %s - %s") - % (wt_move.partner_id.name, - wt_move.date, - str(wt_move.amount))) + _("WT move already paid! - {} - {} - {}") + .format(wt_move.partner_id.name, + wt_move.date, + str(wt_move.amount))) + if wt_move.wt_move_payment_id: raise ValidationError( - _("Wt move already in a move payment! \ - Move paym. %s -Ref WT: %s - %s - %s") - % (str(wt_move.wt_move_payment_id.id), - wt_move.partner_id.name, - wt_move.date, - str(wt_move.amount))) - # Create Move payment + _("WT move already in a payment move! " + "Paym. move {} - Ref WT: {} - {} - {}") + .format(str(wt_move.wt_move_payment_id.id), + wt_move.partner_id.name, + wt_move.date, + str(wt_move.amount))) + + # Create Payment Move wt_payment = False if wt_moves: val = { @@ -152,7 +159,7 @@ def generate_from_moves(self, wt_moves): 'date': fields.Date.today(), 'line_ids': [(6, 0, wt_moves.ids)] } - wt_payment = self.create(val) + wt_payment = self.create([val]) # Update ref on moves for wt_move in wt_moves: wt_move.wt_move_payment_id = wt_payment.id @@ -162,7 +169,7 @@ def action_confirmed(self): for move in self: if move.state in ['draft']: move.state = 'confirmed' - # Wt move set to due + # WT move set to due for wt_move in move.line_ids: wt_move.action_paid() @@ -170,7 +177,7 @@ def action_set_to_draft(self): for move in self: if move.state in ['confirmed']: move.state = 'draft' - # Wt move set to due + # WT move set to due for wt_move in move.line_ids: wt_move.action_set_to_draft() @@ -179,4 +186,5 @@ def unlink(self): for payment in self: if payment.state != 'draft': raise ValidationError(_("You can only delete draft payments")) - return super(WithholdingTaxMovePayment, self).unlink() + + return super().unlink() diff --git a/l10n_it_withholding_tax_payment/readme/CONTRIBUTORS.rst b/l10n_it_withholding_tax_payment/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..cc67fa1833a3 --- /dev/null +++ b/l10n_it_withholding_tax_payment/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Alessandro Camilli +* Lorenzo Battistini +* Matteo Bilotta diff --git a/l10n_it_withholding_tax_payment/readme/CREDITS.rst b/l10n_it_withholding_tax_payment/readme/CREDITS.rst new file mode 100644 index 000000000000..310d8c55ec1c --- /dev/null +++ b/l10n_it_withholding_tax_payment/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* `Odoo Italia Network `_ diff --git a/l10n_it_withholding_tax_payment/readme/DESCRIPTION.rst b/l10n_it_withholding_tax_payment/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..fbf761f9fbbf --- /dev/null +++ b/l10n_it_withholding_tax_payment/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +**Italiano** + +Gestisce le ritenute sulle fatture e sui pagamenti. + +**English** + +Manages the Italian withholding taxes on invoices and payments. diff --git a/l10n_it_withholding_tax_payment/security/security.xml b/l10n_it_withholding_tax_payment/security/security.xml index 765ee4f4afeb..35ed5efe4fc1 100644 --- a/l10n_it_withholding_tax_payment/security/security.xml +++ b/l10n_it_withholding_tax_payment/security/security.xml @@ -1,15 +1,18 @@ - - + - - Withholding tax move payment - - - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + + - + + Withholding Tax Payment Move + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + - \ No newline at end of file + + diff --git a/l10n_it_withholding_tax_payment/static/description/index.html b/l10n_it_withholding_tax_payment/static/description/index.html new file mode 100644 index 000000000000..926f92a28813 --- /dev/null +++ b/l10n_it_withholding_tax_payment/static/description/index.html @@ -0,0 +1,433 @@ + + + + + + +ITA - Ritenute d'acconto - Pagamenti + + + +
+

ITA - Ritenute d’acconto - Pagamenti

+ + +

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

+

Italiano

+

Gestisce le ritenute sulle fatture e sui pagamenti.

+

English

+

Manages the Italian withholding taxes on invoices and payments.

+

Table of contents

+ +
+

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

+
    +
  • Openforce
  • +
  • Odoo Italia Network
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

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_withholding_tax_payment/views/withholding_tax.xml b/l10n_it_withholding_tax_payment/views/withholding_tax.xml index 51f6736532a9..d0c11e925472 100644 --- a/l10n_it_withholding_tax_payment/views/withholding_tax.xml +++ b/l10n_it_withholding_tax_payment/views/withholding_tax.xml @@ -25,13 +25,13 @@
+ Withholding Tax Payment Move + --> withholding.tax.move.payment.view.tree withholding.tax.move.payment - + @@ -47,7 +47,7 @@ withholding.tax.move.payment.view.form withholding.tax.move.payment -
+
- + @@ -91,12 +91,12 @@ - Withhoulding Tax Move Payment + Withholding Tax Payment Move withholding.tax.move.payment - diff --git a/l10n_it_withholding_tax_payment/wizard/__init__.py b/l10n_it_withholding_tax_payment/wizard/__init__.py index 45591af4c9dc..752c33a8ab30 100644 --- a/l10n_it_withholding_tax_payment/wizard/__init__.py +++ b/l10n_it_withholding_tax_payment/wizard/__init__.py @@ -1,5 +1,3 @@ -# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - from . import create_move_payment diff --git a/l10n_it_withholding_tax_payment/wizard/create_move_payment.py b/l10n_it_withholding_tax_payment/wizard/create_move_payment.py index c1bf716138a7..497d473cf1dc 100644 --- a/l10n_it_withholding_tax_payment/wizard/create_move_payment.py +++ b/l10n_it_withholding_tax_payment/wizard/create_move_payment.py @@ -1,26 +1,21 @@ # Copyright 2015 Alessandro Camilli () +# Copyright 2019 Matteo Bilotta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import models, fields, api, _ +from odoo import _, fields, models class WizardWtMovePaymentCreate(models.TransientModel): _name = 'wizard.wt.move.payment.create' - _description = 'WT wizard create move payment' + _description = "Create WT Payment Move Wizard" - @api.model - def default_get(self, fields): - res = super(WizardWtMovePaymentCreate, self).default_get(fields) - active_ids = self._context.get('active_ids', []) - res = { - 'wt_move_ids': active_ids - } - return res + def _default_wt_moves(self): + return self._context.get('active_ids', []) wt_move_ids = fields.Many2many( 'withholding.tax.move', 'wiz_wt_move_payment_create_rel', - 'wizard_id', 'wt_move_id', 'Wt Moves', readonly=True) + 'wizard_id', 'wt_move_id', 'WT Moves', readonly=True, + default=_default_wt_moves) def generate(self): wt_move_payment_obj = self.env['withholding.tax.move.payment'] @@ -29,6 +24,7 @@ def generate(self): 'l10n_it_withholding_tax_payment', 'view_withholding_move_payment_form') view_id = view[1] or False + return { 'name': _('Withholding Tax Payment'), 'view_type': 'form', @@ -36,5 +32,5 @@ def generate(self): 'res_model': 'withholding.tax.move.payment', 'res_id': wt_payment.id, 'type': 'ir.actions.act_window', - 'view_id': [view_id], + 'view_id': [view_id] } diff --git a/l10n_it_withholding_tax_payment/wizard/create_move_payment_view.xml b/l10n_it_withholding_tax_payment/wizard/create_move_payment_view.xml index 1d843fca9f9c..a381a45c9aa3 100644 --- a/l10n_it_withholding_tax_payment/wizard/create_move_payment_view.xml +++ b/l10n_it_withholding_tax_payment/wizard/create_move_payment_view.xml @@ -1,38 +1,41 @@ + - + Copyright 2010-2013 Akretion (http://www.akretion.com) + @author: Alexis de Lattre + The licence is in the file __manifest__.py - - wizard.wt.move.payment.create.view - wizard.wt.move.payment.create - - - - - - -
-
- -
-
+ Copyright 2010-2013 Alessandro Camilli (http://www.openforce.it) + Copyright 2019 Matteo Bilotta + --> + + - + + wizard.wt.move.payment.create.view + wizard.wt.move.payment.create + +
+ + + + + +
+
+
+
+
+