← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 800970] Re: osv_memory cannot change decimal precision of fields, and probably because it ignores it

 

Hello,

6.0 :-  It has been fixed at lp:~openerp-dev/openobject-
server/6.0-bug-800970-ysa and it will be merged soon to the stable 6.0
server branch.

Thanks,

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/800970

Title:
  osv_memory cannot change decimal precision of fields, and probably
  because it ignores it

Status in OpenERP Modules (addons):
  Fix Committed
Status in OpenERP Server:
  Fix Committed

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.standard.price changing new price to 'unit' (Note 1 is
  osv the other osv_memory).  Find a product, give it a cost method of
  standard price and you will see 5 digits.  enter .07654, then change
  it to average cost.  So we have 5 digits.  Now click update standard
  price and see only 2 decimals (or receive a shipment priced at 0.07654
  if you have set Purchase Price precision also to 5 and low and behold
  our average cost is 0.08)

  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/800970/+subscriptions


References