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 0d09698af..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 @@
-
-
+
+