Skip to content

Commit

Permalink
Port almost all modules to v10 (OCA#305)
Browse files Browse the repository at this point in the history
Port almost all modules to v10

* Update to EPC Rulebook v9.2 that start to apply on 2016-11-20 (bug OCA#300)
  • Loading branch information
Alexis de Lattre authored and etobella committed Oct 17, 2017
1 parent b30d381 commit 8ac6016
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 116 deletions.
2 changes: 1 addition & 1 deletion account_banking_sepa_credit_transfer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Transfer that you created during the configuration step.

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

Known issues / Roadmap
======================
Expand Down
6 changes: 3 additions & 3 deletions account_banking_sepa_credit_transfer/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
{
'name': 'Account Banking SEPA Credit Transfer',
'summary': 'Create SEPA XML files for Credit Transfers',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'author': "Akretion, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Tecnativa, "
"Antiun Ingeniería S.L., "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
Expand All @@ -24,5 +24,5 @@
'demo/sepa_credit_transfer_demo.xml'
],
'post_init_hook': 'update_bank_journals',
'installable': False,
'installable': True,
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">


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


</data>
</openerp>
</odoo>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">

<openerp>
<data noupdate="1">

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

</data>
</openerp>

</odoo>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <[email protected]>)
# 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 AccountPaymentMethod(models.Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, api, _
from openerp.exceptions import UserError
from odoo import models, api, _
from odoo.exceptions import UserError
from lxml import etree


Expand Down
24 changes: 12 additions & 12 deletions account_banking_sepa_credit_transfer/post_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# © 2016 Akretion (Alexis de Lattre <[email protected]>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import SUPERUSER_ID
from odoo import api, SUPERUSER_ID


def update_bank_journals(cr, pool):
ajo = pool['account.journal']
journal_ids = ajo.search(
cr, SUPERUSER_ID, [('type', '=', 'bank')])
sct_id = pool['ir.model.data'].xmlid_to_res_id(
cr, SUPERUSER_ID,
'account_banking_sepa_credit_transfer.sepa_credit_transfer')
if sct_id:
ajo.write(cr, SUPERUSER_ID, journal_ids, {
'outbound_payment_method_ids': [(4, sct_id)],
})
def update_bank_journals(cr, registry):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
ajo = env['account.journal']
journals = ajo.search([('type', '=', 'bank')])
sct = env.ref(
'account_banking_sepa_credit_transfer.sepa_credit_transfer')
if sct:
journals.write({
'outbound_payment_method_ids': [(4, sct.id)],
})
return
11 changes: 6 additions & 5 deletions account_banking_sepa_credit_transfer/tests/test_sct.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# © 2016 Akretion (Alexis de Lattre <[email protected]>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp.addons.account.tests.account_test_classes\
from odoo.addons.account.tests.account_test_classes\
import AccountingTestCase
from openerp.tools import float_compare
from odoo.tools import float_compare
import time
from lxml import etree

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

def test_eur_currency_sct(self):
invoice1 = self.create_invoice(
Expand Down Expand Up @@ -126,7 +129,6 @@ def test_eur_currency_sct(self):
self.assertEquals(attachment.datas_fname[-4:], '.xml')
xml_file = attachment.datas.decode('base64')
xml_root = etree.fromstring(xml_file)
# print "xml_file=", etree.tostring(xml_root, pretty_print=True)
namespaces = xml_root.nsmap
namespaces['p'] = xml_root.nsmap[None]
namespaces.pop(None)
Expand Down Expand Up @@ -204,7 +206,6 @@ def test_usd_currency_sct(self):
self.assertEquals(attachment.datas_fname[-4:], '.xml')
xml_file = attachment.datas.decode('base64')
xml_root = etree.fromstring(xml_file)
# print "xml_file=", etree.tostring(xml_root, pretty_print=True)
namespaces = xml_root.nsmap
namespaces['p'] = xml_root.nsmap[None]
namespaces.pop(None)
Expand Down Expand Up @@ -247,5 +248,5 @@ def create_invoice(
'name': 'Great service',
'account_id': self.account_expense.id,
})
invoice.signal_workflow('invoice_open')
invoice.action_invoice_open()
return invoice

0 comments on commit 8ac6016

Please sign in to comment.