Merge lp:~therp-nl/openobject-extension/oerp6.1-stable_lp1071378_magento_category_export into lp:openobject-extension/oerp6.1-stable

Proposed by Stefan Rijnhart (Opener) on 2013-05-13
Status: Merged
Merged at revision: 395
Proposed branch: lp:~therp-nl/openobject-extension/oerp6.1-stable_lp1071378_magento_category_export
Merge into: lp:openobject-extension/oerp6.1-stable
Diff against target: 59 lines (+15/-3)
2 files modified
base_external_referentials/external_osv.py (+9/-1)
base_external_referentials/report.py (+6/-2)
To merge this branch: bzr merge lp:~therp-nl/openobject-extension/oerp6.1-stable_lp1071378_magento_category_export
Reviewer Review Type Date Requested Status
extra-addons-commiter 2013-05-13 Pending
Review via email: mp+163509@code.launchpad.net

Description of the change

Needed for https://code.launchpad.net/~therp-nl/magentoerpconnect/oerp6.1-stable_lp1071378_magento_category_export

As I wrote on the other branch' merge proposal, I am hoping that the changes base_external_referentials/report.py won't be necessary.

To post a comment you must log in.

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 2013-01-25 09:17:54 +0000
3+++ base_external_referentials/external_osv.py 2013-05-13 11:50:34 +0000
4@@ -1154,6 +1154,12 @@
5
6 @extend(Model)
7 def multi_lang_read(self, cr, uid, external_session, ids, fields_to_read, langs, resources=None, use_multi_lang = True, context=None):
8+ """
9+ Read a full resource on every first read, and then for every
10+ extra language only the translatable fields.
11+ If 'lang_full_read' is set to True in the context, read all fields
12+ for every extra language, not just the translatable fields.
13+ """
14 if not resources:
15 resources = {}
16 translatable_fields, untranslatable_fields = self.get_translatable_fields(cr, uid, fields_to_read, context=context)
17@@ -1167,7 +1173,9 @@
18 if lang == 'no_lang':
19 fields = untranslatable_fields
20 else:
21- if not first and lang_support == 'fields_with_main_lang' or lang_support == 'fields_with_no_lang':
22+ if (not first and not context.get('lang_full_read') and
23+ lang_support == 'fields_with_main_lang' or
24+ lang_support == 'fields_with_no_lang'):
25 fields = translatable_fields
26 ctx['lang'] = lang
27
28
29=== modified file 'base_external_referentials/report.py'
30--- base_external_referentials/report.py 2012-11-01 15:51:18 +0000
31+++ base_external_referentials/report.py 2013-05-13 11:50:34 +0000
32@@ -280,6 +280,10 @@
33 def start_log(self, cr, uid, action_on, action, res_id=None,
34 external_id=None, resource=None, args=None, kwargs=None):
35 context = kwargs.get('context') or {}
36+ if context.get('conn_obj'):
37+ log_kwargs = kwargs.copy()
38+ log_kwargs['context'] = kwargs['context'].copy()
39+ del log_kwargs['context']['conn_obj']
40 existing_line_id = self.get_existing_line_id(cr, uid,action_on, action,
41 res_id=res_id, external_id=external_id, context=context)
42 report_id = context.get('report_id')
43@@ -292,7 +296,7 @@
44 'res_id': res_id,
45 'external_id': external_id,
46 'args': args,
47- 'kwargs': kwargs,
48+ 'kwargs': log_kwargs,
49 })
50 else:
51 action_on_model_id = self.pool.get('ir.model').search(cr, uid, [['model', '=', action_on]])[0]
52@@ -306,7 +310,7 @@
53 'external_id': external_id,
54 'resource': resource,
55 'args': args,
56- 'kwargs': kwargs,
57+ 'kwargs': log_kwargs,
58 })
59 return existing_line_id
60

Subscribers

People subscribed via source and target branches