Skip to content

Commit 6fbc4c2

Browse files
Alexis de Lattregfcapalbo
Alexis de Lattre
authored andcommitted
Port almost all modules to v10 (OCA#305)
Port almost all modules to v10 * Update to EPC Rulebook v9.2 that start to apply on 2016-11-20 (bug OCA#300)
1 parent 824f537 commit 6fbc4c2

18 files changed

+98
-113
lines changed

account_banking_pain_base/__openerp__.py renamed to account_banking_pain_base/__manifest__.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# -*- coding: utf-8 -*-
22
# © 2013-2016 Akretion - Alexis de Lattre <[email protected]>
3-
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
4-
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
3+
# © 2014 Tecnativa - Pedro M. Baeza
4+
# © 2016 Tecnativa - Antonio Espinosa
55
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66

77
{
88
'name': 'Account Banking PAIN Base Module',
99
'summary': 'Base module for PAIN file generation',
10-
'version': '9.0.1.0.0',
10+
'version': '10.0.1.0.0',
1111
'license': 'AGPL-3',
1212
'author': "Akretion, "
1313
"Noviat, "
14-
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
15-
"Antiun Ingeniería S.L., "
14+
"Tecnativa, "
1615
"Odoo Community Association (OCA)",
1716
'website': 'https://github.com/OCA/bank-payment',
1817
'contributors': ['Pedro M. Baeza <[email protected]>'],
@@ -26,7 +25,7 @@
2625
'views/account_payment_order.xml',
2726
'views/bank_payment_line_view.xml',
2827
'views/account_payment_mode.xml',
29-
'views/res_company_view.xml',
28+
'views/account_config_settings.xml',
3029
'views/account_payment_method.xml',
3130
],
3231
'post_init_hook': 'set_default_initiating_party',

account_banking_pain_base/migrations/8.0.0.2/post-migration.py

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# -*- coding: utf-8 -*-
2-
# © 2013-2016 Akretion - Alexis de Lattre <[email protected]>
3-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
42

53
from . import account_payment_line
64
from . import account_payment_order
75
from . import bank_payment_line
86
from . import account_payment_mode
97
from . import res_company
8+
from . import account_config_settings
109
from . import account_payment_method
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- coding: utf-8 -*-
2+
# © 2016 Akretion - Alexis de Lattre <[email protected]>
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
from odoo import models, fields
6+
7+
8+
class AccountConfigSettings(models.TransientModel):
9+
_inherit = 'account.config.settings'
10+
11+
initiating_party_issuer = fields.Char(
12+
related='company_id.initiating_party_issuer')
13+
initiating_party_identifier = fields.Char(
14+
related='company_id.initiating_party_identifier')

account_banking_pain_base/models/account_payment_line.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
44
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
55

6-
from openerp import models, fields
6+
from odoo import models, fields
77

88

99
class AccountPaymentLine(models.Model):

account_banking_pain_base/models/account_payment_method.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# © 2016 Akretion (Alexis de Lattre <[email protected]>)
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44

5-
from openerp import models, fields, api, _
6-
from openerp.exceptions import UserError
5+
from odoo import models, fields, api, _
6+
from odoo.exceptions import UserError
77

88

99
class AccountPaymentMethod(models.Model):

account_banking_pain_base/models/account_payment_mode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
55
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66

7-
from openerp import models, fields
7+
from odoo import models, fields
88

99

1010
class AccountPaymentMode(models.Model):

account_banking_pain_base/models/account_payment_order.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
55
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66

7-
from openerp import models, fields, api, _
8-
from openerp.exceptions import UserError
9-
from openerp.tools.safe_eval import safe_eval
7+
from odoo import models, fields, api, _, tools
8+
from odoo.exceptions import UserError
9+
from odoo.tools.safe_eval import safe_eval
1010
from datetime import datetime
1111
from lxml import etree
12-
from openerp import tools
1312
import logging
1413

1514

account_banking_pain_base/models/bank_payment_line.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
2-
# © 2013-2015 Akretion - Alexis de Lattre <[email protected]>
2+
# © 2013-2016 Akretion - Alexis de Lattre <[email protected]>
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44

5-
from openerp import models, fields, api
5+
from odoo import models, fields, api
66

77

88
class BankPaymentLine(models.Model):
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
2-
# © 2013-2015 Akretion - Alexis de Lattre <[email protected]>
2+
# © 2013-2016 Akretion - Alexis de Lattre <[email protected]>
33
# © 2013 Noviat (http://www.noviat.com) - Luc de Meyer
44
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
55
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66

7-
from openerp import models, fields, api
7+
from odoo import models, fields, api
88
import logging
99

1010
logger = logging.getLogger(__name__)
@@ -22,32 +22,31 @@ class ResCompany(models.Model):
2222
help="This will be used as the 'Initiating Party Identifier' in "
2323
"the PAIN files generated by Odoo.")
2424

25-
@api.model
26-
def _default_initiating_party(self, company):
27-
'''This method is called from post_install.py, which itself is also
28-
called from migrations/8.0.0.2/post-migration.py'''
25+
@api.one
26+
def _default_initiating_party(self):
27+
'''This method is called from post_install.py'''
2928
party_issuer_per_country = {
3029
'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium
3130
}
3231
logger.debug(
33-
'Calling _default_initiating_party on company %s', company.name)
34-
country_code = company.country_id.code
35-
if not company.initiating_party_issuer:
32+
'Calling _default_initiating_party on company %s', self.name)
33+
country_code = self.country_id.code
34+
if not self.initiating_party_issuer:
3635
if country_code and country_code in party_issuer_per_country:
37-
company.write({
36+
self.write({
3837
'initiating_party_issuer':
3938
party_issuer_per_country[country_code]})
4039
logger.info(
4140
'Updated initiating_party_issuer on company %s',
42-
company.name)
41+
self.name)
4342
party_identifier = False
44-
if not company.initiating_party_identifier:
45-
if company.vat and country_code:
43+
if not self.initiating_party_identifier:
44+
if self.vat and country_code:
4645
if country_code == 'BE':
47-
party_identifier = company.vat[2:].replace(' ', '')
46+
party_identifier = self.vat[2:].replace(' ', '')
4847
if party_identifier:
49-
company.write({
48+
self.write({
5049
'initiating_party_identifier': party_identifier})
5150
logger.info(
5251
'Updated initiating_party_identifier on company %s',
53-
company.name)
52+
self.name)

account_banking_pain_base/post_install.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44

55

6-
from openerp import SUPERUSER_ID
6+
from odoo import api, SUPERUSER_ID
77

88

9-
def set_default_initiating_party(cr, pool):
10-
company_ids = pool['res.company'].search(cr, SUPERUSER_ID, [])
11-
companies = pool['res.company'].browse(cr, SUPERUSER_ID, company_ids)
12-
for company in companies:
13-
pool['res.company']._default_initiating_party(
14-
cr, SUPERUSER_ID, company)
9+
def set_default_initiating_party(cr, registry):
10+
with api.Environment.manage():
11+
env = api.Environment(cr, SUPERUSER_ID, {})
12+
companies = env['res.company'].search([])
13+
companies._default_initiating_party()
1514
return
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
© 2016 Akretion (Alexis de Lattre <[email protected]>)
4+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
5+
-->
6+
<odoo>
7+
8+
9+
<record id="view_account_config_settings" model="ir.ui.view">
10+
<field name="name">pain.group.on.account.config.settings</field>
11+
<field name="model">account.config.settings</field>
12+
<field name="inherit_id" ref="account.view_account_config_settings"/>
13+
<field name="arch" type="xml">
14+
<xpath expr="//separator[@name='analytic_account']" position="before">
15+
<group name="pain">
16+
<field name="initiating_party_identifier"/>
17+
<field name="initiating_party_issuer"/>
18+
</group>
19+
</xpath>
20+
</field>
21+
</record>
22+
23+
24+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
4-
@author: Alexis de Lattre <[email protected]>
5-
The licence is in the file __openerp__.py
3+
© 2013-2016 Akretion (Alexis de Lattre <[email protected]>)
4+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
65
-->
7-
<openerp>
8-
<data>
6+
<odoo>
7+
98

109
<record id="account_payment_line_form" model="ir.ui.view">
1110
<field name="name">pain.base.account.payment.line</field>
@@ -19,5 +18,5 @@
1918
</field>
2019
</record>
2120

22-
</data>
23-
</openerp>
21+
22+
</odoo>

account_banking_pain_base/views/account_payment_method.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<openerp>
3-
<data>
2+
<odoo>
43

54

65
<record id="account_payment_method_form" model="ir.ui.view">
@@ -28,5 +27,4 @@
2827
</record>
2928

3029

31-
</data>
32-
</openerp>
30+
</odoo>

account_banking_pain_base/views/account_payment_mode.xml

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
4-
@author: Alexis de Lattre <[email protected]>
3+
Copyright (C) 2013-2016 Akretion (Alexis de Lattre <[email protected]>)
54
© 2015 Antiun Ingenieria S.L. - Antonio Espinosa
6-
The licence is in the file __openerp__.py
5+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
76
-->
8-
<openerp>
9-
<data>
7+
<odoo>
108

119

1210
<record id="account_payment_mode_form" model="ir.ui.view">
@@ -23,5 +21,4 @@
2321
</record>
2422

2523

26-
</data>
27-
</openerp>
24+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright (C) 2016 Akretion (http://www.akretion.com)
4-
@author: Alexis de Lattre <[email protected]>
5-
The licence is in the file __openerp__.py
3+
© 2016 Akretion (Alexis de Lattre <[email protected]>)
4+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
65
-->
7-
<openerp>
8-
<data>
6+
<odoo>
7+
98

109
<record id="account_payment_order_form" model="ir.ui.view">
1110
<field name="name">pain.base.account.payment.order.form</field>
@@ -20,5 +19,5 @@
2019
</field>
2120
</record>
2221

23-
</data>
24-
</openerp>
22+
23+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright (C) 2015-2016 Akretion (http://www.akretion.com)
4-
@author: Alexis de Lattre <[email protected]>
5-
The licence is in the file __openerp__.py
3+
© 2015-2016 Akretion (Alexis de Lattre <[email protected]>)
4+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
65
-->
7-
<openerp>
8-
<data>
6+
<odoo>
7+
98

109
<record id="bank_payment_line_form" model="ir.ui.view">
1110
<field name="name">pain.base.bank.payment.line.form</field>
@@ -19,5 +18,5 @@
1918
</field>
2019
</record>
2120

22-
</data>
23-
</openerp>
21+
22+
</odoo>

account_banking_pain_base/views/res_company_view.xml

-25
This file was deleted.

0 commit comments

Comments
 (0)