← Back to team overview

openerp-india team mailing list archive

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

 

Hello,

It should work just as expected, and from what you describe it seems
you're doing the right thing. Perhaps there is something else missing,
such as your module not being really loaded as you imagine it is. Did
you double-check that it was properly installed and loaded with the
correct version of the code?

Anyhow, this does not seem to be a bug, so I'll convert it to a question
on Launchpad answers[1]. You could also ask on IRC [2], where other
community members may help you debug your module. Providing your whole
module would be very useful too in order to test it directly.

By the way, our bug fixing policy requires to report bugs for past stable versions via the OpenERP Enterprise channel rather than Launchpad, unless they are reproducible also on the latest trunk version too. This is explained in [3].
Do not hesitate to double-check this test case on OpenERP 6.1 or on the latest trunk version, it should also work just as expected.

[1] https://answers.launchpad.net/openobject-server
[2] http://www.openerp.com/irc
[3] http://bit.ly/openerp-bug-policy

** Project changed: openobject-addons => openobject-server

** Changed in: openobject-server
       Status: New => Invalid

** Converted to question:
   https://answers.launchpad.net/openobject-server/+question/189120

-- 
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