Skip to Content
Menu
This question has been flagged
2295 Views

def _amount_all(self, cr, uid, ids, field_name, arg, context=None):

res = {}

for inter in self.browse(cr, uid, ids, context=context):

res[inter.id] = {

'amount_total': 0.0,

}

val = 0.0

for line in inter.ligneinter_ids:

val += line.total_line

res[inter.id]['amount_total'] = val

return res


'amount_total': fields.function(_amount_all, string='Total', type='float', digits_compute=dp.get_precision('Account'), help="The total amount."),

Avatar
Discard
Author

I resolve this problem by the modify in function: def _amount_all(self, cr, uid, ids, field_name, arg, context=None): res = {} for inter in self.browse(cr, uid, ids, context=context): val = 0.0 for line in inter.ligneinter_ids: val += line.total_line res[inter.id] = val return res this just for my framework module, thinks ;)