Xavier ALT (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.1-opw-578842-xal into
lp:openobject-addons/6.1.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578842-xal/+merge/124468
Hi,
This branch fix a call of store parent's function.
Steps:
- install sale and sale_margin
- create a SO with one line
- save it
- edit and remove the sale order line
- save <=== HERE
Current: raise an exception TypeError: super(type, obj): obj must be an
instance or subtype of type
Expected: no crash
Note: as for store function self is instance of object triggered the update
(here: sale.order.line
- super() call should be done on "sale.order" instance
- _get_order() should be a raw function reference (currencly givent
_get_order() is an sale.order's bounded method)
Regards,
Xavier
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578842-xal/+merge/124468
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.1-opw-578842-xal.
=== modified file 'sale_margin/sale_margin.py'
--- sale_margin/sale_margin.py 2012-09-11 07:47:29 +0000
+++ sale_margin/sale_margin.py 2012-09-14 16:27:23 +0000
@@ -70,7 +70,8 @@
return result
def _get_order(self, cr, uid, ids, context=None):
- return super(sale_order, self)._get_order(cr, uid, ids, context=context)
+ parent_get_order = super(sale_order, self.pool.get('sale.order'))._get_order.im_func
+ return parent_get_order(self, cr, uid, ids, context=context)
_columns = {
'margin': fields.function(_product_margin, string='Margin', help="It gives profitability by calculating the difference between the Unit Price and Cost Price.", store={
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp