[model/dataset] Problem with xxx_view_ref calls

Bug #1091204 reported by Manfred Rockel
68
This bug affects 23 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

trunk latest revisions

Please install attached partner_test module and watch the attached screenshots

Related branches

Revision history for this message
Manfred Rockel (mrockel) wrote :
Revision history for this message
Manfred Rockel (mrockel) wrote :

before installation of partner_test module

Revision history for this message
Manfred Rockel (mrockel) wrote :

after installation of module partner_test

Revision history for this message
Manfred Rockel (mrockel) wrote :

The same problem was last year 08.2011 with gtk client
https://bugs.launchpad.net/bugs/833814

Revision history for this message
Anand (anand-m-patel) wrote :

Hello,

I have checked your issue with passing both of different view as a reference in context,but both the time i get the correct result.

If i pass old view of product module in your new code even that i seen old view of supplier info, So would you please double check
again and if you still face the problem then provide precious steps to reproduce it.

Thanks and waiting for your reply.

Changed in openerp-web:
status: New → Incomplete
Revision history for this message
Manfred Rockel (mrockel) wrote :

Please check my attached video.
In Form supplier "product information" tab shows the wrong treeview.
I expect "partner_test.supplier_productinfo_tree_view1" but it shows "product_supplierinfo_tree_view"

Anand (anand-m-patel)
Changed in openerp-web:
status: Incomplete → Confirmed
Amit Parik (amit-parik)
Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
importance: Undecided → Medium
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Right, it looks like the field's context is not propagated when fetching the o2m's sub-views. In view_form.js:3363, adding a context to the generated dataset (via `this.build_context()`) seems to make this case work but I'm not certain it's the correct fix.

Revision history for this message
Douglas Baldwin (gdbaldw) wrote :

I tracked this bug to its apparent source, and offer the following report:

This bug has two causes, and the most troubling is likely within the web module:

1) The fundamental issue is that context is lost, and this appears to occur within web/http.

2) The second issue is that osv.orm.fields_view_get() fails to extract context from the form.

Demonstration: (requires, import pdb)

A) For the pass through osv.orm.fields_view_get() that needs the referenced context, use pdb to manually inject (view_type + '_view_ref') into context, and the form will render correctly.

B) The pass through osv.orm.fields_view_get() that immediately precedes (A) above should extract (view_type + '_view_ref') from the referencing form, and add this to context before returning, so the referenced context would be available to (A). It does not.

C) However, even if the referenced context is manually injected using pdb before returning from fields_view_get() on its first pass (B), this context gets lost before entering the second pass (A) above. I noticed in the call stack from fields_view_get() up to http.py that at some point args are passed by value, not by reference, and I suspect this may be where context is lost.

As a final note, osv.orm.fields_view_get() will also need to remove xxx_view_ref from context when consumed.

summary: - Problem with xxx_view_ref calls
+ [o2m] Problem with xxx_view_ref calls
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Ok, this was logically working correctly before but was broken by xmo's refactorings. I'll let him handle this.

summary: - [o2m] Problem with xxx_view_ref calls
+ [model/dataset] Problem with xxx_view_ref calls
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Problem solved in revision 3849 of 7.0 branch.

Changed in openerp-web:
status: Confirmed → Fix Released
Changed in openerp-web:
milestone: none → 7.0
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.