Nimesh Contractor(Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-907388-nco into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-907388-nco/+merge/86675
Hello,
I have solve the problem of base_syncho.
Thanks,
NCO
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-907388-nco/+merge/86675
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-907388-nco.
=== modified file 'base_synchro/wizard/base_synchro.py'
--- base_synchro/wizard/base_synchro.py 2011-09-15 17:02:22 +0000
+++ base_synchro/wizard/base_synchro.py 2011-12-22 10:08:26 +0000
@@ -191,20 +191,23 @@
if not object in self.meta[pool_src]:
self.meta[pool_src][object] = pool_src.get(object).fields_get(cr, uid)
fields = self.meta[pool_src][object]
-
for f in fields:
if f not in data:
continue
ftype = fields[f]['type']
-
if ftype in ('function', 'one2many', 'one2one'):
del data[f]
+
elif ftype == 'many2one':
- if data[f]:
- df = self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], data[f][0], action, context=context)
- data[f] = df
- if not data[f]:
- del data[f]
+ if (isinstance(data[f], list)) and data[f]:
+ fdata = data[f][0]
+ else:
+ fdata = data[f]
+ df = self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], fdata, action, context=context)
+ data[f] = df
+ if not data[f]:
+ del data[f]
+
elif ftype == 'many2many':
res = map(lambda x: self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], x, action, context), data[f])
data[f] = [(6, 0, res)]
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp