← Back to team overview

openerp-india team mailing list archive

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

 

Public bug reported:

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

** Affects: openobject-addons
     Importance: Undecided
         Status: New

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

Title:
  How to extend an osv.osv_memory class?

Status in OpenERP Addons (modules):
  New

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-addons/+bug/942647/+subscriptions


Follow ups

References