[MERGE] sale_margin: functions passed to store triggers cannot use inheritance, courtesy of Serpent Consulting Services

bzr revid: odo@openerp.com-20121219012510-m04yzgxnw9yzwtqc
This commit is contained in:
Olivier Dony 2012-12-19 02:25:10 +01:00
commit 7aba2e01f9
1 changed files with 5 additions and 2 deletions

View File

@ -70,7 +70,10 @@ class sale_order(osv.osv):
return result
def _get_order(self, cr, uid, ids, context=None):
return super(sale_order, self)._get_order(cr, uid, ids, context=context)
result = {}
for line in self.pool.get('sale.order.line').browse(cr, uid, ids, context=context):
result[line.order_id.id] = True
return result.keys()
_columns = {
'margin': fields.function(_product_margin, string='Margin', help="It gives profitability by calculating the difference between the Unit Price and the cost price.", store={
@ -81,4 +84,4 @@ class sale_order(osv.osv):
sale_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: