Doesn't pass @context attribute of a field to the server

Bug #507448 reported by Xavier (Open ERP)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE OpenObject Client
Status tracked in 5.0
5.0
Invalid
Undecided
Unassigned
Odoo GTK Client (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Invalid
Medium
Unassigned
Trunk
Fix Released
Medium
Unassigned

Bug Description

At least not for many2many fields.

Context: in the UI alterations for 5.2/6, mrp.production.move_lines is to be split in two (at least at the interface level) with 2 tables side-to-side having slightly different fields. So default views don't quite work.

Previously, chs introduced the %(view_type)s_view_ref context variable on a field which allows the selection of a given view for a relation field display/listing (you can see it in osv.orm, ~line 1320) which I wanted to use to give two different views to my relational fields (to the same model) but on tracing, the server debug for the GTK client (with a few debug statements installed in osv.orm around *_view_ref) yields:

[2010-01-14 12:51:07,498] DEBUG:fields_view_get:self = <osv.osv.stock.move object at 0x1030aecd0>
[2010-01-14 12:51:07,500] DEBUG:fields_view_get:context = {'lang': u'en_US', 'search_context': {}, 'section_id': False, 'tz': False}
[2010-01-14 12:51:07,501] DEBUG:fields_view_get:view_id = False
[2010-01-14 12:51:07,503] DEBUG:fields_view_get:view_ref = False

while the web client yields:

[2010-01-14 12:53:31,673] DEBUG:fields_view_get:self = <osv.osv.stock.move object at 0x1030aecd0>
[2010-01-14 12:53:31,675] DEBUG:fields_view_get:[01]: context = {'client': 'web',
[2010-01-14 12:53:31,675] DEBUG:fields_view_get:[02]: 'lang': u'en_US',
[2010-01-14 12:53:31,675] DEBUG:fields_view_get:[03]: 'section_id': False,
[2010-01-14 12:53:31,675] DEBUG:fields_view_get:[04]: 'tree_view_ref': 'mrp.production_order_move_line_to_consume_view',
[2010-01-14 12:53:31,675] DEBUG:fields_view_get:[05]: 'tz': False}
[2010-01-14 12:53:31,677] DEBUG:fields_view_get:view_id = False
[2010-01-14 12:53:31,678] DEBUG:fields_view_get:view_ref = 'mrp.production_order_move_line_to_consume_view'

So the web client provides its type and — more importantly for this case — the tree_view_ref which was set on the field in the following manner:

<field colspan="2" name="move_lines_to_consume"
         nolabel="1" context="{'tree_view_ref':'mrp.production_order_move_line_to_consume_view'}"/>

Note that move_lines_to_consume is defined in mrp.production in the following manner:

        'move_lines_to_consume':fields.function(_moves_selector,
            method=True, type='many2many', relation='stock.move',
            string="Products to consume", arg=('state','!=','done')),

(_moves_selector simply filters on mrp.production.move_lines based on the criteria provided as argument)

Related branches

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

This bug seems to be linked to 5.0, Why ?

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Invalidating the bug,as it should be linked to trunk only.

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote :

Since it seems it should be solved in trunk only, we close the bug by now since we don't support it yet.

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.