Try ERPNext Buy Support Partners Foundation

On submitting the doc, system should validate

On submitting the doctype(Order Book), system should validate based on some condition(let’s say should validate for only default company).
how can we do it?
Do we have to do it with custom script or with order_book.js ?

on_submit: function(frm) {

    if(frm.doc.company !== ) {
        frappe.throw(__('Not a default company.'));
        validated = false;
    }
}   

what should be the condition to check whether it is a default value or not?