[6.x+trunk] context passing in product_id_change on sale.order

Bug #1010032 reported by Niels Huylebroeck on 2012-06-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons
In Progress
OpenERP R&D Addons Team 2
Fix Committed

Bug Description


For custom code this makes it very hard and impractical to extend functions and use context to do this.

Personally I'm involved in some code that changes how uom conversions are done depending on the product, I was passing 'product_id' in the context but the method product_id_change throws out the entire context to replace it with something containing only 'lang' and 'partner_id' ignoring any other context key/value pairs that could've been in context.

Also note how many methods are called without passing context along:


This one is even better, it calls the pricelist with a custom context which is nothing related with the original context.

I can't see how much trouble adding context to these calls would create?
But I can tell you it would make for excellent extensibility if you would pass the context around consistently.

Related branches

Merged into lp:openobject-addons/6.1 at revision 7022
Niels Huylebroeck (community): Approve on 2012-10-03
Naresh(OpenERP): Pending requested 2012-06-22
Priyesh (OpenERP): Pending requested 2012-06-22
Olivier Dony (Odoo): Pending requested 2012-06-22
Amit Parik (amit-parik) wrote :

Hello Niels,

First look your branch looks fine, as well as I agreed that this all places context problem will occurs at the time of custom code.

You are providing a branch for 6.1, that's better if you will provide a branch for trunk. Curretly I am setting this as a "Fix Committed" our core team will review of your branch.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: New → Fix Committed
Niels Huylebroeck (red15) wrote :

I'm not sure if providing this for trunk is still relevant ? Won't 7.0 replace all the onchange functions anyway ?

security vulnerability: no → yes
security vulnerability: yes → no
Changed in openobject-addons:
status: Fix Committed → In Progress
Niels Huylebroeck (red15) wrote :

Partial fix was included while fixing another bug that we reported, linked it to this bug report.

Niels Huylebroeck (red15) wrote :

Marked 6.1 branch as fixed, still no progress on 6.0 branch

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

Other bug subscribers