diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index c81a1df7d..c24b1e059 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -25,15 +25,15 @@ This module is part of the OCA/bank-payment suite. Configuration ============= -#. Go to Accounting > Configuration > Settings. +#. Go to Invoicing/Accounting > Configuration > Settings. #. On the fields "Initiating Party Issuer" and "Initiating Party Identifier", in the section *SEPA/PAIN*, you can fill the corresponding identifiers. If your country requires several identifiers (like Spain), you must: -#. Go to *Accounting > Configuration > Settings*. +#. Go to *Invoicing/Accounting > Configuration > Settings*. #. On the section *SEPA/PAIN*, check the mark "Multiple identifiers". -#. Now go to *Accounting > Configuration > Management > Payment Modes*. +#. Now go to *Invoicing/Accounting > Configuration > Management > Payment Modes*. #. Create a payment mode for your specific bank. #. Fill the specific identifiers on the fields "Initiating Party Identifier" and "Initiating Party Issuer". @@ -45,7 +45,7 @@ See 'readme' files of the OCA/bank-payment suite. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/173/10.0 + :target: https://runbot.odoo-community.org/runbot/173/11.0 Known issues / Roadmap ====================== @@ -79,7 +79,7 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py index 44319ee0a..dd2c1ae77 100644 --- a/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- # © 2013 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models from .post_install import set_default_initiating_party diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index 750b5808e..becfce31b 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -1,13 +1,12 @@ -# -*- coding: utf-8 -*- # Copyright 2013-2016 Akretion - Alexis de Lattre # Copyright 2014-2017 Tecnativa - Pedro M. Baeza # Copyright 2016 Tecnativa - Antonio Espinosa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '10.0.1.1.0', + 'version': '11.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " @@ -25,7 +24,7 @@ 'views/account_payment_order.xml', 'views/bank_payment_line_view.xml', 'views/account_payment_mode.xml', - 'views/account_config_settings.xml', + 'views/res_config_settings.xml', 'views/account_payment_method.xml', ], 'post_init_hook': 'set_default_initiating_party', diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index 828efee19..5e5e13d56 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- - from . import account_payment_line from . import account_payment_order from . import bank_payment_line from . import account_payment_mode from . import res_company -from . import account_config_settings +from . import res_config_settings from . import account_payment_method diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py index a460b9551..589c3617b 100644 --- a/account_banking_pain_base/models/account_payment_line.py +++ b/account_banking_pain_base/models/account_payment_line.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index f7623a5d6..07f9b6f22 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # © 2016 Akretion (Alexis de Lattre ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, _ from odoo.exceptions import UserError diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index 95ff0be79..431ebc490 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 751096e22..21e6f81f4 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, _, tools from odoo.exceptions import UserError @@ -108,7 +107,7 @@ class AccountPaymentOrder(models.Model): else: raise UserError( _("Cannot compute the '%s'.") % field_name) - if not isinstance(value, (str, unicode)): + if not isinstance(value, str): raise UserError( _("The type of the field '%s' is %s. It should be a string " "or unicode.") @@ -130,7 +129,7 @@ class AccountPaymentOrder(models.Model): try: root_to_validate = etree.fromstring(xml_string) official_pain_schema.assertValid(root_to_validate) - except Exception, e: + except Exception as e: logger.warning( "The XML file is invalid against the XML Schema Definition") logger.warning(xml_string) @@ -141,7 +140,7 @@ class AccountPaymentOrder(models.Model): "full error have been written in the server logs. Here " "is the error, which may give you an idea on the cause " "of the problem : %s") - % unicode(e)) + % str(e)) return True @api.multi @@ -189,7 +188,7 @@ class AccountPaymentOrder(models.Model): # batch_booking is in "Group header" with pain.001.001.02 # and in "Payment info" in pain.001.001.03/04 batch_booking = etree.SubElement(group_header, 'BtchBookg') - batch_booking.text = unicode(self.batch_booking).lower() + batch_booking.text = str(self.batch_booking).lower() nb_of_transactions = etree.SubElement( group_header, 'NbOfTxs') control_sum = etree.SubElement(group_header, 'CtrlSum') @@ -217,7 +216,7 @@ class AccountPaymentOrder(models.Model): control_sum = False if gen_args.get('pain_flavor') != 'pain.001.001.02': batch_booking = etree.SubElement(payment_info, 'BtchBookg') - batch_booking.text = unicode(self.batch_booking).lower() + batch_booking.text = str(self.batch_booking).lower() # The "SEPA Customer-to-bank # Implementation guidelines" for SCT and SDD says that control sum # and nb_of_transactions should be present diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index c055ac5b4..809f75dbb 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index 82e9d2711..127d8e179 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2013 Noviat (http://www.noviat.com) - Luc de Meyer # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api +from odoo import models, fields import logging logger = logging.getLogger(__name__) @@ -22,9 +21,9 @@ class ResCompany(models.Model): help="This will be used as the 'Initiating Party Identifier' in " "the PAIN files generated by Odoo.") - @api.one def _default_initiating_party(self): '''This method is called from post_install.py''' + self.ensure_one() party_issuer_per_country = { 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium } diff --git a/account_banking_pain_base/models/account_config_settings.py b/account_banking_pain_base/models/res_config_settings.py similarity index 74% rename from account_banking_pain_base/models/account_config_settings.py rename to account_banking_pain_base/models/res_config_settings.py index ed8c17da3..c59e4569d 100644 --- a/account_banking_pain_base/models/account_config_settings.py +++ b/account_banking_pain_base/models/res_config_settings.py @@ -1,13 +1,12 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Akretion - Alexis de Lattre # Copyright 2017 Tecnativa - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models -class AccountConfigSettings(models.TransientModel): - _inherit = 'account.config.settings' +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' initiating_party_issuer = fields.Char( related='company_id.initiating_party_issuer') diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py index df73e14d7..c438db127 100644 --- a/account_banking_pain_base/post_install.py +++ b/account_banking_pain_base/post_install.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # © 2015-2016 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, SUPERUSER_ID @@ -9,6 +8,6 @@ from odoo import api, SUPERUSER_ID def set_default_initiating_party(cr, registry): with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {}) - companies = env['res.company'].search([]) - companies._default_initiating_party() + for company in env['res.company'].search([]): + company._default_initiating_party() return diff --git a/account_banking_pain_base/views/account_config_settings.xml b/account_banking_pain_base/views/account_config_settings.xml deleted file mode 100644 index 9cdd2548e..000000000 --- a/account_banking_pain_base/views/account_config_settings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - pain.group.on.account.config.settings - account.config.settings - - - - - - - - - - - - - - diff --git a/account_banking_pain_base/views/account_payment_line.xml b/account_banking_pain_base/views/account_payment_line.xml index 925f43e49..8f8b154df 100644 --- a/account_banking_pain_base/views/account_payment_line.xml +++ b/account_banking_pain_base/views/account_payment_line.xml @@ -1,7 +1,7 @@ diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index 67f796329..5401bde00 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -2,7 +2,7 @@ diff --git a/account_banking_pain_base/views/account_payment_order.xml b/account_banking_pain_base/views/account_payment_order.xml index 6c1e02900..59c886dab 100644 --- a/account_banking_pain_base/views/account_payment_order.xml +++ b/account_banking_pain_base/views/account_payment_order.xml @@ -1,7 +1,7 @@ diff --git a/account_banking_pain_base/views/bank_payment_line_view.xml b/account_banking_pain_base/views/bank_payment_line_view.xml index d6d05a9b3..5ed993f0e 100644 --- a/account_banking_pain_base/views/bank_payment_line_view.xml +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -1,7 +1,7 @@ diff --git a/account_banking_pain_base/views/res_config_settings.xml b/account_banking_pain_base/views/res_config_settings.xml new file mode 100644 index 000000000..a5942fb52 --- /dev/null +++ b/account_banking_pain_base/views/res_config_settings.xml @@ -0,0 +1,44 @@ + + + + + pain.group.on.account.config.settings + res.config.settings + + + +

SEPA/PAIN

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + +
diff --git a/setup/account_banking_pain_base/odoo/__init__.py b/setup/account_banking_pain_base/odoo/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/account_banking_pain_base/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_banking_pain_base/odoo/addons/__init__.py b/setup/account_banking_pain_base/odoo/addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/account_banking_pain_base/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_banking_pain_base/odoo/addons/account_banking_pain_base b/setup/account_banking_pain_base/odoo/addons/account_banking_pain_base new file mode 120000 index 000000000..41b3cc95f --- /dev/null +++ b/setup/account_banking_pain_base/odoo/addons/account_banking_pain_base @@ -0,0 +1 @@ +../../../../account_banking_pain_base \ No newline at end of file diff --git a/setup/account_banking_pain_base/setup.cfg b/setup/account_banking_pain_base/setup.cfg new file mode 100644 index 000000000..3c6e79cf3 --- /dev/null +++ b/setup/account_banking_pain_base/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/setup/account_banking_pain_base/setup.py b/setup/account_banking_pain_base/setup.py new file mode 100644 index 000000000..999b290c8 --- /dev/null +++ b/setup/account_banking_pain_base/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) \ No newline at end of file