I have created a Custom DocType in which I am having 2 buttons.
New Product and Existing Product
When I press New Product button it displays few fields:
New Product Name and New Product Description
There are some conditions written in depends _on on each of these fields:
New Product Name
depends_on:
eval:doc.old_new=='New' && doc.added_to_order=='No'
New Product Description
depends_on:
eval:doc.old_new=='New' && doc.added_to_order=='No'
And on the new_product button I have written a code:
frappe.ui.form.on("Shipping Lists","new_product", function(frm, cdt, cdn) {
var d =locals[cdt][cdn];
frappe.model.set_value(cdt,cdn,"old_new","New");
});
Also I am setting the value of added_to_order
frappe.ui.form.on("Shipping Lists","add_to_order", function(frm, cdt, cdn) {
var d =locals[cdt][cdn];
frappe.model.set_value(cdt,cdn,"added_to_order","Yes");
Issue is when I make old_new field hidden it doesn’t display the other fields like
New Product Name and New Product Description
But when I make it visible it works.
Any idea what could be the issue?