← Back to team overview

openerp-india team mailing list archive

[Bug 1018516] Re: [6.1][sale_margin] Regression : Super() call malfunctioned!

 

I had forgotten the same correction in the Super() call in my summary.
But this not solve my problem. Sorry for not provide more details about
the error, is complex to explain.

The error is not launched using the web client, only when is called from
XML-RPC with a Django App, but I solve the problem removing the line 77
from the sale_margin.py as I said before (and the super() fix), and I
publish the error to help others with the same problem.

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

Title:
  [6.1][sale_margin] Regression : Super() call malfunctioned!

Status in OpenERP Addons (modules):
  Fix Committed

Bug description:
  When the sale_margin is installed, and after a sale order is created,
  if you try to add a sale order line, the next error is raised:

      2012-06-27 17:28:53,038 7463 ERROR ? openerp.osv.osv: Uncaught exception
      Traceback (most recent call last):
        File "/python/openerp61/server/openerp/osv/osv.py", line 121, in wrapper
          return f(self, dbname, *args, **kwargs)
        File "/python/openerp61/server/openerp/osv/osv.py", line 176, in execute
          res = self.execute_cr(cr, uid, obj, method, *args, **kw)
        File "/python/openerp61/server/openerp/osv/osv.py", line 164, in execute_cr
          return getattr(object, method)(cr, uid, *args, **kw)
        File "/python/openerp61/server/openerp/addons/sale_layout/sale_layout.py", line 93, in create
          return super(sale_order_line, self).create(cr, user, vals, context)
        File "/python/openerp61/server/openerp/osv/orm.py", line 4194, in create
          result += self._store_get_values(cr, user, [id_new], vals.keys(), context)
        File "/python/openerp61/server/openerp/osv/orm.py", line 4255, in _store_get_values
          target_ids = [id for id in function[id_mapping_fnct_](self, cr, SUPERUSER_ID, ids, context) if id]
        File "/python/openerp61/server/openerp/addons/sale_margin/sale_margin.py", line 73, in _get_order
          return super(sale_order,self)._get_order(cr, uid, ids, context=context)
      TypeError: super(type, obj): obj must be an instance or subtype of type
      2012-06-27 17:28:53,073 7463 ERROR ? openerp.netsvc: super(type, obj): obj must be an instance or subtype of type

  If you remove the line 77 from the sale_margin.py sources, the error
  is not launched, but maybe is not the best solution:

      75    _columns = {
      76        'margin': fields.function(_product_margin, string='Margin', help="It gives profitability by calculating the difference between the Unit Price and Cost Price.", store={
      77                'sale.order.line': (_get_order, ['margin'], 20),
      78                'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 20),
      79                }),
      80    }

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


References