I am using python.
There are two columns. columns A and B. I want to reduce the value in column A and B when the save button in the press
this my code
But what happens when I press the save button. value to 0
def _tot_get_deposit(self, cr, uid, ids, name, arg, context=None):
res = {}
for deposit in self.browse(cr, uid, ids, context=context):
sum = 0.0
sum = A - B
return sum
return res
i think you need to read more about how functions work.
once you
returnanything, the function will end.you can not itterate over anything and return multiple values within a function.
try saving them locally in the function, and then at the end returning a list/dict/tuple with all the results.
for instance… i think your code could be written:
this will create a list of “sum” which is then added to your dict “res” and then returned. together as a tuple.