Skip to Content
Menu
This question has been flagged
5 Replies
3679 Views

Hi,

I have this two function:

def _get_input(self, cr, uid, ids,
name, args, context=None):
if context is None:
context = {}
res = {}
total =0
for account in self.browse(cr, uid, ids, context=context):
if account.type == 'receipt':
total += account.amount
logger.info('__total__:%s',total)
res[account.id] = total
else :
res[account.id]= False
return res
def _get_output(self, cr, uid, ids,
name, args, context=None):
if context is None:
context = {}
res = {}
total=0
for account in self.browse(cr, uid, ids, context=context):
if account.type == 'payment' :
total += account.amount
res[account.id] = total
else:
res[account.id] = False
return res

I want to replace res[account.id] = False by the other function, for example in the _get_input I want to call _get_output how can I do it

Avatar
Discard

self._get_output(cr,uid,ids,[account.id], name, args, context=context)

EDITED: self._get_output(cr,uid,[account.id], name, args, context=context) Don't forget to put it as a valid answer

Best Answer

res[account.id] = self._get_output(cr,uid,[account.id], {}, {}, context)

Avatar
Discard
Author

Thank you for the answer but nothing change I still getting the same result ???

Edited :)

Best Answer


Hello ,

Define def _get_output(...) before def _get_input(...)

Then call it like this :

res[account.id] = self._get_output(cr,uid,[account.id], {}, {}, context)

Avatar
Discard
Author

If I do it as you have said to me I'm getting this error : return float_round(float(value or 0.0), precision_digits=self.digits[1])