Review: Needs Fixing
Hi,
The fix looks good, but there is still a usability issue because if you clear
only the m2o part of the reference widget, you still get a cryptic error
message.
We should ensure that we reset the reference if the m2o value is set to False,
or if the selection part is set to False. Also, because we know this is a
ReferenceField we probably don't need too much precautions.
Example patch discussed with Naresh:
=== modified file 'bin/widget/model/field.py'
--- bin/widget/model/field.py 2011-04-20 09:34:21 +0000
+++ bin/widget/model/field.py 2011-06-01 06:59:30 +0000
@@ -501,7 +501,8 @@
val = model.value[self.name]
if not isinstance(val, (tuple, list)):
val = eval(val)
- return '%s,%d' % (val[0], val[1][0])
+ if val[0] and val[1][0]:
+ return '%s,%d' % (val[0], val[1][0])
return False
def set_client(self, model, value, test_state=False, force_change=False):
Thanks!
--
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bug-715763-ysa/+merge/62651
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client/trunk-bug-715763-ysa.
_______________________________________________
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