16 lines
590 B
JavaScript
16 lines
590 B
JavaScript
// Mutual exclusion between the two purchase-classification checkboxes on
|
|
// Purchase Invoice: only one of `purchase_type` / `agricultural_goods` may be
|
|
// set at a time. Checking one clears the other.
|
|
frappe.ui.form.on('Purchase Invoice', {
|
|
purchase_type: function (frm) {
|
|
if (frm.doc.purchase_type && frm.doc.agricultural_goods) {
|
|
frm.set_value('agricultural_goods', 0);
|
|
}
|
|
},
|
|
agricultural_goods: function (frm) {
|
|
if (frm.doc.agricultural_goods && frm.doc.purchase_type) {
|
|
frm.set_value('purchase_type', 0);
|
|
}
|
|
},
|
|
});
|