Merge lp:~camptocamp/openobject-addons/extra-trunk-fix1028812 into lp:openobject-addons/extra-trunk

Proposed by Alexandre Fayolle - camptocamp
Status: Merged
Merged at revision: 5774
Proposed branch: lp:~camptocamp/openobject-addons/extra-trunk-fix1028812
Merge into: lp:openobject-addons/extra-trunk
Diff against target: 25 lines (+6/-1)
1 file modified
base_external_referentials/external_osv.py (+6/-1)
To merge this branch: bzr merge lp:~camptocamp/openobject-addons/extra-trunk-fix1028812
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
OpenERP Committers Pending
Review via email: mp+116638@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_external_referentials/external_osv.py'
2--- base_external_referentials/external_osv.py 2012-06-27 13:35:41 +0000
3+++ base_external_referentials/external_osv.py 2012-07-25 12:50:37 +0000
4@@ -190,6 +190,8 @@
5 Creates the resource from the external connection if the resource does not exist."""
6 #First get the external key field name
7 #conversion external id -> OpenERP object using Object mapping_column_name key!
8+ if context is None:
9+ context = {}
10 if id:
11 existing_id = self.extid_to_existing_oeid(cr, uid, id, external_referential_id, context)
12 if existing_id:
13@@ -197,8 +199,11 @@
14 try:
15 if context and context.get('alternative_key', False): #FIXME dirty fix for Magento product.info id/sku mix bug: https://bugs.launchpad.net/magentoerpconnect/+bug/688225
16 id = context.get('alternative_key', False)
17+ ctx = {'id': id,
18+ 'import_no_new_cr': context.get('import_no_new_cr', False),
19+ }
20 conn = self.pool.get('external.referential').external_connection(cr, uid, external_referential_id)
21- result = self.get_external_data(cr, uid, conn , external_referential_id, {}, {'id':id})
22+ result = self.get_external_data(cr, uid, conn , external_referential_id, {}, ctx)
23 if len(result['create_ids']) == 1:
24 return result['create_ids'][0]
25 except Exception, error: #external system might return error because no such record exists

Subscribers

People subscribed via source and target branches