Browse Source

Merge pull request #245 from feketemihai/partner_relations

Fix imports at top of file.
pull/248/head
Holger Brunn 9 years ago
parent
commit
ca14bc7e10
  1. 13
      partner_relations/model/__init__.py
  2. 12
      partner_relations/model/res_partner.py
  3. 2
      partner_relations/model/res_partner_relation.py
  4. 2
      partner_relations/model/res_partner_relation_all.py
  5. 2
      partner_relations/model/res_partner_relation_type_selection.py

13
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

12
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'

2
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):

2
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):

2
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):

Loading…
Cancel
Save