Skip to content

Commit

Permalink
[FIX] Add the same mapping to addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
mistotebe committed Dec 11, 2014
1 parent ac5e0c2 commit 5fad554
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions magentoerpconnect/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,19 @@ def title(self, record):
'name': prefix})
return {'title': title_id}

@only_create
@mapping
def company_id(self, record):
parent_id = record.get('parent_id')
if parent_id:
parent = self.session.browse('res.partner', parent_id)
if parent.company_id:
return {'company_id': parent.company_id.id}
else:
return {'company_id': False}
# Don't return anything, we are merging into an existing partner
return


@magento
class CompanyImportMapper(BaseAddressImportMapper):
Expand Down

0 comments on commit 5fad554

Please sign in to comment.