Mohammed Shekha(Open ERP) has proposed merging
lp:~openerp-dev/openobject-client-web/6.0-opw-51120-msh 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-51120-msh/+merge/90825
Hello,
Fixed the issue of "work center" filter which was crashing web-client.
Produce :- In web-client goto Manufacturing -> Planning -> Work Centers
Now click on Work Center filter which will crash web-client.
Error :- list index out of range.
Reason :- Here we have added widget='selection' in tree view of mrp_operation
which doesn't make any sense because tree view is not editable so the use of
widget='selection' will not have any meaning, if we remove this code from
addons then still these will work in web side. But there will be a problem if
someone have set widget='selection' in tree view and that tree view have
editable='top', for e.g. here workcenter_id is many2one field so the value of
many2one field will be in form of tuple like (id, string), so here in
listgroup.mako file line 79 will cause the issue.
Hence changed the code to handle widget='selection' for many2one.
I have also checked the same thing with editable tree view.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-51120-msh/+merge/90825
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client-web/6.0-opw-51120-msh.
=== modified file 'addons/openerp/widgets/templates/listgrid/listgroup.mako'
--- addons/openerp/widgets/templates/listgrid/listgroup.mako 2011-08-30 11:41:21 +0000
+++ addons/openerp/widgets/templates/listgrid/listgroup.mako 2012-01-31 06:13:26 +0000
@@ -76,7 +76,11 @@
% if field_attrs.get('type') == 'many2one':
${grp_row.get(field)[-1]}
% elif field_attrs.get('type') == 'selection':
- ${[fld_select[1] for fld_select in field_attrs['selection'] if fld_select[0] == grp_row[field]][0]}
+ % if isinstance(grp_row[field], tuple):
+ ${[fld_select[1] for fld_select in field_attrs['selection'] if fld_select[0] == grp_row[field][0]][0]}
+ % else:
+ ${[fld_select[1] for fld_select in field_attrs['selection'] if fld_select[0] == grp_row[field]][0]}
+ % endif
% else:
${grp_row.get(field)}
% endif
_______________________________________________
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