From fbe4351dbe32561403f70b57af8c6137a82eff57 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 20 Oct 2016 01:41:41 +0200 Subject: [PATCH] Port almost all modules to v10 (#305) Port almost all modules to v10 * Update to EPC Rulebook v9.2 that start to apply on 2016-11-20 (bug #300) --- account_banking_mandate/__manifest__.py | 7 +-- .../data/mandate_reference_sequence.xml | 6 +- .../models/account_banking_mandate.py | 4 +- .../models/account_invoice.py | 2 +- .../models/account_move_line.py | 2 +- .../models/account_payment_line.py | 4 +- .../models/account_payment_method.py | 2 +- .../models/bank_payment_line.py | 2 +- account_banking_mandate/models/res_partner.py | 2 +- .../models/res_partner_bank.py | 2 +- .../security/mandate_security.xml | 12 ++-- .../test/banking_mandate.yml | 35 ----------- account_banking_mandate/tests/__init__.py | 3 + account_banking_mandate/tests/test_mandate.py | 22 +++++++ .../views/account_banking_mandate_view.xml | 11 ++-- .../views/account_invoice_view.xml | 15 +++-- .../views/account_move_line.xml | 11 ++-- .../views/account_payment_line.xml | 4 +- .../views/account_payment_method.xml | 6 +- .../views/bank_payment_line_view.xml | 12 ++-- account_banking_mandate/views/res_partner.xml | 13 ++-- .../views/res_partner_bank_view.xml | 13 ++-- account_banking_mandate_sale/README.rst | 2 +- account_banking_mandate_sale/__manifest__.py | 4 +- .../models/sale_order.py | 2 +- .../views/sale_order.xml | 13 ++-- .../wizard/sale_make_invoice_advance.py | 2 +- account_banking_pain_base/__manifest__.py | 8 +-- .../migrations/8.0.0.2/post-migration.py | 15 ----- account_banking_pain_base/models/__init__.py | 3 +- .../models/account_config_settings.py | 14 +++++ .../models/account_payment_line.py | 2 +- .../models/account_payment_method.py | 4 +- .../models/account_payment_mode.py | 2 +- .../models/account_payment_order.py | 7 +-- .../models/bank_payment_line.py | 4 +- .../models/res_company.py | 31 +++++----- account_banking_pain_base/post_install.py | 13 ++-- .../views/account_config_settings.xml | 24 +++++++ .../views/account_payment_line.xml | 13 ++-- .../views/account_payment_method.xml | 6 +- .../views/account_payment_mode.xml | 11 ++-- .../views/account_payment_order.xml | 13 ++-- .../views/bank_payment_line_view.xml | 13 ++-- .../views/res_company_view.xml | 25 -------- .../README.rst | 2 +- .../__manifest__.py | 6 +- .../data/account_payment_method.xml | 6 +- .../demo/sepa_credit_transfer_demo.xml | 7 +-- .../migrations/8.0.0.3/post-migration.py | 52 ---------------- .../migrations/8.0.0.3/pre-migration.py | 32 ---------- .../models/account_payment_method.py | 2 +- .../models/account_payment_order.py | 4 +- .../post_install.py | 24 +++---- .../tests/test_sct.py | 11 ++-- account_banking_sepa_direct_debit/README.rst | 2 +- .../__manifest__.py | 7 +-- .../data/account_payment_method.xml | 4 +- .../data/mandate_expire_cron.xml | 11 ++-- .../data/report_paperformat.xml | 6 +- .../demo/sepa_direct_debit_demo.xml | 4 +- .../migrations/8.0.0.2/post-migration.py | 50 --------------- .../migrations/8.0.0.2/pre-migration.py | 32 ---------- .../migrations/8.0.0.5/post-migration.py | 13 ---- .../models/account_banking_mandate.py | 2 +- .../models/account_payment_method.py | 2 +- .../models/account_payment_mode.py | 4 +- .../models/account_payment_order.py | 62 ++++++------------- .../models/bank_payment_line.py | 2 +- .../models/res_company.py | 6 +- .../models/res_config.py | 2 +- .../post_install.py | 23 +++---- .../reports/sepa_direct_debit_mandate.xml | 30 +++++---- .../tests/test_sdd.py | 24 ++++--- .../views/account_banking_mandate_view.xml | 12 ++-- .../views/account_payment_mode.xml | 8 +-- .../views/res_company_view.xml | 22 ------- .../views/res_config.xml | 17 +++-- account_payment_mode/README.rst | 2 +- account_payment_mode/__manifest__.py | 4 +- account_payment_mode/demo/payment_demo.xml | 6 +- .../models/account_journal.py | 2 +- .../models/account_payment_method.py | 2 +- .../models/account_payment_mode.py | 4 +- .../models/res_partner_bank.py | 2 +- .../views/account_journal.xml | 2 - .../views/account_payment_method.xml | 2 - .../views/account_payment_mode.xml | 6 +- account_payment_mode/views/res_partner.xml | 6 +- .../views/res_partner_bank.xml | 6 +- account_payment_order/README.rst | 2 +- account_payment_order/__manifest__.py | 6 +- .../data/payment_mode_type.xml | 15 ----- account_payment_order/data/payment_seq.xml | 12 ++-- account_payment_order/demo/payment_demo.xml | 6 +- .../models/account_invoice.py | 4 +- account_payment_order/models/account_move.py | 2 +- .../models/account_move_line.py | 2 +- .../models/account_payment_line.py | 4 +- .../models/account_payment_mode.py | 4 +- .../models/account_payment_order.py | 4 +- .../models/bank_payment_line.py | 6 +- account_payment_order/models/res_bank.py | 6 +- .../security/payment_security.xml | 7 ++- .../views/account_invoice_view.xml | 2 - .../views/account_move_line.xml | 13 ++-- .../views/account_payment_line.xml | 6 +- .../views/account_payment_mode.xml | 7 +-- .../views/account_payment_order.xml | 7 +-- .../views/bank_payment_line.xml | 13 ++-- account_payment_order/views/ir_attachment.xml | 8 +-- .../views/payment_order_create_view.xml | 23 ------- .../account_invoice_payment_line_multi.py | 2 +- .../wizard/account_payment_line_create.py | 2 +- .../account_payment_line_create_view.xml | 12 ++-- account_payment_partner/README.rst | 2 +- account_payment_partner/__manifest__.py | 6 +- account_payment_partner/demo/partner_demo.xml | 7 +-- .../models/account_invoice.py | 2 +- .../models/account_move_line.py | 2 +- account_payment_partner/models/res_partner.py | 2 +- .../views/account_invoice_view.xml | 6 +- .../views/account_move_line.xml | 12 ++-- .../views/report_invoice.xml | 32 +++++----- .../views/res_partner_view.xml | 12 ++-- account_payment_sale/__manifest__.py | 8 +-- account_payment_sale/models/sale_order.py | 2 +- .../views/sale_order_view.xml | 14 ++--- .../wizard/sale_make_invoice_advance.py | 2 +- 129 files changed, 447 insertions(+), 793 deletions(-) delete mode 100644 account_banking_mandate/test/banking_mandate.yml create mode 100644 account_banking_mandate/tests/__init__.py create mode 100644 account_banking_mandate/tests/test_mandate.py delete mode 100644 account_banking_pain_base/migrations/8.0.0.2/post-migration.py create mode 100644 account_banking_pain_base/models/account_config_settings.py create mode 100644 account_banking_pain_base/views/account_config_settings.xml delete mode 100644 account_banking_pain_base/views/res_company_view.xml delete mode 100644 account_banking_sepa_credit_transfer/migrations/8.0.0.3/post-migration.py delete mode 100644 account_banking_sepa_credit_transfer/migrations/8.0.0.3/pre-migration.py delete mode 100644 account_banking_sepa_direct_debit/migrations/8.0.0.2/post-migration.py delete mode 100644 account_banking_sepa_direct_debit/migrations/8.0.0.2/pre-migration.py delete mode 100644 account_banking_sepa_direct_debit/migrations/8.0.0.5/post-migration.py delete mode 100644 account_banking_sepa_direct_debit/views/res_company_view.xml delete mode 100644 account_payment_order/data/payment_mode_type.xml delete mode 100644 account_payment_order/views/payment_order_create_view.xml diff --git a/account_banking_mandate/__manifest__.py b/account_banking_mandate/__manifest__.py index a696b6769..b799cb680 100644 --- a/account_banking_mandate/__manifest__.py +++ b/account_banking_mandate/__manifest__.py @@ -7,10 +7,10 @@ { 'name': 'Account Banking Mandate', 'summary': 'Banking mandates', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'license': 'AGPL-3', 'author': "Compassion CH, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Akretion, " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', @@ -31,6 +31,5 @@ 'security/mandate_security.xml', 'security/ir.model.access.csv', ], - 'test': ['test/banking_mandate.yml'], - 'installable': False, + 'installable': True, } diff --git a/account_banking_mandate/data/mandate_reference_sequence.xml b/account_banking_mandate/data/mandate_reference_sequence.xml index e3df03051..0b78fddfb 100644 --- a/account_banking_mandate/data/mandate_reference_sequence.xml +++ b/account_banking_mandate/data/mandate_reference_sequence.xml @@ -1,6 +1,5 @@ - - + @@ -11,5 +10,4 @@ - - + diff --git a/account_banking_mandate/models/account_banking_mandate.py b/account_banking_mandate/models/account_banking_mandate.py index cd5958d7c..884809606 100644 --- a/account_banking_mandate/models/account_banking_mandate.py +++ b/account_banking_mandate/models/account_banking_mandate.py @@ -4,8 +4,8 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError, ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError, ValidationError class AccountBankingMandate(models.Model): diff --git a/account_banking_mandate/models/account_invoice.py b/account_banking_mandate/models/account_invoice.py index d821ee3e2..d9561ff8e 100644 --- a/account_banking_mandate/models/account_invoice.py +++ b/account_banking_mandate/models/account_invoice.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AccountInvoice(models.Model): diff --git a/account_banking_mandate/models/account_move_line.py b/account_banking_mandate/models/account_move_line.py index 1ededbb6a..52aaef2c7 100644 --- a/account_banking_mandate/models/account_move_line.py +++ b/account_banking_mandate/models/account_move_line.py @@ -2,7 +2,7 @@ # © 2016 Akretion (http://www.akretion.com/) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AccountMoveLine(models.Model): diff --git a/account_banking_mandate/models/account_payment_line.py b/account_banking_mandate/models/account_payment_line.py index 4650b2f98..61969d93d 100644 --- a/account_banking_mandate/models/account_payment_line.py +++ b/account_banking_mandate/models/account_payment_line.py @@ -4,8 +4,8 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError, UserError +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError, UserError class AccountPaymentLine(models.Model): diff --git a/account_banking_mandate/models/account_payment_method.py b/account_banking_mandate/models/account_payment_method.py index 884365210..4bf1f4309 100644 --- a/account_banking_mandate/models/account_payment_method.py +++ b/account_banking_mandate/models/account_payment_method.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountPaymentMethod(models.Model): diff --git a/account_banking_mandate/models/bank_payment_line.py b/account_banking_mandate/models/bank_payment_line.py index 8dd2cbdc8..3d0d1b329 100644 --- a/account_banking_mandate/models/bank_payment_line.py +++ b/account_banking_mandate/models/bank_payment_line.py @@ -4,7 +4,7 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class BankPaymentLine(models.Model): diff --git a/account_banking_mandate/models/res_partner.py b/account_banking_mandate/models/res_partner.py index 3c1fba967..bcc7b3dd7 100644 --- a/account_banking_mandate/models/res_partner.py +++ b/account_banking_mandate/models/res_partner.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class ResPartner(models.Model): diff --git a/account_banking_mandate/models/res_partner_bank.py b/account_banking_mandate/models/res_partner_bank.py index 028a1ddb8..c693ab280 100644 --- a/account_banking_mandate/models/res_partner_bank.py +++ b/account_banking_mandate/models/res_partner_bank.py @@ -3,7 +3,7 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class ResPartnerBank(models.Model): diff --git a/account_banking_mandate/security/mandate_security.xml b/account_banking_mandate/security/mandate_security.xml index 5ca991c0b..2b88bb12b 100644 --- a/account_banking_mandate/security/mandate_security.xml +++ b/account_banking_mandate/security/mandate_security.xml @@ -1,13 +1,11 @@ + - - Banking Mandate multi-company @@ -19,5 +17,5 @@ - - + + diff --git a/account_banking_mandate/test/banking_mandate.yml b/account_banking_mandate/test/banking_mandate.yml deleted file mode 100644 index ae3f1439b..000000000 --- a/account_banking_mandate/test/banking_mandate.yml +++ /dev/null @@ -1,35 +0,0 @@ -- - In order to test mandate, I create a partner with a bank account. - Then, I create a mandate, validate it, cancel it and the set it back to draft - - I create a partner -- - !record {model: res.partner, id: mandate_partner, view: False}: - name: "Mandate test" -- - I create a partner bank account -- - !record {model: res.partner.bank, id: mandate_partner_bank, view: False}: - acc_number: '1234' - partner_id: mandate_partner -- - I create a mandate on 1st January -- - !record {model: account.banking.mandate, id: test_mandate, view: False}: - partner_bank_id: mandate_partner_bank - signature_date: "2014-01-01" - -- - I check that the state field is automatically set by default -- - !assert {model: account.banking.mandate, id: test_mandate}: - - state == 'draft' -- - I go through all states by clicking on buttons and check that cancel state is reached -- - !python {model: account.banking.mandate}: | - self.validate(cr, uid, [ref('test_mandate')]) - self.cancel(cr, uid, [ref('test_mandate')]) - mandate = self.browse(cr, uid, ref('test_mandate')) - assert mandate.state == 'cancel', 'Mandate is not in cancel state' - self.back2draft(cr, uid, [ref('test_mandate')]) diff --git a/account_banking_mandate/tests/__init__.py b/account_banking_mandate/tests/__init__.py new file mode 100644 index 000000000..df3d8d352 --- /dev/null +++ b/account_banking_mandate/tests/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import test_mandate diff --git a/account_banking_mandate/tests/test_mandate.py b/account_banking_mandate/tests/test_mandate.py new file mode 100644 index 000000000..a59e9c048 --- /dev/null +++ b/account_banking_mandate/tests/test_mandate.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestMandate(TransactionCase): + + def test_mandate(self): + bank_account = self.env.ref('account_payment_mode.res_partner_12_iban') + mandate = self.env['account.banking.mandate'].create({ + 'partner_bank_id': bank_account.id, + 'signature_date': '2015-01-01', + }) + self.assertEqual(mandate.state, 'draft') + mandate.validate() + self.assertEqual(mandate.state, 'valid') + mandate.cancel() + self.assertEqual(mandate.state, 'cancel') + mandate.back2draft() + self.assertEqual(mandate.state, 'draft') diff --git a/account_banking_mandate/views/account_banking_mandate_view.xml b/account_banking_mandate/views/account_banking_mandate_view.xml index 682bdf076..71acbe7e5 100644 --- a/account_banking_mandate/views/account_banking_mandate_view.xml +++ b/account_banking_mandate/views/account_banking_mandate_view.xml @@ -1,11 +1,9 @@ - - + @@ -108,5 +106,4 @@ /> - - + diff --git a/account_banking_mandate/views/account_invoice_view.xml b/account_banking_mandate/views/account_invoice_view.xml index 1c1e46647..d02749d25 100644 --- a/account_banking_mandate/views/account_invoice_view.xml +++ b/account_banking_mandate/views/account_invoice_view.xml @@ -1,18 +1,17 @@ - - + + add.mandate.on.customer.invoice.form account.invoice - + @@ -21,5 +20,5 @@ - - + + diff --git a/account_banking_mandate/views/account_move_line.xml b/account_banking_mandate/views/account_move_line.xml index 69d51471d..567fc14e1 100644 --- a/account_banking_mandate/views/account_move_line.xml +++ b/account_banking_mandate/views/account_move_line.xml @@ -1,12 +1,10 @@ - - + @@ -22,5 +20,4 @@ - - + diff --git a/account_banking_mandate/views/account_payment_line.xml b/account_banking_mandate/views/account_payment_line.xml index 55f1c0297..52288f781 100644 --- a/account_banking_mandate/views/account_payment_line.xml +++ b/account_banking_mandate/views/account_payment_line.xml @@ -4,7 +4,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - + account_banking_mandate.account.payment.line.form @@ -33,5 +33,5 @@ - + diff --git a/account_banking_mandate/views/account_payment_method.xml b/account_banking_mandate/views/account_payment_method.xml index 66744a970..b562321ca 100644 --- a/account_banking_mandate/views/account_payment_method.xml +++ b/account_banking_mandate/views/account_payment_method.xml @@ -1,6 +1,5 @@ - - + @@ -16,5 +15,4 @@ - - + diff --git a/account_banking_mandate/views/bank_payment_line_view.xml b/account_banking_mandate/views/bank_payment_line_view.xml index 98ec669a1..f06e0cb18 100644 --- a/account_banking_mandate/views/bank_payment_line_view.xml +++ b/account_banking_mandate/views/bank_payment_line_view.xml @@ -1,11 +1,10 @@ - - + + banking.mandate.bank.payment.line.form @@ -32,5 +31,4 @@ - - + diff --git a/account_banking_mandate/views/res_partner.xml b/account_banking_mandate/views/res_partner.xml index ea0d8a57f..e6df2294e 100644 --- a/account_banking_mandate/views/res_partner.xml +++ b/account_banking_mandate/views/res_partner.xml @@ -1,11 +1,10 @@ - - + + mandate.res.partner.form @@ -22,5 +21,5 @@ - - + + diff --git a/account_banking_mandate/views/res_partner_bank_view.xml b/account_banking_mandate/views/res_partner_bank_view.xml index 60f9cbce1..85c69a550 100644 --- a/account_banking_mandate/views/res_partner_bank_view.xml +++ b/account_banking_mandate/views/res_partner_bank_view.xml @@ -1,11 +1,10 @@ - - + + mandate.res.partner.bank.form @@ -31,5 +30,5 @@ - - + + diff --git a/account_banking_mandate_sale/README.rst b/account_banking_mandate_sale/README.rst index 2e8967e47..2d897d45c 100644 --- a/account_banking_mandate_sale/README.rst +++ b/account_banking_mandate_sale/README.rst @@ -22,7 +22,7 @@ The mandate will be copied from the sale order to the invoice. .. 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/9.0 + :target: https://runbot.odoo-community.org/runbot/173/10.0 Known issues / Roadmap ====================== diff --git a/account_banking_mandate_sale/__manifest__.py b/account_banking_mandate_sale/__manifest__.py index 6b83317f7..031dd003d 100644 --- a/account_banking_mandate_sale/__manifest__.py +++ b/account_banking_mandate_sale/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Account Banking Mandate Sale', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Banking addons', 'license': 'AGPL-3', 'summary': "Adds mandates on sale orders", @@ -18,5 +18,5 @@ 'data': [ 'views/sale_order.xml', ], - 'installable': False, + 'installable': True, } diff --git a/account_banking_mandate_sale/models/sale_order.py b/account_banking_mandate_sale/models/sale_order.py index 5f4fc9cf9..887f55602 100644 --- a/account_banking_mandate_sale/models/sale_order.py +++ b/account_banking_mandate_sale/models/sale_order.py @@ -2,7 +2,7 @@ # © 2014-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import models, fields, api class SaleOrder(models.Model): diff --git a/account_banking_mandate_sale/views/sale_order.xml b/account_banking_mandate_sale/views/sale_order.xml index d14faf64f..a020c1c80 100644 --- a/account_banking_mandate_sale/views/sale_order.xml +++ b/account_banking_mandate_sale/views/sale_order.xml @@ -1,12 +1,10 @@ - - + @@ -14,7 +12,7 @@ sale.order - + @@ -23,5 +21,4 @@ - - + diff --git a/account_banking_mandate_sale/wizard/sale_make_invoice_advance.py b/account_banking_mandate_sale/wizard/sale_make_invoice_advance.py index 0e9d34aa4..c8dba428e 100644 --- a/account_banking_mandate_sale/wizard/sale_make_invoice_advance.py +++ b/account_banking_mandate_sale/wizard/sale_make_invoice_advance.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, api +from odoo import models, api class SaleAdvancePaymentInv(models.TransientModel): diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index e03f149d1..6643f992e 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -7,11 +7,11 @@ { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Antiun Ingeniería S.L., " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', @@ -26,9 +26,9 @@ 'views/account_payment_order.xml', 'views/bank_payment_line_view.xml', 'views/account_payment_mode.xml', - 'views/res_company_view.xml', + 'views/account_config_settings.xml', 'views/account_payment_method.xml', ], 'post_init_hook': 'set_default_initiating_party', - 'installable': False, + 'installable': True, } diff --git a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py deleted file mode 100644 index 1a2815795..000000000 --- a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2015 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openerp.addons.account_banking_pain_base.post_install\ - import set_default_initiating_party -from openerp import pooler - - -def migrate(cr, version): - if not version: - return - - pool = pooler.get_pool(cr.dbname) - set_default_initiating_party(cr, pool) diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index 1e4dfae26..828efee19 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- -# © 2013-2016 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). 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 account_payment_method diff --git a/account_banking_pain_base/models/account_config_settings.py b/account_banking_pain_base/models/account_config_settings.py new file mode 100644 index 000000000..0a7caba0f --- /dev/null +++ b/account_banking_pain_base/models/account_config_settings.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields + + +class AccountConfigSettings(models.TransientModel): + _inherit = 'account.config.settings' + + initiating_party_issuer = fields.Char( + related='company_id.initiating_party_issuer') + initiating_party_identifier = fields.Char( + related='company_id.initiating_party_identifier') diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py index f599860e9..c430b5cff 100644 --- a/account_banking_pain_base/models/account_payment_line.py +++ b/account_banking_pain_base/models/account_payment_line.py @@ -3,7 +3,7 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountPaymentLine(models.Model): diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index 9d9499036..f7623a5d6 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -2,8 +2,8 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError class AccountPaymentMethod(models.Model): diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index e0e628a59..95ff0be79 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -4,7 +4,7 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountPaymentMode(models.Model): diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 917df61dc..4e62f6a99 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -4,12 +4,11 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError -from openerp.tools.safe_eval import safe_eval +from odoo import models, fields, api, _, tools +from odoo.exceptions import UserError +from odoo.tools.safe_eval import safe_eval from datetime import datetime from lxml import etree -from openerp import tools import logging diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index bf802ce6e..dde080637 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre +# © 2013-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class BankPaymentLine(models.Model): diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index aed1c1ca1..82e9d2711 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre +# © 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). -from openerp import models, fields, api +from odoo import models, fields, api import logging logger = logging.getLogger(__name__) @@ -22,32 +22,31 @@ class ResCompany(models.Model): help="This will be used as the 'Initiating Party Identifier' in " "the PAIN files generated by Odoo.") - @api.model - def _default_initiating_party(self, company): - '''This method is called from post_install.py, which itself is also - called from migrations/8.0.0.2/post-migration.py''' + @api.one + def _default_initiating_party(self): + '''This method is called from post_install.py''' party_issuer_per_country = { 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium } logger.debug( - 'Calling _default_initiating_party on company %s', company.name) - country_code = company.country_id.code - if not company.initiating_party_issuer: + 'Calling _default_initiating_party on company %s', self.name) + country_code = self.country_id.code + if not self.initiating_party_issuer: if country_code and country_code in party_issuer_per_country: - company.write({ + self.write({ 'initiating_party_issuer': party_issuer_per_country[country_code]}) logger.info( 'Updated initiating_party_issuer on company %s', - company.name) + self.name) party_identifier = False - if not company.initiating_party_identifier: - if company.vat and country_code: + if not self.initiating_party_identifier: + if self.vat and country_code: if country_code == 'BE': - party_identifier = company.vat[2:].replace(' ', '') + party_identifier = self.vat[2:].replace(' ', '') if party_identifier: - company.write({ + self.write({ 'initiating_party_identifier': party_identifier}) logger.info( 'Updated initiating_party_identifier on company %s', - company.name) + self.name) diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py index 14a9259f9..df73e14d7 100644 --- a/account_banking_pain_base/post_install.py +++ b/account_banking_pain_base/post_install.py @@ -3,13 +3,12 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import SUPERUSER_ID +from odoo import api, SUPERUSER_ID -def set_default_initiating_party(cr, pool): - company_ids = pool['res.company'].search(cr, SUPERUSER_ID, []) - companies = pool['res.company'].browse(cr, SUPERUSER_ID, company_ids) - for company in companies: - pool['res.company']._default_initiating_party( - cr, SUPERUSER_ID, company) +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() return diff --git a/account_banking_pain_base/views/account_config_settings.xml b/account_banking_pain_base/views/account_config_settings.xml new file mode 100644 index 000000000..059b3e02e --- /dev/null +++ b/account_banking_pain_base/views/account_config_settings.xml @@ -0,0 +1,24 @@ + + + + + + + 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 640175857..e84958e63 100644 --- a/account_banking_pain_base/views/account_payment_line.xml +++ b/account_banking_pain_base/views/account_payment_line.xml @@ -1,11 +1,10 @@ - - + + pain.base.account.payment.line @@ -19,5 +18,5 @@ - - + + diff --git a/account_banking_pain_base/views/account_payment_method.xml b/account_banking_pain_base/views/account_payment_method.xml index 8d223b2b0..00685f7d6 100644 --- a/account_banking_pain_base/views/account_payment_method.xml +++ b/account_banking_pain_base/views/account_payment_method.xml @@ -1,6 +1,5 @@ - - + @@ -28,5 +27,4 @@ - - + diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index 29546b84e..5cb2b4d02 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -1,12 +1,10 @@ - - + @@ -23,5 +21,4 @@ - - + diff --git a/account_banking_pain_base/views/account_payment_order.xml b/account_banking_pain_base/views/account_payment_order.xml index e99928637..6c1e02900 100644 --- a/account_banking_pain_base/views/account_payment_order.xml +++ b/account_banking_pain_base/views/account_payment_order.xml @@ -1,11 +1,10 @@ - - + + pain.base.account.payment.order.form @@ -20,5 +19,5 @@ - - + + 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 672e4bbbe..f9496dffd 100644 --- a/account_banking_pain_base/views/bank_payment_line_view.xml +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -1,11 +1,10 @@ - - + + pain.base.bank.payment.line.form @@ -19,5 +18,5 @@ - - + + diff --git a/account_banking_pain_base/views/res_company_view.xml b/account_banking_pain_base/views/res_company_view.xml deleted file mode 100644 index fd3af4755..000000000 --- a/account_banking_pain_base/views/res_company_view.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - pain.group.on.res.company.form - res.company - - - - - - - - - - - - - diff --git a/account_banking_sepa_credit_transfer/README.rst b/account_banking_sepa_credit_transfer/README.rst index 6cdee145d..209255356 100644 --- a/account_banking_sepa_credit_transfer/README.rst +++ b/account_banking_sepa_credit_transfer/README.rst @@ -49,7 +49,7 @@ Transfer that you created during the configuration step. .. 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/9.0 + :target: https://runbot.odoo-community.org/runbot/173/10.0 Known issues / Roadmap ====================== diff --git a/account_banking_sepa_credit_transfer/__manifest__.py b/account_banking_sepa_credit_transfer/__manifest__.py index 9c8cfe01d..26e8ebc85 100644 --- a/account_banking_sepa_credit_transfer/__manifest__.py +++ b/account_banking_sepa_credit_transfer/__manifest__.py @@ -7,10 +7,10 @@ { 'name': 'Account Banking SEPA Credit Transfer', 'summary': 'Create SEPA XML files for Credit Transfers', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Antiun Ingeniería S.L., " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', @@ -24,5 +24,5 @@ 'demo/sepa_credit_transfer_demo.xml' ], 'post_init_hook': 'update_bank_journals', - 'installable': False, + 'installable': True, } diff --git a/account_banking_sepa_credit_transfer/data/account_payment_method.xml b/account_banking_sepa_credit_transfer/data/account_payment_method.xml index 438346067..515314b5a 100644 --- a/account_banking_sepa_credit_transfer/data/account_payment_method.xml +++ b/account_banking_sepa_credit_transfer/data/account_payment_method.xml @@ -1,6 +1,5 @@ - - + @@ -12,5 +11,4 @@ - - + diff --git a/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml b/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml index 224237ed1..c11d6ff76 100644 --- a/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml +++ b/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml @@ -1,7 +1,6 @@ + - - SEPA Credit Transfer to suppliers @@ -21,5 +20,5 @@ - - + + diff --git a/account_banking_sepa_credit_transfer/migrations/8.0.0.3/post-migration.py b/account_banking_sepa_credit_transfer/migrations/8.0.0.3/post-migration.py deleted file mode 100644 index 333651147..000000000 --- a/account_banking_sepa_credit_transfer/migrations/8.0.0.3/post-migration.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import pooler, SUPERUSER_ID - - -def migrate(cr, version): - if not version: - return - - pool = pooler.get_pool(cr.dbname) - cr.execute(''' - SELECT - old_sepa.file, - rel.account_order_id AS payment_order_id, - payment_order.reference - FROM migration_banking_export_sepa old_sepa - LEFT JOIN migration_account_payment_order_sepa_rel rel - ON old_sepa.id=rel.banking_export_sepa_id - LEFT JOIN payment_order ON payment_order.id=rel.account_order_id - ''') - - for sepa_file in cr.dictfetchall(): - if not sepa_file['payment_order_id']: - continue - filename = 'sct_%s.xml' % sepa_file['reference'].replace('/', '-') - pool['ir.attachment'].create( - cr, SUPERUSER_ID, { - 'name': filename, - 'res_id': sepa_file['payment_order_id'], - 'res_model': 'payment.order', - 'datas': str(sepa_file['file']), - }) - return diff --git a/account_banking_sepa_credit_transfer/migrations/8.0.0.3/pre-migration.py b/account_banking_sepa_credit_transfer/migrations/8.0.0.3/pre-migration.py deleted file mode 100644 index f1f5f7b0f..000000000 --- a/account_banking_sepa_credit_transfer/migrations/8.0.0.3/pre-migration.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -def migrate(cr, version): - if not version: - return - - cr.execute( - 'ALTER TABLE banking_export_sepa ' - 'RENAME TO migration_banking_export_sepa') - cr.execute( - 'ALTER TABLE account_payment_order_sepa_rel ' - 'RENAME TO migration_account_payment_order_sepa_rel') diff --git a/account_banking_sepa_credit_transfer/models/account_payment_method.py b/account_banking_sepa_credit_transfer/models/account_payment_method.py index 13f8930db..99dc6d0bf 100644 --- a/account_banking_sepa_credit_transfer/models/account_payment_method.py +++ b/account_banking_sepa_credit_transfer/models/account_payment_method.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AccountPaymentMethod(models.Model): diff --git a/account_banking_sepa_credit_transfer/models/account_payment_order.py b/account_banking_sepa_credit_transfer/models/account_payment_order.py index 85c94c724..6e629112d 100644 --- a/account_banking_sepa_credit_transfer/models/account_payment_order.py +++ b/account_banking_sepa_credit_transfer/models/account_payment_order.py @@ -3,8 +3,8 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api, _ -from openerp.exceptions import UserError +from odoo import models, api, _ +from odoo.exceptions import UserError from lxml import etree diff --git a/account_banking_sepa_credit_transfer/post_install.py b/account_banking_sepa_credit_transfer/post_install.py index 631bef653..573ece934 100644 --- a/account_banking_sepa_credit_transfer/post_install.py +++ b/account_banking_sepa_credit_transfer/post_install.py @@ -2,18 +2,18 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import SUPERUSER_ID +from odoo import api, SUPERUSER_ID -def update_bank_journals(cr, pool): - ajo = pool['account.journal'] - journal_ids = ajo.search( - cr, SUPERUSER_ID, [('type', '=', 'bank')]) - sct_id = pool['ir.model.data'].xmlid_to_res_id( - cr, SUPERUSER_ID, - 'account_banking_sepa_credit_transfer.sepa_credit_transfer') - if sct_id: - ajo.write(cr, SUPERUSER_ID, journal_ids, { - 'outbound_payment_method_ids': [(4, sct_id)], - }) +def update_bank_journals(cr, registry): + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + ajo = env['account.journal'] + journals = ajo.search([('type', '=', 'bank')]) + sct = env.ref( + 'account_banking_sepa_credit_transfer.sepa_credit_transfer') + if sct: + journals.write({ + 'outbound_payment_method_ids': [(4, sct.id)], + }) return diff --git a/account_banking_sepa_credit_transfer/tests/test_sct.py b/account_banking_sepa_credit_transfer/tests/test_sct.py index 76cb72aab..7a5ef853c 100644 --- a/account_banking_sepa_credit_transfer/tests/test_sct.py +++ b/account_banking_sepa_credit_transfer/tests/test_sct.py @@ -2,9 +2,9 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.addons.account.tests.account_test_classes\ +from odoo.addons.account.tests.account_test_classes\ import AccountingTestCase -from openerp.tools import float_compare +from odoo.tools import float_compare import time from lxml import etree @@ -56,6 +56,9 @@ class TestSCT(AccountingTestCase): self.eur_currency = self.env.ref('base.EUR') self.usd_currency = self.env.ref('base.USD') self.main_company.currency_id = self.eur_currency.id + # Trigger the recompute of account type on res.partner.bank + for bank_acc in self.partner_bank_model.search([]): + bank_acc.acc_number = bank_acc.acc_number def test_eur_currency_sct(self): invoice1 = self.create_invoice( @@ -126,7 +129,6 @@ class TestSCT(AccountingTestCase): self.assertEquals(attachment.datas_fname[-4:], '.xml') xml_file = attachment.datas.decode('base64') xml_root = etree.fromstring(xml_file) - # print "xml_file=", etree.tostring(xml_root, pretty_print=True) namespaces = xml_root.nsmap namespaces['p'] = xml_root.nsmap[None] namespaces.pop(None) @@ -204,7 +206,6 @@ class TestSCT(AccountingTestCase): self.assertEquals(attachment.datas_fname[-4:], '.xml') xml_file = attachment.datas.decode('base64') xml_root = etree.fromstring(xml_file) - # print "xml_file=", etree.tostring(xml_root, pretty_print=True) namespaces = xml_root.nsmap namespaces['p'] = xml_root.nsmap[None] namespaces.pop(None) @@ -247,5 +248,5 @@ class TestSCT(AccountingTestCase): 'name': 'Great service', 'account_id': self.account_expense.id, }) - invoice.signal_workflow('invoice_open') + invoice.action_invoice_open() return invoice diff --git a/account_banking_sepa_direct_debit/README.rst b/account_banking_sepa_direct_debit/README.rst index 22f07a8ad..2f3e89b17 100644 --- a/account_banking_sepa_direct_debit/README.rst +++ b/account_banking_sepa_direct_debit/README.rst @@ -47,7 +47,7 @@ you created during the configuration step. .. 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/9.0 + :target: https://runbot.odoo-community.org/runbot/173/10.0 Known issues / Roadmap ====================== diff --git a/account_banking_sepa_direct_debit/__manifest__.py b/account_banking_sepa_direct_debit/__manifest__.py index 5c3525b0a..4b8611b5e 100644 --- a/account_banking_sepa_direct_debit/__manifest__.py +++ b/account_banking_sepa_direct_debit/__manifest__.py @@ -7,10 +7,10 @@ { 'name': 'Account Banking SEPA Direct Debit', 'summary': 'Create SEPA files for Direct Debit', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Antiun Ingeniería S.L., " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', @@ -21,7 +21,6 @@ ], 'data': [ 'views/account_banking_mandate_view.xml', - 'views/res_company_view.xml', 'views/res_config.xml', 'views/account_payment_mode.xml', 'data/mandate_expire_cron.xml', @@ -32,5 +31,5 @@ ], 'demo': ['demo/sepa_direct_debit_demo.xml'], 'post_init_hook': 'update_bank_journals', - 'installable': False, + 'installable': True, } diff --git a/account_banking_sepa_direct_debit/data/account_payment_method.xml b/account_banking_sepa_direct_debit/data/account_payment_method.xml index 67a3339f6..fc72788cb 100644 --- a/account_banking_sepa_direct_debit/data/account_payment_method.xml +++ b/account_banking_sepa_direct_debit/data/account_payment_method.xml @@ -1,5 +1,5 @@ - + @@ -14,4 +14,4 @@ - + diff --git a/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml b/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml index fc411dacf..99f9acb6e 100644 --- a/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml +++ b/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml @@ -1,12 +1,11 @@ - + Set SEPA Direct Debit Mandates to Expired @@ -18,7 +17,7 @@ - + - + diff --git a/account_banking_sepa_direct_debit/data/report_paperformat.xml b/account_banking_sepa_direct_debit/data/report_paperformat.xml index 631dc93f7..f6ce4c94e 100644 --- a/account_banking_sepa_direct_debit/data/report_paperformat.xml +++ b/account_banking_sepa_direct_debit/data/report_paperformat.xml @@ -1,6 +1,5 @@ - - + European A4 low margin for SEPA @@ -18,5 +17,4 @@ 80 - - + diff --git a/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml b/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml index a93f87b3f..05d7fa446 100644 --- a/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml +++ b/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml @@ -1,6 +1,6 @@ - + @@ -46,4 +46,4 @@ - + diff --git a/account_banking_sepa_direct_debit/migrations/8.0.0.2/post-migration.py b/account_banking_sepa_direct_debit/migrations/8.0.0.2/post-migration.py deleted file mode 100644 index dd759cac6..000000000 --- a/account_banking_sepa_direct_debit/migrations/8.0.0.2/post-migration.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import pooler, SUPERUSER_ID - - -def migrate(cr, version): - if not version: - return - - pool = pooler.get_pool(cr.dbname) - cr.execute(''' - SELECT - old_sepa.file, - rel.account_order_id AS payment_order_id, - payment_order.reference - FROM migration_banking_export_sdd old_sepa - LEFT JOIN migration_account_payment_order_sdd_rel rel - ON old_sepa.id=rel.banking_export_sepa_id - LEFT JOIN payment_order ON payment_order.id=rel.account_order_id - ''') - - for sepa_file in cr.dictfetchall(): - filename = 'sdd_%s.xml' % sepa_file['reference'].replace('/', '-') - pool['ir.attachment'].create( - cr, SUPERUSER_ID, { - 'name': filename, - 'res_id': sepa_file['payment_order_id'], - 'res_model': 'payment.order', - 'datas': str(sepa_file['file']), - }) - return diff --git a/account_banking_sepa_direct_debit/migrations/8.0.0.2/pre-migration.py b/account_banking_sepa_direct_debit/migrations/8.0.0.2/pre-migration.py deleted file mode 100644 index 42fa23b0a..000000000 --- a/account_banking_sepa_direct_debit/migrations/8.0.0.2/pre-migration.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -def migrate(cr, version): - if not version: - return - - cr.execute( - 'ALTER TABLE banking_export_sdd ' - 'RENAME TO migration_banking_export_sdd') - cr.execute( - 'ALTER TABLE account_payment_order_sdd_rel ' - 'RENAME TO migration_account_payment_order_sdd_rel') diff --git a/account_banking_sepa_direct_debit/migrations/8.0.0.5/post-migration.py b/account_banking_sepa_direct_debit/migrations/8.0.0.5/post-migration.py deleted file mode 100644 index 958a1af7d..000000000 --- a/account_banking_sepa_direct_debit/migrations/8.0.0.5/post-migration.py +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2016 Sergio Teruel -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - - -def migrate(cr, version): - if not version: - return - - cr.execute(''' - UPDATE account_banking_mandate SET format='sepa' - ''') - return diff --git a/account_banking_sepa_direct_debit/models/account_banking_mandate.py b/account_banking_sepa_direct_debit/models/account_banking_mandate.py index 744903cb6..daabb2d41 100644 --- a/account_banking_sepa_direct_debit/models/account_banking_mandate.py +++ b/account_banking_sepa_direct_debit/models/account_banking_mandate.py @@ -3,7 +3,7 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, exceptions, _ +from odoo import models, fields, api, exceptions, _ from datetime import datetime from dateutil.relativedelta import relativedelta import logging diff --git a/account_banking_sepa_direct_debit/models/account_payment_method.py b/account_banking_sepa_direct_debit/models/account_payment_method.py index c6781cc4f..0249bba37 100644 --- a/account_banking_sepa_direct_debit/models/account_payment_method.py +++ b/account_banking_sepa_direct_debit/models/account_payment_method.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AccountPaymentMethod(models.Model): diff --git a/account_banking_sepa_direct_debit/models/account_payment_mode.py b/account_banking_sepa_direct_debit/models/account_payment_mode.py index 0650736d0..2e13b9a39 100644 --- a/account_banking_sepa_direct_debit/models/account_payment_mode.py +++ b/account_banking_sepa_direct_debit/models/account_payment_mode.py @@ -2,9 +2,9 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ +from odoo import models, fields, api, _ from .common import is_sepa_creditor_identifier_valid -from openerp.exceptions import ValidationError +from odoo.exceptions import ValidationError class AccountPaymentMode(models.Model): diff --git a/account_banking_sepa_direct_debit/models/account_payment_order.py b/account_banking_sepa_direct_debit/models/account_payment_order.py index e68abe27e..09bb5f201 100644 --- a/account_banking_sepa_direct_debit/models/account_payment_order.py +++ b/account_banking_sepa_direct_debit/models/account_payment_order.py @@ -2,8 +2,8 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError from lxml import etree @@ -210,46 +210,24 @@ class AccountPaymentOrder(models.Model): 'line.mandate_id.signature_date', {'line': line}, 10, gen_args=gen_args) if sequence_type == 'FRST' and line.mandate_id.last_debit_date: - previous_bank = self._get_previous_bank(line) - if previous_bank: - amendment_indicator = etree.SubElement( - mandate_related_info, 'AmdmntInd') - amendment_indicator.text = 'true' - amendment_info_details = etree.SubElement( - mandate_related_info, 'AmdmntInfDtls') - if ( - previous_bank.bank_bic == - line.partner_bank_id.bank_bic): - ori_debtor_account = etree.SubElement( - amendment_info_details, 'OrgnlDbtrAcct') - ori_debtor_account_id = etree.SubElement( - ori_debtor_account, 'Id') - ori_debtor_account_iban = etree.SubElement( - ori_debtor_account_id, 'IBAN') - ori_debtor_account_iban.text = self._validate_iban( - self._prepare_field( - 'Original Debtor Account', - 'previous_bank.sanitized_acc_number', - {'previous_bank': previous_bank}, - gen_args=gen_args)) - else: - ori_debtor_agent = etree.SubElement( - amendment_info_details, 'OrgnlDbtrAgt') - ori_debtor_agent_institution = etree.SubElement( - ori_debtor_agent, 'FinInstnId') - ori_debtor_agent_bic = etree.SubElement( - ori_debtor_agent_institution, bic_xml_tag) - ori_debtor_agent_bic.text = self._prepare_field( - 'Original Debtor Agent', - 'previous_bank.bank_bic', - {'previous_bank': previous_bank}, - gen_args=gen_args) - ori_debtor_agent_other = etree.SubElement( - ori_debtor_agent_institution, 'Othr') - ori_debtor_agent_other_id = etree.SubElement( - ori_debtor_agent_other, 'Id') - ori_debtor_agent_other_id.text = 'SMNDA' - # SMNDA = Same Mandate New Debtor Agent + amendment_indicator = etree.SubElement( + mandate_related_info, 'AmdmntInd') + amendment_indicator.text = 'true' + amendment_info_details = etree.SubElement( + mandate_related_info, 'AmdmntInfDtls') + ori_debtor_account = etree.SubElement( + amendment_info_details, 'OrgnlDbtrAcct') + ori_debtor_account_id = etree.SubElement( + ori_debtor_account, 'Id') + ori_debtor_agent_other = etree.SubElement( + ori_debtor_account_id, 'Othr') + ori_debtor_agent_other_id = etree.SubElement( + ori_debtor_agent_other, 'Id') + ori_debtor_agent_other_id.text = 'SMNDA' + # Until 20/11/2016, SMNDA meant + # "Same Mandate New Debtor Agent" + # After 20/11/2016, SMNDA means + # "Same Mandate New Debtor Account" self.generate_party_block( dd_transaction_info, 'Dbtr', 'C', diff --git a/account_banking_sepa_direct_debit/models/bank_payment_line.py b/account_banking_sepa_direct_debit/models/bank_payment_line.py index 0321cf03d..b3076feb4 100644 --- a/account_banking_sepa_direct_debit/models/bank_payment_line.py +++ b/account_banking_sepa_direct_debit/models/bank_payment_line.py @@ -2,7 +2,7 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api +from odoo import models, api class BankPaymentLine(models.Model): diff --git a/account_banking_sepa_direct_debit/models/res_company.py b/account_banking_sepa_direct_debit/models/res_company.py index ac58eb42f..1ce9c3736 100644 --- a/account_banking_sepa_direct_debit/models/res_company.py +++ b/account_banking_sepa_direct_debit/models/res_company.py @@ -4,9 +4,9 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ +from odoo import models, fields, api, _ from .common import is_sepa_creditor_identifier_valid -from openerp.exceptions import ValidationError +from odoo.exceptions import ValidationError class ResCompany(models.Model): @@ -19,8 +19,6 @@ class ResCompany(models.Model): "of :\n- your country ISO code (2 letters)\n- a 2-digits " "checkum\n- a 3-letters business code\n- a country-specific " "identifier") - original_creditor_identifier = fields.Char( - string='Original Creditor Identifier', size=70) @api.multi @api.constrains('sepa_creditor_identifier') diff --git a/account_banking_sepa_direct_debit/models/res_config.py b/account_banking_sepa_direct_debit/models/res_config.py index 229e9fae0..47c311e3b 100644 --- a/account_banking_sepa_direct_debit/models/res_config.py +++ b/account_banking_sepa_direct_debit/models/res_config.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountConfigSettings(models.TransientModel): diff --git a/account_banking_sepa_direct_debit/post_install.py b/account_banking_sepa_direct_debit/post_install.py index 1fbd61793..1ef07020a 100644 --- a/account_banking_sepa_direct_debit/post_install.py +++ b/account_banking_sepa_direct_debit/post_install.py @@ -2,17 +2,18 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import SUPERUSER_ID +from odoo import api, SUPERUSER_ID -def update_bank_journals(cr, pool): - ajo = pool['account.journal'] - journal_ids = ajo.search(cr, SUPERUSER_ID, [('type', '=', 'bank')]) - sdd_id = pool['ir.model.data'].xmlid_to_res_id( - cr, SUPERUSER_ID, - 'account_banking_sepa_direct_debit.sepa_direct_debit') - if sdd_id: - ajo.write(cr, SUPERUSER_ID, journal_ids, { - 'inbound_payment_method_ids': [(4, sdd_id)], - }) +def update_bank_journals(cr, registry): + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + ajo = env['account.journal'] + journals = ajo.search([('type', '=', 'bank')]) + sdd = env.ref( + 'account_banking_sepa_direct_debit.sepa_direct_debit') + if sdd: + journals.write({ + 'inbound_payment_method_ids': [(4, sdd.id)], + }) return diff --git a/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml b/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml index 1d6a9daa2..550d64227 100644 --- a/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml +++ b/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml @@ -1,21 +1,19 @@ - - + - - + - - - + + + - - + diff --git a/account_banking_sepa_direct_debit/tests/test_sdd.py b/account_banking_sepa_direct_debit/tests/test_sdd.py index c7df49b07..a61b0b27a 100644 --- a/account_banking_sepa_direct_debit/tests/test_sdd.py +++ b/account_banking_sepa_direct_debit/tests/test_sdd.py @@ -2,16 +2,17 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.addons.account.tests.account_test_classes\ +from odoo.addons.account.tests.account_test_classes\ import AccountingTestCase -from openerp.tools import float_compare +from odoo.tools import float_compare import time from lxml import etree class TestSDD(AccountingTestCase): - def test_sdd(self): + def setUp(self): + super(TestSDD, self).setUp() self.company = self.env['res.company'] self.account_model = self.env['account.account'] self.move_model = self.env['account.move'] @@ -53,8 +54,13 @@ class TestSDD(AccountingTestCase): 'bank_account_link': 'fixed', 'fixed_journal_id': self.bank_journal.id, }) - eur_currency_id = self.env.ref('base.EUR').id - company.currency_id = eur_currency_id + self.eur_currency_id = self.env.ref('base.EUR').id + company.currency_id = self.eur_currency_id + # Trigger the recompute of account type on res.partner.bank + for bank_acc in self.partner_bank_model.search([]): + bank_acc.acc_number = bank_acc.acc_number + + def test_sdd(self): self.env.ref( 'account_banking_sepa_direct_debit.res_partner_2_mandate').\ recurrent_sequence_type = 'first' @@ -81,7 +87,8 @@ class TestSDD(AccountingTestCase): self.assertEquals(len(pay_lines), 1) agrolait_pay_line1 = pay_lines[0] accpre = self.env['decimal.precision'].precision_get('Account') - self.assertEquals(agrolait_pay_line1.currency_id.id, eur_currency_id) + self.assertEquals( + agrolait_pay_line1.currency_id.id, self.eur_currency_id) self.assertEquals( agrolait_pay_line1.mandate_id, invoice1.mandate_id) self.assertEquals( @@ -100,7 +107,8 @@ class TestSDD(AccountingTestCase): ('partner_id', '=', self.partner_agrolait.id)]) self.assertEquals(len(bank_lines), 1) agrolait_bank_line = bank_lines[0] - self.assertEquals(agrolait_bank_line.currency_id.id, eur_currency_id) + self.assertEquals( + agrolait_bank_line.currency_id.id, self.eur_currency_id) self.assertEquals(float_compare( agrolait_bank_line.amount_currency, 42.0, precision_digits=accpre), 0) @@ -163,5 +171,5 @@ class TestSDD(AccountingTestCase): 'name': 'Great service', 'account_id': self.account_revenue.id, }) - invoice.signal_workflow('invoice_open') + invoice.action_invoice_open() return invoice diff --git a/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml b/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml index c27dcb175..8bf7478e5 100644 --- a/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml +++ b/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml @@ -1,14 +1,12 @@ - - + @@ -62,5 +60,5 @@ - - + + diff --git a/account_banking_sepa_direct_debit/views/account_payment_mode.xml b/account_banking_sepa_direct_debit/views/account_payment_mode.xml index 23eca685f..b7b8faebb 100644 --- a/account_banking_sepa_direct_debit/views/account_payment_mode.xml +++ b/account_banking_sepa_direct_debit/views/account_payment_mode.xml @@ -2,8 +2,8 @@ - - + + Add SEPA identifiers on payment mode form @@ -19,5 +19,5 @@ - - + + diff --git a/account_banking_sepa_direct_debit/views/res_company_view.xml b/account_banking_sepa_direct_debit/views/res_company_view.xml deleted file mode 100644 index 6b4d544ca..000000000 --- a/account_banking_sepa_direct_debit/views/res_company_view.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - sepa_direct_debit.res.company.form - res.company - - - - - - - - - - diff --git a/account_banking_sepa_direct_debit/views/res_config.xml b/account_banking_sepa_direct_debit/views/res_config.xml index 8e37d7eab..94c8e3d77 100644 --- a/account_banking_sepa_direct_debit/views/res_config.xml +++ b/account_banking_sepa_direct_debit/views/res_config.xml @@ -1,21 +1,18 @@ - + sepa_direct_debit.account_config_settings.form account.config.settings - + -
-
-
-
+ + +
-
+
diff --git a/account_payment_mode/README.rst b/account_payment_mode/README.rst index ac0f3a6e4..e5e261973 100644 --- a/account_payment_mode/README.rst +++ b/account_payment_mode/README.rst @@ -20,7 +20,7 @@ This module doesn't add any feature, but it is used by several other modules. .. 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/9.0 + :target: https://runbot.odoo-community.org/runbot/173/10.0 Bug Tracker =========== diff --git a/account_payment_mode/__manifest__.py b/account_payment_mode/__manifest__.py index 199c4fea2..31c881ef0 100644 --- a/account_payment_mode/__manifest__.py +++ b/account_payment_mode/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Account Payment Mode', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', @@ -19,5 +19,5 @@ 'views/account_journal.xml', ], 'demo': ['demo/payment_demo.xml'], - 'installable': False, + 'installable': True, } diff --git a/account_payment_mode/demo/payment_demo.xml b/account_payment_mode/demo/payment_demo.xml index a00c13b34..29b4c2685 100644 --- a/account_payment_mode/demo/payment_demo.xml +++ b/account_payment_mode/demo/payment_demo.xml @@ -1,6 +1,5 @@ - - + Fiducial Banque @@ -106,5 +105,4 @@ - - + diff --git a/account_payment_mode/models/account_journal.py b/account_payment_mode/models/account_journal.py index 6ba0b3626..7e555678a 100644 --- a/account_payment_mode/models/account_journal.py +++ b/account_payment_mode/models/account_journal.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountJournal(models.Model): diff --git a/account_payment_mode/models/account_payment_method.py b/account_payment_mode/models/account_payment_method.py index 748027a4d..6a976e4a6 100644 --- a/account_payment_mode/models/account_payment_method.py +++ b/account_payment_mode/models/account_payment_method.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AccountPaymentMethod(models.Model): diff --git a/account_payment_mode/models/account_payment_mode.py b/account_payment_mode/models/account_payment_mode.py index a1d2e60eb..878a686e0 100644 --- a/account_payment_mode/models/account_payment_mode.py +++ b/account_payment_mode/models/account_payment_mode.py @@ -2,8 +2,8 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError class AccountPaymentMode(models.Model): diff --git a/account_payment_mode/models/res_partner_bank.py b/account_payment_mode/models/res_partner_bank.py index 4e9b0a2a5..fa4ff05f8 100644 --- a/account_payment_mode/models/res_partner_bank.py +++ b/account_payment_mode/models/res_partner_bank.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class ResPartnerBank(models.Model): diff --git a/account_payment_mode/views/account_journal.xml b/account_payment_mode/views/account_journal.xml index b7873ba5d..b3816ba6f 100644 --- a/account_payment_mode/views/account_journal.xml +++ b/account_payment_mode/views/account_journal.xml @@ -1,6 +1,5 @@ - @@ -25,5 +24,4 @@ allow to link to an existing bank account --> - diff --git a/account_payment_mode/views/account_payment_method.xml b/account_payment_mode/views/account_payment_method.xml index f467f01f6..0602e8bc2 100644 --- a/account_payment_mode/views/account_payment_method.xml +++ b/account_payment_mode/views/account_payment_method.xml @@ -1,6 +1,5 @@ - parent="account.account_management_menu" sequence="30" /> - diff --git a/account_payment_mode/views/account_payment_mode.xml b/account_payment_mode/views/account_payment_mode.xml index aa67cb2ec..845641479 100644 --- a/account_payment_mode/views/account_payment_mode.xml +++ b/account_payment_mode/views/account_payment_mode.xml @@ -1,6 +1,5 @@ - - + account.payment.mode.form @@ -68,5 +67,4 @@ parent="account.account_management_menu" sequence="25" /> - - + diff --git a/account_payment_mode/views/res_partner.xml b/account_payment_mode/views/res_partner.xml index b4e308840..9aef62a24 100644 --- a/account_payment_mode/views/res_partner.xml +++ b/account_payment_mode/views/res_partner.xml @@ -1,6 +1,5 @@ - - + - - + diff --git a/account_payment_mode/views/res_partner_bank.xml b/account_payment_mode/views/res_partner_bank.xml index ebdc48ec2..6ccd79778 100644 --- a/account_payment_mode/views/res_partner_bank.xml +++ b/account_payment_mode/views/res_partner_bank.xml @@ -1,6 +1,5 @@ - - + @@ -41,5 +40,4 @@ detect wrong IBANs --> - - + diff --git a/account_payment_order/README.rst b/account_payment_order/README.rst index b752fee40..44afd8afe 100644 --- a/account_payment_order/README.rst +++ b/account_payment_order/README.rst @@ -34,7 +34,7 @@ This module also adds a button *Add to Payment Order* on supplier invoices and a .. 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/9.0 + :target: https://runbot.odoo-community.org/runbot/173/10.0 Known issues / Roadmap ====================== diff --git a/account_payment_order/__manifest__.py b/account_payment_order/__manifest__.py index 429ccf2dc..c40bc5020 100644 --- a/account_payment_order/__manifest__.py +++ b/account_payment_order/__manifest__.py @@ -8,11 +8,11 @@ { 'name': 'Account Payment Order', - 'version': '9.0.1.1.0', + 'version': '10.0.1.1.0', 'license': 'AGPL-3', 'author': "ACSONE SA/NV, " "Therp BV, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Akretion, " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', @@ -37,5 +37,5 @@ 'data/payment_seq.xml', ], 'demo': ['demo/payment_demo.xml'], - 'installable': False, + 'installable': True, } diff --git a/account_payment_order/data/payment_mode_type.xml b/account_payment_order/data/payment_mode_type.xml deleted file mode 100644 index 876778e62..000000000 --- a/account_payment_order/data/payment_mode_type.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - Manual Bank Transfer - BANKMAN - - - payment - - - diff --git a/account_payment_order/data/payment_seq.xml b/account_payment_order/data/payment_seq.xml index 9f89b95af..ff6c704c5 100644 --- a/account_payment_order/data/payment_seq.xml +++ b/account_payment_order/data/payment_seq.xml @@ -1,12 +1,11 @@ - - + @@ -34,5 +33,4 @@ - - + diff --git a/account_payment_order/demo/payment_demo.xml b/account_payment_order/demo/payment_demo.xml index 1644a907a..900abe9e9 100644 --- a/account_payment_order/demo/payment_demo.xml +++ b/account_payment_order/demo/payment_demo.xml @@ -1,6 +1,5 @@ - - + @@ -30,5 +29,4 @@ - - + diff --git a/account_payment_order/models/account_invoice.py b/account_payment_order/models/account_invoice.py index e9cd0fe85..9da340809 100644 --- a/account_payment_order/models/account_invoice.py +++ b/account_payment_order/models/account_invoice.py @@ -4,8 +4,8 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError class AccountInvoice(models.Model): diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py index 1fda02896..85343f413 100644 --- a/account_payment_order/models/account_move.py +++ b/account_payment_order/models/account_move.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountMove(models.Model): diff --git a/account_payment_order/models/account_move_line.py b/account_payment_order/models/account_move_line.py index fa4578e7f..14cb05884 100644 --- a/account_payment_order/models/account_move_line.py +++ b/account_payment_order/models/account_move_line.py @@ -3,7 +3,7 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AccountMoveLine(models.Model): diff --git a/account_payment_order/models/account_payment_line.py b/account_payment_order/models/account_payment_line.py index a938cc7c6..b019c97ff 100644 --- a/account_payment_order/models/account_payment_line.py +++ b/account_payment_order/models/account_payment_line.py @@ -2,8 +2,8 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError class AccountPaymentLine(models.Model): diff --git a/account_payment_order/models/account_payment_mode.py b/account_payment_order/models/account_payment_mode.py index 9773ab8c0..bd97fe5bd 100644 --- a/account_payment_order/models/account_payment_mode.py +++ b/account_payment_order/models/account_payment_mode.py @@ -5,8 +5,8 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError class AccountPaymentMode(models.Model): diff --git a/account_payment_order/models/account_payment_order.py b/account_payment_order/models/account_payment_order.py index c3f18a9e8..403f6a2aa 100644 --- a/account_payment_order/models/account_payment_order.py +++ b/account_payment_order/models/account_payment_order.py @@ -5,8 +5,8 @@ # © 2016 Akretion (Alexis de Lattre - alexis.delattre@akretion.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError, ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError, ValidationError class AccountPaymentOrder(models.Model): diff --git a/account_payment_order/models/bank_payment_line.py b/account_payment_order/models/bank_payment_line.py index 5e95e0667..095975d03 100644 --- a/account_payment_order/models/bank_payment_line.py +++ b/account_payment_order/models/bank_payment_line.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# © 2015 Akretion - Alexis de Lattre +# © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError class BankPaymentLine(models.Model): diff --git a/account_payment_order/models/res_bank.py b/account_payment_order/models/res_bank.py index 44dd6ecdb..0f0c7cdc3 100644 --- a/account_payment_order/models/res_bank.py +++ b/account_payment_order/models/res_bank.py @@ -2,8 +2,8 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api, _ -from openerp.exceptions import ValidationError +from odoo import models, api, _ +from odoo.exceptions import ValidationError class ResBank(models.Model): @@ -19,4 +19,4 @@ class ResBank(models.Model): "contains %d characters, so it is not valid.") % (bank.bic, len(bank.bic))) -# in v9, on res.partner.bank bank_bic is a related of bank_id.bic +# starting from v9, on res.partner.bank bank_bic is a related of bank_id.bic diff --git a/account_payment_order/security/payment_security.xml b/account_payment_order/security/payment_security.xml index 095059f2a..04f3561d5 100644 --- a/account_payment_order/security/payment_security.xml +++ b/account_payment_order/security/payment_security.xml @@ -1,5 +1,5 @@ - + @@ -11,9 +11,9 @@ - + Payment order multi-company rule @@ -26,5 +26,6 @@ ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + - + diff --git a/account_payment_order/views/account_invoice_view.xml b/account_payment_order/views/account_invoice_view.xml index 2ca7919ff..228071395 100644 --- a/account_payment_order/views/account_invoice_view.xml +++ b/account_payment_order/views/account_invoice_view.xml @@ -5,7 +5,6 @@ --> - account_payment_order.invoice_form @@ -58,5 +57,4 @@ view_mode="form" target="new"/> - diff --git a/account_payment_order/views/account_move_line.xml b/account_payment_order/views/account_move_line.xml index 1179fe817..39dc7d848 100644 --- a/account_payment_order/views/account_move_line.xml +++ b/account_payment_order/views/account_move_line.xml @@ -1,13 +1,11 @@ - - - + @@ -24,5 +22,4 @@ - - + diff --git a/account_payment_order/views/account_payment_line.xml b/account_payment_order/views/account_payment_line.xml index c1155ac03..54b89ba5e 100644 --- a/account_payment_order/views/account_payment_line.xml +++ b/account_payment_order/views/account_payment_line.xml @@ -1,6 +1,5 @@ - - + @@ -65,5 +64,4 @@ - - + diff --git a/account_payment_order/views/account_payment_mode.xml b/account_payment_order/views/account_payment_mode.xml index 966f7b987..c8f3b628c 100644 --- a/account_payment_order/views/account_payment_mode.xml +++ b/account_payment_order/views/account_payment_mode.xml @@ -1,6 +1,5 @@ - - + @@ -70,5 +69,5 @@ - - + + diff --git a/account_payment_order/views/account_payment_order.xml b/account_payment_order/views/account_payment_order.xml index eec3c0e83..8846f0cc6 100644 --- a/account_payment_order/views/account_payment_order.xml +++ b/account_payment_order/views/account_payment_order.xml @@ -1,6 +1,5 @@ - - + @@ -159,5 +158,5 @@ - - + + diff --git a/account_payment_order/views/bank_payment_line.xml b/account_payment_order/views/bank_payment_line.xml index f5ce6742a..e045b3838 100644 --- a/account_payment_order/views/bank_payment_line.xml +++ b/account_payment_order/views/bank_payment_line.xml @@ -1,10 +1,9 @@ - - + @@ -79,5 +78,5 @@ - - + + diff --git a/account_payment_order/views/ir_attachment.xml b/account_payment_order/views/ir_attachment.xml index 98f5ac991..9d88181d0 100644 --- a/account_payment_order/views/ir_attachment.xml +++ b/account_payment_order/views/ir_attachment.xml @@ -1,7 +1,7 @@ - - + + ir.attachment.simplified.form @@ -28,5 +28,5 @@ - - + + diff --git a/account_payment_order/views/payment_order_create_view.xml b/account_payment_order/views/payment_order_create_view.xml deleted file mode 100644 index 8a6d69a47..000000000 --- a/account_payment_order/views/payment_order_create_view.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - add.context.to.display.maturity.date - payment.order.create - - - - {'journal_type': 'sale'} - 1 - - - - - - diff --git a/account_payment_order/wizard/account_invoice_payment_line_multi.py b/account_payment_order/wizard/account_invoice_payment_line_multi.py index 0abd67669..8b9df7c82 100644 --- a/account_payment_order/wizard/account_invoice_payment_line_multi.py +++ b/account_payment_order/wizard/account_invoice_payment_line_multi.py @@ -2,7 +2,7 @@ # © 2016 Akretion () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api +from odoo import models, api class AccountInvoicePaymentLineMulti(models.TransientModel): diff --git a/account_payment_order/wizard/account_payment_line_create.py b/account_payment_order/wizard/account_payment_line_create.py index 0737b022e..a7e536284 100644 --- a/account_payment_order/wizard/account_payment_line_create.py +++ b/account_payment_order/wizard/account_payment_line_create.py @@ -5,7 +5,7 @@ # © 2015-2016 Akretion () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ +from odoo import models, fields, api, _ class AccountPaymentLineCreate(models.TransientModel): diff --git a/account_payment_order/wizard/account_payment_line_create_view.xml b/account_payment_order/wizard/account_payment_line_create_view.xml index b53cca822..89227da2b 100644 --- a/account_payment_order/wizard/account_payment_line_create_view.xml +++ b/account_payment_order/wizard/account_payment_line_create_view.xml @@ -1,11 +1,11 @@ - - + + account_payment_line_create.form @@ -61,5 +61,5 @@ new - - + + diff --git a/account_payment_partner/README.rst b/account_payment_partner/README.rst index 704ca358a..4e9e8e684 100644 --- a/account_payment_partner/README.rst +++ b/account_payment_partner/README.rst @@ -38,7 +38,7 @@ Invoices without any payment mode are displayed to. .. 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/9.0 + :target: https://runbot.odoo-community.org/runbot/173/10.0 Known issues / Roadmap ====================== diff --git a/account_payment_partner/__manifest__.py b/account_payment_partner/__manifest__.py index c718d8c99..59484804b 100644 --- a/account_payment_partner/__manifest__.py +++ b/account_payment_partner/__manifest__.py @@ -5,12 +5,12 @@ { 'name': 'Account Payment Partner', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Banking addons', 'license': 'AGPL-3', 'summary': 'Adds payment mode on partners and invoices', 'author': "Akretion, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', 'depends': ['account_payment_mode'], @@ -21,5 +21,5 @@ 'views/report_invoice.xml', ], 'demo': ['demo/partner_demo.xml'], - 'installable': False, + 'installable': True, } diff --git a/account_payment_partner/demo/partner_demo.xml b/account_payment_partner/demo/partner_demo.xml index 20545d978..bf5b8b751 100644 --- a/account_payment_partner/demo/partner_demo.xml +++ b/account_payment_partner/demo/partner_demo.xml @@ -1,7 +1,6 @@ + - - Default Supplier Payment Mode @@ -21,5 +20,5 @@ - - + + diff --git a/account_payment_partner/models/account_invoice.py b/account_payment_partner/models/account_invoice.py index 14ac17a77..6f33546e3 100644 --- a/account_payment_partner/models/account_invoice.py +++ b/account_payment_partner/models/account_invoice.py @@ -3,7 +3,7 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AccountInvoice(models.Model): diff --git a/account_payment_partner/models/account_move_line.py b/account_payment_partner/models/account_move_line.py index 080e73369..e5fa4d492 100644 --- a/account_payment_partner/models/account_move_line.py +++ b/account_payment_partner/models/account_move_line.py @@ -2,7 +2,7 @@ # © 2016 Akretion (http://www.akretion.com/) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountMoveLine(models.Model): diff --git a/account_payment_partner/models/res_partner.py b/account_payment_partner/models/res_partner.py index b7a35e93c..9b8357141 100644 --- a/account_payment_partner/models/res_partner.py +++ b/account_payment_partner/models/res_partner.py @@ -3,7 +3,7 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class ResPartner(models.Model): diff --git a/account_payment_partner/views/account_invoice_view.xml b/account_payment_partner/views/account_invoice_view.xml index 0e59c514d..b2553be57 100644 --- a/account_payment_partner/views/account_invoice_view.xml +++ b/account_payment_partner/views/account_invoice_view.xml @@ -5,7 +5,6 @@ --> - account_payment_partner.account_invoice_search @@ -25,7 +24,7 @@ account.invoice - + @@ -43,7 +42,7 @@ account.invoice - + @@ -81,5 +80,4 @@ - diff --git a/account_payment_partner/views/account_move_line.xml b/account_payment_partner/views/account_move_line.xml index b0d0ca102..51cba50df 100644 --- a/account_payment_partner/views/account_move_line.xml +++ b/account_payment_partner/views/account_move_line.xml @@ -1,13 +1,12 @@ - - + @@ -24,5 +23,4 @@ - - + diff --git a/account_payment_partner/views/report_invoice.xml b/account_payment_partner/views/report_invoice.xml index 9368238f1..068dbf672 100644 --- a/account_payment_partner/views/report_invoice.xml +++ b/account_payment_partner/views/report_invoice.xml @@ -1,17 +1,17 @@ - - - - - + + + + + diff --git a/account_payment_partner/views/res_partner_view.xml b/account_payment_partner/views/res_partner_view.xml index 3d06ee856..bf545cb1d 100644 --- a/account_payment_partner/views/res_partner_view.xml +++ b/account_payment_partner/views/res_partner_view.xml @@ -1,12 +1,11 @@ - - + @@ -24,5 +23,4 @@ - - + diff --git a/account_payment_sale/__manifest__.py b/account_payment_sale/__manifest__.py index adf320b1d..c2b3ee8af 100644 --- a/account_payment_sale/__manifest__.py +++ b/account_payment_sale/__manifest__.py @@ -5,22 +5,22 @@ { 'name': 'Account Payment Sale', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Banking addons', 'license': 'AGPL-3', 'summary': "Adds payment mode on sale orders", 'author': "Akretion, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', 'depends': [ 'sale', - 'account_payment_partner' + 'account_payment_partner', ], 'conflicts': ['sale_payment'], 'data': [ 'views/sale_order_view.xml', ], - 'installable': False, + 'installable': True, 'auto_install': True, } diff --git a/account_payment_sale/models/sale_order.py b/account_payment_sale/models/sale_order.py index 5581ea850..2335db5c3 100644 --- a/account_payment_sale/models/sale_order.py +++ b/account_payment_sale/models/sale_order.py @@ -2,7 +2,7 @@ # © 2014-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import models, fields, api class SaleOrder(models.Model): diff --git a/account_payment_sale/views/sale_order_view.xml b/account_payment_sale/views/sale_order_view.xml index c002971d1..005849e83 100644 --- a/account_payment_sale/views/sale_order_view.xml +++ b/account_payment_sale/views/sale_order_view.xml @@ -1,13 +1,11 @@ - - - + + account_payment_sale.sale_order.form @@ -22,5 +20,5 @@ - - + + diff --git a/account_payment_sale/wizard/sale_make_invoice_advance.py b/account_payment_sale/wizard/sale_make_invoice_advance.py index a962e49c5..376a10fa0 100644 --- a/account_payment_sale/wizard/sale_make_invoice_advance.py +++ b/account_payment_sale/wizard/sale_make_invoice_advance.py @@ -2,7 +2,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, api +from odoo import models, api class SaleAdvancePaymentInv(models.TransientModel):