[FIX] Add parameter in readgroup
bzr revid: jco@openerp.com-20140415091923-r5ipe0bevxrutxxh
This commit is contained in:
parent
d568c19f40
commit
888e13d22e
|
@ -280,9 +280,9 @@ class stock_quant(osv.osv):
|
||||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.quant', context=c),
|
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.quant', context=c),
|
||||||
}
|
}
|
||||||
|
|
||||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||||
''' Overwrite the read_group in order to sum the function field 'inventory_value' in group by'''
|
''' Overwrite the read_group in order to sum the function field 'inventory_value' in group by'''
|
||||||
res = super(stock_quant, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
|
res = super(stock_quant, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy=True)
|
||||||
if 'inventory_value' in fields:
|
if 'inventory_value' in fields:
|
||||||
for line in res:
|
for line in res:
|
||||||
if '__domain' in line:
|
if '__domain' in line:
|
||||||
|
|
|
@ -41,8 +41,8 @@ class stock_history(osv.osv):
|
||||||
_auto = False
|
_auto = False
|
||||||
_order = 'date asc'
|
_order = 'date asc'
|
||||||
|
|
||||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||||
res = super(stock_history, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
|
res = super(stock_history, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy=lazy)
|
||||||
prod_dict= {}
|
prod_dict= {}
|
||||||
if 'inventory_value' in fields:
|
if 'inventory_value' in fields:
|
||||||
for line in res:
|
for line in res:
|
||||||
|
|
Loading…
Reference in New Issue