Skip to content

Commit 4957fe3

Browse files
Alexis de Lattreetobella
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 018569b commit 4957fe3

File tree

10 files changed

+30
-116
lines changed

10 files changed

+30
-116
lines changed

account_banking_sepa_credit_transfer/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Transfer that you created during the configuration step.
4949

5050
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
5151
:alt: Try me on Runbot
52-
:target: https://runbot.odoo-community.org/runbot/173/9.0
52+
:target: https://runbot.odoo-community.org/runbot/173/10.0
5353

5454
Known issues / Roadmap
5555
======================

account_banking_sepa_credit_transfer/__manifest__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
{
88
'name': 'Account Banking SEPA Credit Transfer',
99
'summary': 'Create SEPA XML files for Credit Transfers',
10-
'version': '9.0.1.0.0',
10+
'version': '10.0.1.0.0',
1111
'license': 'AGPL-3',
1212
'author': "Akretion, "
13-
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
13+
"Tecnativa, "
1414
"Antiun Ingeniería S.L., "
1515
"Odoo Community Association (OCA)",
1616
'website': 'https://github.com/OCA/bank-payment',
@@ -24,5 +24,5 @@
2424
'demo/sepa_credit_transfer_demo.xml'
2525
],
2626
'post_init_hook': 'update_bank_journals',
27-
'installable': False,
27+
'installable': True,
2828
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<openerp>
3-
<data noupdate="1">
2+
<odoo noupdate="1">
43

54

65
<record id="sepa_credit_transfer" model="account.payment.method">
@@ -12,5 +11,4 @@
1211
</record>
1312

1413

15-
</data>
16-
</openerp>
14+
</odoo>

account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo noupdate="1">
23

3-
<openerp>
4-
<data noupdate="1">
54

65
<record id="payment_mode_outbound_sepa_ct1" model="account.payment.mode">
76
<field name="name">SEPA Credit Transfer to suppliers</field>
@@ -21,5 +20,5 @@
2120
<field name="supplier_payment_mode_id" ref="payment_mode_outbound_sepa_ct1"/>
2221
</record>
2322

24-
</data>
25-
</openerp>
23+
24+
</odoo>

account_banking_sepa_credit_transfer/migrations/8.0.0.3/post-migration.py

-52
This file was deleted.

account_banking_sepa_credit_transfer/migrations/8.0.0.3/pre-migration.py

-32
This file was deleted.

account_banking_sepa_credit_transfer/models/account_payment_method.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
5+
from odoo import models, fields, api
66

77

88
class AccountPaymentMethod(models.Model):

account_banking_sepa_credit_transfer/models/account_payment_order.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
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, api, _
7-
from openerp.exceptions import UserError
6+
from odoo import models, api, _
7+
from odoo.exceptions import UserError
88
from lxml import etree
99

1010

account_banking_sepa_credit_transfer/post_install.py

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

5-
from openerp import SUPERUSER_ID
5+
from odoo import api, SUPERUSER_ID
66

77

8-
def update_bank_journals(cr, pool):
9-
ajo = pool['account.journal']
10-
journal_ids = ajo.search(
11-
cr, SUPERUSER_ID, [('type', '=', 'bank')])
12-
sct_id = pool['ir.model.data'].xmlid_to_res_id(
13-
cr, SUPERUSER_ID,
14-
'account_banking_sepa_credit_transfer.sepa_credit_transfer')
15-
if sct_id:
16-
ajo.write(cr, SUPERUSER_ID, journal_ids, {
17-
'outbound_payment_method_ids': [(4, sct_id)],
18-
})
8+
def update_bank_journals(cr, registry):
9+
with api.Environment.manage():
10+
env = api.Environment(cr, SUPERUSER_ID, {})
11+
ajo = env['account.journal']
12+
journals = ajo.search([('type', '=', 'bank')])
13+
sct = env.ref(
14+
'account_banking_sepa_credit_transfer.sepa_credit_transfer')
15+
if sct:
16+
journals.write({
17+
'outbound_payment_method_ids': [(4, sct.id)],
18+
})
1919
return

account_banking_sepa_credit_transfer/tests/test_sct.py

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

5-
from openerp.addons.account.tests.account_test_classes\
5+
from odoo.addons.account.tests.account_test_classes\
66
import AccountingTestCase
7-
from openerp.tools import float_compare
7+
from odoo.tools import float_compare
88
import time
99
from lxml import etree
1010

@@ -56,6 +56,9 @@ def setUp(self):
5656
self.eur_currency = self.env.ref('base.EUR')
5757
self.usd_currency = self.env.ref('base.USD')
5858
self.main_company.currency_id = self.eur_currency.id
59+
# Trigger the recompute of account type on res.partner.bank
60+
for bank_acc in self.partner_bank_model.search([]):
61+
bank_acc.acc_number = bank_acc.acc_number
5962

6063
def test_eur_currency_sct(self):
6164
invoice1 = self.create_invoice(
@@ -126,7 +129,6 @@ def test_eur_currency_sct(self):
126129
self.assertEquals(attachment.datas_fname[-4:], '.xml')
127130
xml_file = attachment.datas.decode('base64')
128131
xml_root = etree.fromstring(xml_file)
129-
# print "xml_file=", etree.tostring(xml_root, pretty_print=True)
130132
namespaces = xml_root.nsmap
131133
namespaces['p'] = xml_root.nsmap[None]
132134
namespaces.pop(None)
@@ -204,7 +206,6 @@ def test_usd_currency_sct(self):
204206
self.assertEquals(attachment.datas_fname[-4:], '.xml')
205207
xml_file = attachment.datas.decode('base64')
206208
xml_root = etree.fromstring(xml_file)
207-
# print "xml_file=", etree.tostring(xml_root, pretty_print=True)
208209
namespaces = xml_root.nsmap
209210
namespaces['p'] = xml_root.nsmap[None]
210211
namespaces.pop(None)
@@ -247,5 +248,5 @@ def create_invoice(
247248
'name': 'Great service',
248249
'account_id': self.account_expense.id,
249250
})
250-
invoice.signal_workflow('invoice_open')
251+
invoice.action_invoice_open()
251252
return invoice

0 commit comments

Comments
 (0)