diff --git a/partner_relations/model/__init__.py b/partner_relations/model/__init__.py index 9e65bc55b..a493a9d0e 100644 --- a/partner_relations/model/__init__.py +++ b/partner_relations/model/__init__.py @@ -19,19 +19,6 @@ # ############################################################################## -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' - - from . import res_partner from . import res_partner_relation from . import res_partner_relation_type diff --git a/partner_relations/model/res_partner.py b/partner_relations/model/res_partner.py index dc5608c76..514b8101a 100644 --- a/partner_relations/model/res_partner.py +++ b/partner_relations/model/res_partner.py @@ -25,6 +25,18 @@ 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):