diff --git a/account_banking_mandate/__openerp__.py b/account_banking_mandate/__manifest__.py similarity index 85% rename from account_banking_mandate/__openerp__.py rename to account_banking_mandate/__manifest__.py index 864781e95f13..a7d0a871f984 100644 --- a/account_banking_mandate/__openerp__.py +++ b/account_banking_mandate/__manifest__.py @@ -1,16 +1,16 @@ # -*- coding: utf-8 -*- # © 2014 Compassion CH - Cyril Sester -# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2014 Tecnativa - Pedro M. Baeza # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { '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': True, } diff --git a/account_banking_mandate/data/mandate_reference_sequence.xml b/account_banking_mandate/data/mandate_reference_sequence.xml index e3df030519de..0b78fddfb922 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 cd5958d7c4c9..8848096065a9 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 d821ee3e2185..d9561ff8ec3f 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 1ededbb6ad51..52aaef2c748d 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 4650b2f98196..61969d93d35f 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 88436521068c..4bf1f4309bfd 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 8dd2cbdc81d7..3d0d1b3295c9 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 3c1fba967f63..bcc7b3dd74d1 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 028a1ddb8feb..c693ab280dfb 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 5ca991c0bdca..2b88bb12bd51 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 0d09698af4da..000000000000 --- 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 000000000000..df3d8d35210a --- /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 000000000000..a59e9c048a5c --- /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 682bdf076f03..71acbe7e526c 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 1c1e46647a65..d02749d25f5c 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 69d51471debd..567fc14e1ef3 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 55f1c0297d6a..52288f781218 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 66744a970796..b562321cac70 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 98ec669a106e..f06e0cb18d0a 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 ea0d8a57fb3f..e6df2294e3f5 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 60f9cbce1174..85c69a5505d2 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 @@ - - + +