Browse Source
[MIG] partner_helper: Migration to 10.0 (#386)
[MIG] partner_helper: Migration to 10.0 (#386)
* Migrate to V10 * Tests * Remove method args not necessary with new apipull/746/head
MonsieurB
8 years ago
committed by
David Beal
6 changed files with 106 additions and 94 deletions
-
63partner_helper/README.rst
-
21partner_helper/__init__.py
-
52partner_helper/__manifest__.py
-
37partner_helper/partner.py
-
5partner_helper/tests/__init__.py
-
22partner_helper/tests/test_split_address.py
@ -0,0 +1,63 @@ |
|||||
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
||||
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
============== |
||||
|
Partner Helper |
||||
|
============== |
||||
|
|
||||
|
The purpose of this module is to gather generic partner methods. |
||||
|
It avoids to grow up excessively the number of modules in Odoo |
||||
|
for small features. |
||||
|
|
||||
|
Description |
||||
|
----------- |
||||
|
Add specific helper methods to deal with partners: |
||||
|
|
||||
|
* _get_split_address(): |
||||
|
This method allows to get a number of street fields according to |
||||
|
your choice. 2 fields by default in Odoo with 128 width chars. |
||||
|
In some countries you have constraints on width of street fields and you |
||||
|
should use 3 or 4 shorter fields. |
||||
|
You also need of this feature to avoid headache with overflow printing task |
||||
|
|
||||
|
* other_method(): |
||||
|
|
||||
|
|
||||
|
|
||||
|
Bug Tracker |
||||
|
=========== |
||||
|
|
||||
|
Bugs are tracked on `GitHub Issues |
||||
|
<https://github.com/OCA/partner_contact/issues>`_. In case of trouble, please |
||||
|
check there if your issue has already been reported. If you spotted it first, |
||||
|
help us smash it by providing detailed and welcomed feedback. |
||||
|
|
||||
|
|
||||
|
Images |
||||
|
------ |
||||
|
|
||||
|
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. |
||||
|
|
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
|
||||
|
* Sébastien BEAU <sebastien.beau@akretion.com> |
||||
|
* David BEAL <david.beal@akretion.com> |
||||
|
|
||||
|
|
||||
|
Maintainer |
||||
|
---------- |
||||
|
|
||||
|
.. image:: https://odoo-community.org/logo.png |
||||
|
:alt: Odoo Community Association |
||||
|
:target: https://odoo-community.org |
||||
|
|
||||
|
This module is maintained by the OCA. |
||||
|
|
||||
|
OCA, or the Odoo Community Association, is a nonprofit organization whose |
||||
|
mission is to support the collaborative development of Odoo features and |
||||
|
promote its widespread use. |
||||
|
|
||||
|
To contribute to this module, please visit https://odoo-community.org. |
@ -1,22 +1,5 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################## |
|
||||
# |
|
||||
# Author: Sébastien BEAU <sebastien.beau@akretion.com> |
# Author: Sébastien BEAU <sebastien.beau@akretion.com> |
||||
# Copyright 2014 Akretion |
|
||||
# |
|
||||
# This program is free software: you can redistribute it and/or modify |
|
||||
# it under the terms of the GNU Affero General Public License as |
|
||||
# published by the Free Software Foundation, either version 3 of the |
|
||||
# License, or (at your option) any later version. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU Affero General Public License for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU Affero General Public License |
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import partner # noqa |
|
||||
|
from . import partner |
@ -1,64 +1,20 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################## |
|
||||
# |
|
||||
# Author: Sébastien BEAU <sebastien.beau@akretion.com> |
# Author: Sébastien BEAU <sebastien.beau@akretion.com> |
||||
# Copyright 2014 Akretion |
|
||||
# |
|
||||
# This program is free software: you can redistribute it and/or modify |
|
||||
# it under the terms of the GNU Affero General Public License as |
|
||||
# published by the Free Software Foundation, either version 3 of the |
|
||||
# License, or (at your option) any later version. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU Affero General Public License for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU Affero General Public License |
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
{ |
{ |
||||
'name': 'Partner Helper', |
'name': 'Partner Helper', |
||||
'version': '8.0.0.1.0', |
|
||||
|
'version': '10.0.0.1.0', |
||||
'author': "Akretion,Odoo Community Association (OCA)", |
'author': "Akretion,Odoo Community Association (OCA)", |
||||
'maintainer': 'Akretion', |
'maintainer': 'Akretion', |
||||
'category': 'Warehouse', |
'category': 'Warehouse', |
||||
'depends': [ |
'depends': [ |
||||
'base', |
'base', |
||||
], |
], |
||||
'description': """ |
|
||||
Partner Helper |
|
||||
============== |
|
||||
The purpose of this module is to gather generic partner methods. |
|
||||
It avoids to grow up excessively the number of modules in Odoo |
|
||||
for small features. |
|
||||
|
|
||||
Description |
|
||||
----------- |
|
||||
Add specific helper methods to deal with partners: |
|
||||
|
|
||||
* _get_split_address(): |
|
||||
This method allows to get a number of street fields according to |
|
||||
your choice. 2 fields by default in Odoo with 128 width chars. |
|
||||
In some countries you have constraints on width of street fields and you |
|
||||
should use 3 or 4 shorter fields. |
|
||||
You also need of this feature to avoid headache with overflow printing task |
|
||||
|
|
||||
* other_method(): |
|
||||
|
|
||||
Contributors |
|
||||
------------ |
|
||||
* Sébastien BEAU <sebastien.beau@akretion.com> |
|
||||
* David BEAL <david.beal@akretion.com> |
|
||||
|
|
||||
|
|
||||
""", |
|
||||
|
'summary': "Add specific helper methods", |
||||
'website': 'http://www.akretion.com/', |
'website': 'http://www.akretion.com/', |
||||
'data': [], |
'data': [], |
||||
'tests': [], |
'tests': [], |
||||
'installable': False, |
|
||||
|
'installable': True, |
||||
'auto_install': False, |
'auto_install': False, |
||||
'license': 'AGPL-3', |
'license': 'AGPL-3', |
||||
'application': False, |
'application': False, |
||||
|
@ -0,0 +1,5 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Author: Sébastien BEAU <sebastien.beau@akretion.com> |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
|
from . import test_split_address |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from openerp.tests.common import TransactionCase |
||||
|
import logging |
||||
|
_logger = logging.getLogger(__name__) |
||||
|
|
||||
|
|
||||
|
class TestSplit(TransactionCase): |
||||
|
|
||||
|
def setUp(self): |
||||
|
super(TestSplit, self).setUp() |
||||
|
self.partnerX = self.env.ref('base.res_partner_12') |
||||
|
|
||||
|
def test_init1(self): |
||||
|
address = u"278 route pitoresque de la vallee de" \ |
||||
|
u" l'ours qui fuit les chasseurs" |
||||
|
partner = self.partnerX |
||||
|
partner.street = address |
||||
|
address1, address2 = partner._get_split_address(2, 40) |
||||
|
self.assertEqual('278 route pitoresque de la vallee de', address1) |
||||
|
self.assertEqual(u"l'ours qui fuit les chasseurs ", address2) |
||||
|
self.assertTrue(len(address1) <= 40) |
||||
|
self.assertTrue(len(address2) <= 40) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue