From 65c6c0b5ac47caac71c6c1284d84c1004d348c01 Mon Sep 17 00:00:00 2001 From: Fekete Mihai Date: Sun, 24 Jan 2016 22:46:42 -0800 Subject: [PATCH 1/3] Fix imports at top of file. --- partner_relations/model/__init__.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/partner_relations/model/__init__.py b/partner_relations/model/__init__.py index 9e65bc55b..684bb5b6b 100644 --- a/partner_relations/model/__init__.py +++ b/partner_relations/model/__init__.py @@ -19,6 +19,12 @@ # ############################################################################## +from . import res_partner +from . import res_partner_relation +from . import res_partner_relation_type +from . import res_partner_relation_all +from . import res_partner_relation_type_selection + PADDING = 10 @@ -30,10 +36,3 @@ def get_partner_type(partner): :rtype: str """ return 'c' if partner.is_company else 'p' - - -from . import res_partner -from . import res_partner_relation -from . import res_partner_relation_type -from . import res_partner_relation_all -from . import res_partner_relation_type_selection From 768189dfe7e1a7b51cb32123fbf6f955555e767c Mon Sep 17 00:00:00 2001 From: Fekete Mihai Date: Sun, 24 Jan 2016 23:29:23 -0800 Subject: [PATCH 2/3] Fix imports at top of file. --- partner_relations/model/__init__.py | 12 ------------ partner_relations/model/res_partner.py | 11 +++++++++++ partner_relations/model/res_partner_relation.py | 2 +- partner_relations/model/res_partner_relation_all.py | 2 +- .../model/res_partner_relation_type_selection.py | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/partner_relations/model/__init__.py b/partner_relations/model/__init__.py index 684bb5b6b..a493a9d0e 100644 --- a/partner_relations/model/__init__.py +++ b/partner_relations/model/__init__.py @@ -24,15 +24,3 @@ from . import res_partner_relation from . import res_partner_relation_type from . import res_partner_relation_all from . import res_partner_relation_type_selection - -PADDING = 10 - - -def get_partner_type(partner): - """Get partner type for relation. - - :param partner: a res.partner either a company or not - :return: 'c' for company or 'p' for person - :rtype: str - """ - return 'c' if partner.is_company else 'p' diff --git a/partner_relations/model/res_partner.py b/partner_relations/model/res_partner.py index dc5608c76..063ef4b9a 100644 --- a/partner_relations/model/res_partner.py +++ b/partner_relations/model/res_partner.py @@ -25,6 +25,17 @@ from openerp.osv.expression import is_leaf, AND, OR, FALSE_LEAF from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools.translate import _ +PADDING = 10 + + +def get_partner_type(partner): + """Get partner type for relation. + + :param partner: a res.partner either a company or not + :return: 'c' for company or 'p' for person + :rtype: str + """ + return 'c' if partner.is_company else 'p' class ResPartner(models.Model): _inherit = 'res.partner' diff --git a/partner_relations/model/res_partner_relation.py b/partner_relations/model/res_partner_relation.py index 3ebb19b05..448b02889 100644 --- a/partner_relations/model/res_partner_relation.py +++ b/partner_relations/model/res_partner_relation.py @@ -22,7 +22,7 @@ from openerp import osv, models, fields, api, exceptions, _ -from . import get_partner_type +from .res_partner import get_partner_type class ResPartnerRelation(models.Model): diff --git a/partner_relations/model/res_partner_relation_all.py b/partner_relations/model/res_partner_relation_all.py index 991120bec..59bc12bc7 100644 --- a/partner_relations/model/res_partner_relation_all.py +++ b/partner_relations/model/res_partner_relation_all.py @@ -23,7 +23,7 @@ from openerp import models, fields, api from openerp.tools import drop_view_if_exists from .res_partner_relation_type_selection import \ ResPartnerRelationTypeSelection -from . import get_partner_type, PADDING +from .res_partner import get_partner_type, PADDING class ResPartnerRelationAll(models.AbstractModel): diff --git a/partner_relations/model/res_partner_relation_type_selection.py b/partner_relations/model/res_partner_relation_type_selection.py index 5a689c0bc..138989b3f 100644 --- a/partner_relations/model/res_partner_relation_type_selection.py +++ b/partner_relations/model/res_partner_relation_type_selection.py @@ -33,7 +33,7 @@ from openerp.osv import fields from openerp.osv import orm from openerp.tools import drop_view_if_exists from .res_partner_relation_type import ResPartnerRelationType -from . import PADDING +from .res_partner import PADDING class ResPartnerRelationTypeSelection(orm.Model): From ab228558c0a7375aa8b24080c3ef40eeaffcece4 Mon Sep 17 00:00:00 2001 From: Fekete Mihai Date: Sun, 24 Jan 2016 23:56:23 -0800 Subject: [PATCH 3/3] Fix pylint i nre4s_partner. --- partner_relations/model/res_partner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/partner_relations/model/res_partner.py b/partner_relations/model/res_partner.py index 063ef4b9a..514b8101a 100644 --- a/partner_relations/model/res_partner.py +++ b/partner_relations/model/res_partner.py @@ -37,6 +37,7 @@ def get_partner_type(partner): """ return 'c' if partner.is_company else 'p' + class ResPartner(models.Model): _inherit = 'res.partner'