Fixed issue in Item Variant for Numeric Attributes
This commit is contained in:
parent
17dc249841
commit
75bd0f7cfe
@ -51,7 +51,7 @@ def validate_item_variant_attributes(item, args):
|
|||||||
frappe.throw(_("Increment for Attribute {0} cannot be 0").format(attribute))
|
frappe.throw(_("Increment for Attribute {0} cannot be 0").format(attribute))
|
||||||
|
|
||||||
is_in_range = from_range <= flt(value) <= to_range
|
is_in_range = from_range <= flt(value) <= to_range
|
||||||
precision = len(cstr(increment).split(".")[-1].rstrip("0"))
|
precision = len(cstr(value).split(".")[-1].rstrip("0"))
|
||||||
#avoid precision error by rounding the remainder
|
#avoid precision error by rounding the remainder
|
||||||
remainder = flt((flt(value) - from_range) % increment, precision)
|
remainder = flt((flt(value) - from_range) % increment, precision)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user