[Trunk/7.0] Use of custom filter "set_editable" raises an error

Bug #1117320 reported by Yannick Vaucher @ Camptocamp
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

If you add this in one of your search view:

<filter string="Edit test" context="{'set_editable': True}"/>

You get the following javascript error:

 Uncaught Error: cannot call methods on autocomplete prior to initialization; attempted to call method 'widget'

How to reproduce:

- Add the filter in your search view of partners
- Go on list view
- Select your custom filter
- Click on a row and modify it
- Save your changes
- Remove the custom filter
- Click anywhere around

This is used nowhere in addons, however as the doc states this, I assume it is a bug:

http://doc.openerp.com/trunk/developers/web/list_view/#editability-status

context.set_editable

Boolean flag extracted from a search context (during the do_search`() handler), true will make the view editable (from the top), false or the absence of the flag is a noop.

Related branches

Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :
summary: - [7.0] Use of custom filter "set_editable" raises an error
+ [Trunk/7.0] Use of custom filter "set_editable" raises an error
Changed in openerp-web:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
Revision history for this message
jasimmk (jasimmk-c) wrote :

Confirmed with version 7.0. @ Feb 20, 2013. Its reproducable if you use http://v6apps.openerp.com/addon/8139 mass_editing plugin and you try to add an editable field
http://troll.ws/image/7ae46b9d
http://troll.ws/image/52890253

Changed in openerp-web:
status: Confirmed → In Progress
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Nice find. Unless I missed something, the issue didn't even requiring edition (starting and discarding the edition of a row, then removing the filter, suffices).

Basically, it came down to the editable listview code not performing the correct cleanup (not destroying the previously started form) when switching from editable to non-editable, leading to form widgets getting completely confused.

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Should be fixed as of revision <email address hidden> in 7.0

Changed in openerp-web:
status: In Progress → Fix Released
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

You might be right.

What I'm sure is that it is currently a "Don't remove that tiny piece at the bottom of the stack if you don't want troubles" as it is only possible to reload the view instead of removing the edit option.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Thanks Quick Xavier!

We faced the same error with mass editing module and we've got a comment too : www.serpentcs.com/serpentcs-mass-editing-in-openerp-completely-configurable

Thanks,

Changed in openerp-web:
milestone: none → 7.0
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the fix :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.