Skip to content

Commit

Permalink
[MIG] l10n_nl_partner_name: Migration to 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
George Daramouskas committed Jan 21, 2019
1 parent 740774d commit ca822a9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 30 deletions.
4 changes: 1 addition & 3 deletions l10n_nl_partner_name/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
# © 2017 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import model
7 changes: 3 additions & 4 deletions l10n_nl_partner_name/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# © 2017 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2017 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
'name': 'Dutch partner names',
'version': '10.0.1.1.0',
'version': '11.0.0.0.0',
'author': 'Therp BV, Odoo Community Association (OCA)',
'category': 'Contact management',
'depends': [
Expand Down
4 changes: 1 addition & 3 deletions l10n_nl_partner_name/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
# © 2017 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import res_partner
5 changes: 2 additions & 3 deletions l10n_nl_partner_name/model/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# © 2017 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2017 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from mako.template import Template
from odoo import models, fields, api

Expand Down
8 changes: 4 additions & 4 deletions l10n_nl_partner_name/scripts/guess_names.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
# © 2017 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2017 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

import argparse
import xmlrpclib
Expand Down Expand Up @@ -58,7 +58,7 @@ def add_token(values, key, token, delimiter=' '):
for partner in odoo_execute(
'res.partner', 'read', ids,
['lastname', 'firstname', 'initials', 'infix']):
print partner['lastname']
print(partner['lastname'])

have_infix = False
tokens = partner['lastname'].split()
Expand All @@ -76,7 +76,7 @@ def add_token(values, key, token, delimiter=' '):
add_token(partner, 'firstname', token)
partner['lastname'] = ' '.join(tokens)

print partner
print(partner)
odoo_execute('res.partner', 'write', partner['id'], partner)

offset += limit
3 changes: 0 additions & 3 deletions l10n_nl_partner_name/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_l10n_nl_partner_name
14 changes: 4 additions & 10 deletions l10n_nl_partner_name/tests/test_l10n_nl_partner_name.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2016 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase


class TestL10nNlPartnerName(TransactionCase):

def test_l10n_nl_partner_name(self):
partner = self.env['res.partner'].create({
'name': 'Mark Rutte',
Expand All @@ -22,13 +22,7 @@ def test_l10n_nl_partner_name(self):
})
self.assertEqual(partner.firstname, 'Willem-Alexander')
self.assertEqual(partner.lastname, 'van Oranje-Nassau')
onchange_vals = {
'lastname': 'Oranje-Nassau',
'infix': 'van',
}
partner.onchange(
onchange_vals, ['lastname', 'infix'], partner._onchange_spec(),
)
partner._onchange_subnames()
self.assertEqual(
partner.name,
'Willem-Alexander van Oranje-Nassau'
Expand Down
1 change: 1 addition & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ account-financial-reporting
server-ux
community-data-files
partner-contact
server-tools

0 comments on commit ca822a9

Please sign in to comment.