Python 如何用odoo8中的read_组覆盖字段的和
我想更改字段obj_global的和,但我不能这样做 我覆盖了函数read_group,但没有正确的和 我想要 总金额=按区段划分的组金额\u id:130000=10000+70000+50000 这是为了我们的帮助Python 如何用odoo8中的read_组覆盖字段的和,python,sum,odoo-8,Python,Sum,Odoo 8,我想更改字段obj_global的和,但我不能这样做 我覆盖了函数read_group,但没有正确的和 我想要 总金额=按区段划分的组金额\u id:130000=10000+70000+50000 这是为了我们的帮助 def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True): res = super(obj_r
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
res = super(obj_report_line, self).read_group(cr, uid, domain, fields, groupby, offset, limit=limit, context=context, orderby=orderby, lazy=lazy)
if 'obj_report_line' in fields :
for line in res:
if '__domain' in line:
lines = self.search(cr, uid, line['__domain'], context=context)
pending_value = 0.0
for current_account in self.browse(cr, uid, lines, context=context):
if 'section_id' in groupby and 'date' not in groupby:
pending_value = current_account.obj_global
else:
pending_value = 0.0
if
fields.remove('column')
line['obj_global'] = pending_value
return res