Merge lp:~openerp-dev/openobject-addons/6.0-opw-579336-rgo into lp:openobject-addons/6.0

Proposed by Ravi Gohil (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-579336-rgo
Merge into: lp:openobject-addons/6.0
Diff against target: 82 lines (+17/-6)
2 files modified
base_synchro/wizard/base_synchro.py (+16/-5)
base_synchro/wizard/base_synchro_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-579336-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+126398@code.launchpad.net

Description of the change

Hello,

When we run `Synchronize objects` wizard from menu `Administration/Synchronization`, wrong wizard is popped up.

Steps to reproduce:
1) Install base_synchro,
2) Goto `Administration/Configuration/Synchronization` and feed the server parameters which defines with whom we want to do synchronization,
3) Goto `Administration/Synchronization/History/Synchronized objects` and select the server and select the object to be synchronized(I tested with `res.partner` object without any domain to sync all partners),
4) Run the `Synchronize objects` wizard,

You will have `Synchronize Completed!` wizard, where a wizard should be popped up which asks for from which server one wants to synchronize.

I have provided right view from .xml file and also removed redundent definition of menuitem with id="next_id_62" from it.

I need to remove context from .py file as I faced a traceback saying 'TypeError: __call__() got an unexpected keyword argument 'context'' when I processed the `Synchronize objects` wizard after applying changes of .xml files from this fix.

Kindly review the fix.

Thanks.

To post a comment you must log in.
Revision history for this message
Niels Huylebroeck (red15) wrote :

I'm personally a little concerned about the removal of the context, this doesn't seem normal and would need further analysis to make sure we aren't ignoring another (big) issue under the surface.

5347. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

5348. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

5349. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

5350. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

5351. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

5352. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

5353. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

5354. By Xavier ALT

[MERGE] OPW 578622: project: duplicating project must reset analytic account code

  backport of addons v6.1 revision id: <email address hidden>

5355. By Ravi Gohil (OpenERP)

[FIX] base_synchro: Fixed traceback saying cannot adapt type browse_record and int type is unsubscriptable when sync direction is 'both' for meeting object : (Maintenance Case : 579336)

Unmerged revisions

5355. By Ravi Gohil (OpenERP)

[FIX] base_synchro: Fixed traceback saying cannot adapt type browse_record and int type is unsubscriptable when sync direction is 'both' for meeting object : (Maintenance Case : 579336)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_synchro/wizard/base_synchro.py'
2--- base_synchro/wizard/base_synchro.py 2011-01-14 00:11:01 +0000
3+++ base_synchro/wizard/base_synchro.py 2012-10-15 09:03:22 +0000
4@@ -102,6 +102,13 @@
5 if object.model_id.model=='crm.case.history':
6 fields = ['email','description','log_id']
7 value = pool_src.get(object.model_id.model).read(cr, uid, [id], fields)[0]
8+ if 'create_date' in value:
9+ del value['create_date']
10+ if 'create_uid' in value:
11+ del value['create_uid']
12+ for key ,val in value.iteritems():
13+ if type(val)==tuple:
14+ value.update({key:val[0]})
15 value = self.data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action)
16 id2 = self.get_id(cr, uid, object.id, id, action, context)
17 #
18@@ -165,7 +172,7 @@
19 #
20 # If not synchronized, try to find it with name_get/name_search
21 #
22- names = pool_src.get(object).name_get(cr, uid, [id], context)[0][1]
23+ names = pool_src.get(object).name_get(cr, uid, [id])[0][1]
24 res = pool_dest.get(object).name_search(cr, uid, names, [], 'like')
25 if res:
26 result = res[0][0]
27@@ -184,7 +191,7 @@
28 def data_transform(self, cr, uid, pool_src, pool_dest, object, data, action='u', context=None):
29 self.meta.setdefault(pool_src, {})
30 if not object in self.meta[pool_src]:
31- self.meta[pool_src][object] = pool_src.get(object).fields_get(cr, uid, context=context)
32+ self.meta[pool_src][object] = pool_src.get(object).fields_get(cr, uid)
33 fields = self.meta[pool_src][object]
34
35 for f in fields:
36@@ -196,7 +203,11 @@
37 del data[f]
38 elif ftype == 'many2one':
39 if data[f]:
40- df = self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], data[f][0], action, context=context)
41+ if isinstance(data[f], int):
42+ id = data[f]
43+ elif isinstance(data[f], list):
44+ id = data[f][0]
45+ df = self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], id, action, context=context)
46 data[f] = df
47 if not data[f]:
48 del data[f]
49@@ -225,7 +236,7 @@
50 dt = time.strftime('%Y-%m-%d %H:%M:%S')
51 self.pool.get('base.synchro.obj').write(cr, uid, [object.id], {'synchronize_date': dt})
52 end_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
53- if 'user_id' in syn_obj.user_id:
54+ if syn_obj.user_id:
55 request = pooler.get_pool(cr.dbname).get('res.request')
56 if not self.report:
57 self.report.append('No exception.')
58@@ -244,7 +255,7 @@
59 request.create(cr, uid, {
60 'name' : "Synchronization report",
61 'act_from' : uid,
62- 'act_to' : syn_obj.user_id,
63+ 'act_to' : syn_obj.user_id.id,
64 'body': summary,
65 })
66 return True
67
68=== modified file 'base_synchro/wizard/base_synchro_view.xml'
69--- base_synchro/wizard/base_synchro_view.xml 2011-01-14 00:11:01 +0000
70+++ base_synchro/wizard/base_synchro_view.xml 2012-10-15 09:03:22 +0000
71@@ -25,10 +25,10 @@
72 <field name="res_model">base.synchro</field>
73 <field name="view_type">form</field>
74 <field name="view_mode">form</field>
75+ <field name="view_id" ref="view_base_synchro"/>
76 <field name="target">new</field>
77 </record>
78
79- <menuitem id="next_id_62" name="Synchronization" parent="base.menu_administration"/>
80 <record id="view_base_synchro_finish" model="ir.ui.view">
81 <field name="name">Base Synchronization</field>
82 <field name="model">base.synchro</field>