diff --git a/models/doctype/Item/Item.js b/models/doctype/Item/Item.js index b5d87d1c..80a6991f 100644 --- a/models/doctype/Item/Item.js +++ b/models/doctype/Item/Item.js @@ -93,7 +93,14 @@ module.exports = { fieldname: 'rate', label: 'Rate', fieldtype: 'Currency', - placeholder: '0.00' + placeholder: '0.00', + validate(value) { + if (!value) { + throw new frappe.errors.ValidationError( + 'Rate must be greater than 0' + ); + } + } } ], quickEditFields: ['rate', 'unit', 'itemType', 'tax', 'description'],