I want to Restrict the keyboard to input float (1.00) values, Characters, and special characters in the Sale order line Quantity field ( only allowing the input of Integer values) by using python
@api.onchange('product_uom_qty')
def _check_integer_so(self):
for rec in self:
if rec.product_uom.is_integer_qty:
x = (rec.product_uom_qty % 1)
if x != 0:
raise ValidationError("Please Enter Integer values Quantity Field")
for restrict decimal number, I put a boolean field in uom.uom model, if the boolean is true then restric to put float or charector in quantity field
Hi,
Seems like this function will solve your issue. Can you explain what's the issue that you are facing using your function?
I want to restrict to entering decimal and characters values in the quantity field. only allow integer values
In sale order line
Currently Quantity field shows as 1.00 , I want to change it into 1 (No decimal values)