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)
This commit is contained in:
Alexis de Lattre
2016-10-20 01:41:41 +02:00
committed by Stefan Rijnhart
parent 03bc7c4ea1
commit ff853f6f73
22 changed files with 81 additions and 109 deletions

View File

@@ -1,16 +1,16 @@
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2014 Tecnativa - Pedro M. Baeza
# © 2015-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# 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,
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">
<record id="dd_mandate_seq" model="ir.sequence">
@@ -11,5 +10,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -4,8 +4,8 @@
# © 2015-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 AccountBankingMandate(models.Model):

View File

@@ -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):

View File

@@ -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):

View File

@@ -4,8 +4,8 @@
# © 2015-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 ValidationError, UserError
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, UserError
class AccountPaymentLine(models.Model):

View File

@@ -2,7 +2,7 @@
# © 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
from odoo import models, fields
class AccountPaymentMethod(models.Model):

View File

@@ -4,7 +4,7 @@
# © 2015-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 odoo import models, fields, api
class BankPaymentLine(models.Model):

View File

@@ -2,7 +2,7 @@
# © 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 odoo import models, fields, api
class ResPartner(models.Model):

View File

@@ -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):

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<openerp>
<data noupdate="1">
<record id="account_banking_mandate_rule" model="ir.rule">
<field name="name">Banking Mandate multi-company</field>
@@ -19,5 +17,5 @@
<field name="perm_create" eval="True"/>
</record>
</data>
</openerp>
</odoo>

View File

@@ -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')])

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import test_mandate

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# 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')

View File

@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="view_mandate_form" model="ir.ui.view">
@@ -108,5 +106,4 @@
/>
</data>
</openerp>
</odoo>

View File

@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="invoice_form" model="ir.ui.view">
<field name="name">add.mandate.on.customer.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_payment_partner.invoice_form"/>
<field name="arch" type="xml">
<field name="payment_mode_id" position="after">
<field name="partner_bank_id" position="after">
<field name="mandate_id"
domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid')]"
attrs="{'required': [('mandate_required', '=', True)], 'invisible': [('mandate_required', '=', False)]}"/>
@@ -21,5 +20,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="view_move_line_form" model="ir.ui.view">
@@ -22,5 +20,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -4,7 +4,7 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<data>
<record id="account_payment_line_form" model="ir.ui.view">
<field name="name">account_banking_mandate.account.payment.line.form</field>
@@ -33,5 +33,5 @@
</field>
</record>
</data>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="account_payment_method_form" model="ir.ui.view">
@@ -16,5 +15,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="bank_payment_line_form" model="ir.ui.view">
<field name="name">banking.mandate.bank.payment.line.form</field>
@@ -32,5 +31,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="partner_view_buttons" model="ir.ui.view">
<field name="name">mandate.res.partner.form</field>
@@ -22,5 +21,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="mandate_partner_bank_form" model="ir.ui.view">
<field name="name">mandate.res.partner.bank.form</field>
@@ -31,5 +30,5 @@
</field>
</record>
</data>
</openerp>
</odoo>