view editor will remove any inner form elements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Web (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP R&D Web Team |
Bug Description
View Editor seems broken as of rev. 2291.
I'll try to upload a video I've recorded reproducing the bug in the next comment.
Here are the steps described in full text.
From an empty database,
1 - log in administrator, get the extended view and in the debug mode (by adding "?debug" to your URL before any "#")
2 - get into Settings/
3 - in the debug input select widget, select: Manage Views
4 - select the only choice, and click on "Edit" to get access to the "View Editor"
5 - do any little change (for example, switch the 2 first fields "name" and "category_id" by clicking on the green arrow)
6 - Close the "View Editor", and the "View selector".
An Exception is casted by the server:
Server Traceback (most recent call last):
File "openerp-
result = openerp.
File "openobject-
result = ExportService.
File "openobject-
res = fn(db, uid, *params)
File "openobject-
return self.execute(db, uid, obj, method, *args, **kw or {})
File "openobject-
return f(self, dbname, *args, **kwargs)
File "openobject-
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "openobject-
return getattr(object, method)(cr, uid, *args, **kw)
File "openobject-
xarch, xfields = self.__
File "openobject-
cr.
File "openobject-
return f(self, *args, **kwargs)
File "openobject-
res = self._obj.
ProgrammingError: operator does not exist: integer = boolean
LINE 1: select name, model from ir_ui_view where (id=false or inheri...
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
MY DIAGNOSTIC
openerp-web saves a mutilated version of the view on step 5 (modification in the View Editor), and in consequence when coming back to render the corresponding view, it crashes.
Line 634 in "addons/
$(arch.arch)
is used to get DOM elements from raw string stored in "arch.arch". And this seems very wrong as jQuery IS NOT a xml tokenizer.
A quick check in javascript console can show that:
> $("<form>
"<form>
Note that the second inner form element has disappeared. This is not a jQuery bug. And this could be much worse !
And this is what is happening to our group view: a second inner "form" element in this view which is removed by the view editor.
I've provided a fix proposal which seems to work on my system.
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedaddons/web/static/src/js/view_editor.js (+1/-1)
- OpenERP R&D Web Team: Pending requested
-
Diff: 140 lines (+51/-10)3 files modifiedaddons/web/static/src/css/base.css (+22/-0)
addons/web/static/src/css/base.sass (+19/-0)
addons/web/static/src/js/view_editor.js (+10/-10)
Changed in openerp-web: | |
assignee: | nobody → OpenERP R&D Web Team (openerp-dev-web) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openerp-web: | |
status: | Confirmed → Fix Committed |
Changed in openerp-web: | |
status: | Fix Committed → Fix Released |