different context passed from xml with web client compared to gtk client

Asked by Joel Cabral

Hi all,

Is there a different way of passing context from XML when using a GTK client and web-client?

I have this XML code

<button icon="gtk-ok" context="{'location_id': location_id,'product_id':product_id}" name="call_onchange" string="Check Rules" type="object"/>

this is working perfectly by passing this context to python file,

context output: (GTK client)

{'lang': u'en_US', 'tz': False, 'product_id': 3, 'section_id': False, 'project_id': False, 'location_id': 22, 'department_id': False}

the problem is when I run the same thing with web client, it gives a different context output

(Web client)

{'lang': u'en_US', 'project_id': False, 'tz': False, 'active_model': 'ir.ui.menu', 'department_id': False, 'section_id': False, 'client': 'web', 'active_ids': [2, 5], 'active_id': 5}

why is this happening? the context that I passed from XML is not passed to py file when Im using web client.

Am I missing something or is this a bug?

Regards,
joel

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#1

Greetings from SerpentCS Joel,

If this is the case that web client is not passing context then it is bug obviously, you should post bug for the same.
In OpenERP architecture both GTK and WEB clients are parsing xml tag for the view. So different outputs from both clients are not possible. May be passing context is an issue in web client but it should be same for all on_change and context.
In many views like product search, on_change product on sale order line view are working smoothly with same output from both the client with context.

Please send your sample module for more investigation and post the bug if it is behaving like this.

Regards,
SerpentCS.

Revision history for this message
Joel Cabral (hephaestus) said :
#2

Hi

I get it now, but still its weird.

I have an object with a one2many field. I create an entry to one2many field but it doesnt pass the context of the one2many instead it passes the context of the main object.

anyway thanks,

Can you help with this problem?

Provide an answer of your own, or ask Joel Cabral for more information if necessary.

To post a message you must log in.