[5.0] stock module contains references to purchase (but does not depend on it)
Bug #596202 reported by
Dukai Gábor
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
Jay Vora (Serpent Consulting Services) | ||
Odoo Server (MOVED TO GITHUB) |
Won't Fix
|
Low
|
Unassigned |
Bug Description
Hi!
5.0 latest bzr.
Checking for a field with hasattr() doesn't work because browse_record intercepts that call and always returns True. If the field doesn't exist, it prints a 'Programming Error' message in the log but still returns True.
The stock module is affected by this problem. How to check: install only the stock module and use the partial picking wizard with average price products.
This code in stock/wizard/
if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
To post a comment you must log in.
Regardless of the behavior of browse_record (which at first look in the code should not have hasattr() always returning True), this code is not correct as it break modularity. Installing stock without purchase is a valid case, and 'stock' should simply not have any reference to 'purchase' stuff *at all*.
This has been fixed in 6.0, and we should look into backporting it to stable (code related to purchase_line_id should move to purchase module)
Jay, do you think this qualifies for stable?