Xavier ALT (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-opw-50930-xal into 
lp:openobject-client-web.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-50930-xal/+merge/104519

Hi,

If selection widget is display on a record with contain an "non empty" value 
for the selection field, no "empty option" are added, this prevent user to 
reset the selection field to "empty".

This MP force adding an "empty option" for all non-required selection fields.

Regards,
Xavier
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-50930-xal/+merge/104519
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-opw-50930-xal.
=== modified file 'addons/openerp/widgets/form/templates/selection.mako'
--- addons/openerp/widgets/form/templates/selection.mako	2010-12-15 10:15:55 +0000
+++ addons/openerp/widgets/form/templates/selection.mako	2012-05-03 10:35:25 +0000
@@ -9,11 +9,11 @@
         search_context="${search_context}" ${py.attrs(attrs)}>
         ## add empty option only if no empty option exist
         ## and no default value is set
-        % if all(label for _, label in options) and not value:
+        % if all(label for _, label in options) and not required:
             <option value=""></option>
         % endif
         % for (val, label) in options:
-            <option value="${val or ''}" ${py.selector(val==(value or False))}>${label}</option>
+            <option value="${val or ''}" ${py.selector(val==(value or ''))}>${label}</option>
         % endfor
     </select>
     % if error:

_______________________________________________
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

Reply via email to