active_id in XML context field not being correctly written to ir_act_window table

Bug #489183 reported by Russell Briggs
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KDE OpenObject Client
New
Undecided
Unassigned
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned
Odoo Web Client
Fix Released
Undecided
Unassigned

Bug Description

I have noticed that many of my 'links' (custom window actions) on the right-hand side of the web client have started breaking in the last couple of weeks.

I've narrowed the problem down to the special active_id variable being converted to the string 'active_id' when written to the 'context' field of the ir_act_window database table. For example:

<act_window
    id="action_partner_contract_new"
    name="New Contract"
    src_model="res.partner"
    res_model="contract"
    domain="[('partner_id', '=', active_id)]"
    context="{'partner_id' : active_id}"
    view_mode="form,tree"
    view_type="form"
/>

The 'context' field in the database for the above action is: {'partner_id' : 'active_id'}

It should be (and used to be): {'partner_id' : active_id}

I've had a poke around but have not been able to work out why this is happening :(

Related branches

Revision history for this message
Russell Briggs (russell-briggs) wrote :

I am using the 5.0 stable branch, latest revision (1884)

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

Hello Russel,

In the current version we support ref(xml_id) in context, so we needed to use eval(context).

This is not a problem at all, because context is a character field for ir_act_window.

I attach a patch for you if you want desired result.

Thank you.

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hello Jay,

I also notify this bug and I used the last revision of server (not trunk), but I have the bug in web client, in gtk client it works, maybe I should reported this bug in web client?.

context printed from act_window:

Last Gtk revision: {'lang': 'es_ES', 'active_ids': [], 'tz': False, 'citation_id': 3, 'active_id': False}
Last web revision: {'lang': u'es_ES', 'tz': False, '_terp_view_name': u'Citar Trabajadores', 'citation_id': 'active_id', 'bin_size': True, 'client': 'web', 'active_ids': [512], 'active_id': 512}

Changed in openobject-server:
status: Invalid → New
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Possibly, its related to web-client which doesn't convert active_id into the concerned id.

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello,

Its fixed in stable. Please update your code.

Revision Info:
2762 <email address hidden>

Thanks.

Changed in openobject-client-web:
status: New → Fix Committed
Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hello sma,

I tested it and it not works.

context print: {'lang': u'es_ES', 'tz': False, '_terp_view_name': u'Citar Trabajadores', 'citation_id': 'active_id', 'bin_size': True, 'client': 'web', 'active_ids': [512], 'active_id': 512}

Thanks.

Changed in openobject-client-web:
status: Fix Committed → New
Changed in openobject-client-web:
status: New → In Progress
Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello Omar,

I attach a patch please apply on stable branch, it will gives you desired result.

Thanks.

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hello sma,

It works, you can apply this patch in the branch.

Thank You.

Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello,

Its fixed in stable branch. Please update your code.
Revision Info:
2766 <email address hidden>

Thanks.

Changed in openobject-client-web:
status: In Progress → Fix Committed
Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hello,

I repeated my last comment but referenced to kde client:

I also notify this bug and I used the last revision of server (not trunk), in gtk and web clients it works.

context printed from act_window:

Last Gtk revision: {'lang': 'es_ES', 'active_ids': [], 'tz': False, 'citation_id': 1307, 'active_id': False}
Last web revision: {'lang': u'es_ES', 'tz': False, '_terp_view_name': u'Citar Trabajadores', 'citation_id': 1307, 'bin_size': True, 'client': 'web', 'active_ids': [], 'active_id': 1307}

Last Kde revision: {'lang': 'es_ES', 'active_ids': [], 'tz': False, 'citation_id': 'active_id', 'active_id': 1307}

Thanks

Changed in openobject-client-web:
status: Fix Committed → Fix Released
Changed in openobject-client-web:
milestone: none → 5.0.11
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.