Skip to content

Commit

Permalink
Merge 8fe3c31 into a917e5c
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed May 24, 2019
2 parents a917e5c + 8fe3c31 commit 1c992a8
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
13 changes: 13 additions & 0 deletions account_payment_unece/__init__.py
@@ -1,3 +1,16 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models

from odoo import api, SUPERUSER_ID


def _assign_account_payment_method_unece_id(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
code_means_30 = env.ref('account_payment_unece.payment_means_30')
manual_out = env.ref('account.account_payment_method_manual_out')
manual_in = env.ref('account.account_payment_method_manual_in')
(manual_out + manual_in).write({
'unece_id': code_means_30.id,
'unece_code': code_means_30.code,
})
4 changes: 2 additions & 2 deletions account_payment_unece/__manifest__.py
Expand Up @@ -9,15 +9,15 @@
'license': 'AGPL-3',
'summary': 'UNECE nomenclature for the payment methods',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'http://www.akretion.com',
'website': 'https://github.com/OCA/community-data-files',
'depends': [
'account_payment_mode',
'base_unece',
],
'data': [
'data/unece.xml',
'data/account_payment_method.xml',
'views/account_payment_method.xml',
],
'installable': True,
'post_init_hook': '_assign_account_payment_method_unece_id',
}
12 changes: 0 additions & 12 deletions account_payment_unece/data/account_payment_method.xml

This file was deleted.

@@ -0,0 +1,3 @@
---Fields in module 'account_payment_unece'---
---XML records in module 'account_payment_unece'---
---nothing has changed in this module--
@@ -0,0 +1,4 @@
---Fields in module 'account_payment_unece'---
---XML records in module 'account_payment_unece'---
---nothing has changed in this module--
# NOTHING TO DO
9 changes: 9 additions & 0 deletions account_payment_unece/migrations/12.0.1.0.0/post-migration.py
@@ -0,0 +1,9 @@
# Copyright 2019 Eficent <http://www.eficent.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
from odoo.addons.account_payment_unece import _assign_account_payment_method_unece_id


@openupgrade.migrate()
def migrate(env, version):
_assign_account_payment_method_unece_id(env.cr, env.registry)

0 comments on commit 1c992a8

Please sign in to comment.