Purchased order Item price is accepting 0 value

Purchased order Item price is accepting 0 value, how can we set mini 1 price?

Try this in the custom script.

frappe.ui.form.on("Purchase Order Item", {
    validate: function(frm) {
        if (cur_frm.doc.price < 1) {
            frappe.throw("Item price must be at least 1.");
        }
    }
});

Hi @kmangi,
Please apply the client script for it.

frappe.ui.form.on("Purchase Order", { 
    validate: function(frm, cdt, cdn) {
        $.each(frm.doc.items || [], function(i, d) {
            if(d.rate <= 0) {
                frappe.throw('<b>'+d.item_code+'</b>' +" Rate can not be 0");
                validated = false;
            }
        });
    }
});

I hope this helps.
Thank You!

Thanks @NCP