← Back to team overview

openerp-india team mailing list archive

Re: [Bug 942647] Re: How to extend an osv.osv_memory class?

 

*** This bug is a duplicate of bug 917931 ***
    https://bugs.launchpad.net/bugs/917931

Thanks Hbto and Graeme for pointing out this limitation of the osv_memory
classes in 6.0 and the corresponding workaround, I had forgotten about this!
I'd like to add that as of OpenERP 6.1, TransientModels (formerly osv_memory)
objects are working exactly like normal models, therefore you will be able to
use decimal_precision in the expected way.

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/942647

Title:
  How to extend an osv.osv_memory class?

Status in OpenERP Server:
  Invalid

Bug description:
  We are usign OpenERP Version 6.0.3.

  The Problem:
  We tried to extend from the class 'stock.move.memory.out' to set the decimal precision on the field "cost". This field appears in the wizard when you accept the delivery.

  How to get to this wizard:
  - create purchase order and proceed to the end of it
  - then open "Receptions" for this purchase order
  - open the reception
  - in the receptions press "Process"
  - now you get a wizard where you can see the field "cost"

  Here we would like to have a decimal precision of 4 digits. So we
  tried to overwrite the class as follow:

  class stock_partial_move_memory_in_extended(osv.osv_memory):
      _inherit = 'stock.move.memory.in'
      _columns = {
          'cost' : fields.float("Cost", help="Unit Cost for this product line", digits_compute=dp.get_precision('Purchase Price')),
      }

  stock_partial_move_memory_in_extended()

  But this does not work, we still have a float with decimal precision
  of 2.

  Could you please fix this bug and tell us what the changes are? How can you overwrite a field in an osv.osv_memory class?
  Thanks.

  Best regards,
  Olivier Jossen

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


References