[6.x+trunk] context passing in product_id_change on sale.order
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
In Progress
|
Low
|
OpenERP R&D Addons Team 2 | ||
6.0 |
New
|
Undecided
|
Unassigned | ||
6.1 |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
http://
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:
http://
http://
http://
http://
This one is even better, it calls the pricelist with a custom context which is nothing related with the original context.
http://
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
- Niels Huylebroeck (community): Approve
- Naresh(OpenERP): Pending requested
- Priyesh (OpenERP): Pending requested
- Olivier Dony (Odoo): Pending requested
-
Diff: 136 lines (+31/-17)4 files modifiedpurchase/purchase.py (+5/-1)
purchase/purchase_view.xml (+1/-1)
sale/sale.py (+24/-14)
sale/sale_view.xml (+1/-1)
Changed in openobject-addons: | |
status: | Fix Committed → In Progress |
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!