Hi,
We use odoo 11.
I want the field value to be the amount after entering it by the user ; convert the last three digits to zero.
from math import log
amount = fields.Float(string="Amount", compute=' _lastzero ' ,required=True)
@api.multi
def _lastzero(self):
digits=3
expo = 10**(int(math.log(self.amount, 10)) -digits+1)
return expo * (self.amount // expo)
ValueError: math domain error