osv_memory cannot change decimal precision of fields, and probably because it ignores it
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP R&D Addons Team 2 | ||
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP's Framework R&D |
Bug Description
A while back I reported a bug about rounding too early, and that we needed to have seperate unit price precision as well as totals and use the same precision for all unit prices regardless of document, and the same total precision regardless of document or else we have strange errors.
Anyhow, while the problem was agreed and recognised it was deemed too big a change. So I went about changing it myself. It works perfectly with just one exception. osv_memory fields. Now truthfully I think the problem might be that they don't respect decimal precision at all. However they definitely can't be changed by inheritance.
So case 1. Does not respect decimal precision at all. Change UoM precision to 3. Raise a PO for 1 product, so 2.555 units of (although it doesn't matter), go to the incoming shipments and you will see the quantity with 3 decimal places. Now press validate and the wizard pops with just 2 decimal places. Hmmm.
Case 2 is a bit trickier. However is case 1 is the bug, then you might not need to do this. Create a new Decimal Precision called unit. with a precision of 5 digits.
Now create a module which inherits some objects, say product.template changing standard price decimal precision to be 'unit', and stock.change.
Now for the awful workaround - use digits=(16,5) in osv_memory field definition and it works fine with inheritance, which leads me to the conclusion that in fact the bug is osv.osv_memory does not respect the digits_compute argument.
Related branches
- Rucha (Open ERP) (community): Approve
- qdp (OpenERP): Pending requested
-
Diff: 46 lines (+4/-3)3 files modifiedpurchase/purchase.py (+1/-1)
sale/sale.py (+1/-1)
stock/wizard/stock_partial_move.py (+2/-1)
- Naresh(OpenERP) (community): Approve
- Vo Minh Thu: Pending requested
-
Diff: 15 lines (+5/-0)1 file modifiedopenerp/osv/orm.py (+5/-0)
- Numérigraphe (community): Approve
- OpenERP Publisher's Warranty Team: Pending requested
-
Diff: 15 lines (+5/-0)1 file modifiedbin/osv/orm.py (+5/-0)
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-server: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
status: | Won't Fix → Fix Released |
Changed in openobject-server: | |
status: | Won't Fix → Fix Released |
Hello Graeme,
First thanks for the nice explanation!
I have checked this issue But I am not agree with your this point "osv.osv_memory does not respect the digits_compute argument."
Because in your case1 which is already posted on lp please check the lp :788064 and this issue is already fix committed just see the revision http:// bazaar. launchpad. net/~openerp- dev/openobject- addons/ trunk-bug- 788064- mma/revision/ 4765
I have applied this patch at my end and it is working as fine so there in no issue with osv.osv_memory just missing the pass digits_compute = dp.get_ precision( 'Purchase Price') in to cost field of the partial picking wizard.
I have attached a video on this after applied the above revision's patch so would you please check it and notify us about your problem and correct me is I am wrong on this.
And your first issue which is "use the same precision for all unit prices" I think this is your wish and which needs more improvement so for this issue I am suggesting, you have to post a another bug report which is as a "Wishlist" or you can post your this suggestion on <email address hidden> so our experts can check it and review it.
Thanks and Waiting for your reply!