I have a custom doctype “Quality Update”
i want when i simply save the form the status which is in draft changes to “Quality Pending”
Tried below codes but didn’t work (all are working when i submit), i know it is possible
class QualityUpdate(Document):
def before_validate(self):
self.status = "Quality Pending"
frappe.listview_settings['Quality Update'] = {
// Customize the visual indicator based on the status
get_indicator: function (doc) {
if (["Quality Pending", "In-process"].includes(doc.status)) {
return [(doc.status), "orange", "status,=," + doc.status];
} else if (doc.status === "Draft") {
return ["Draft", "blue", "status,=,Draft"];
} else if (doc.status === "Pass") {
return ["Pass", "green", "status,=,Pass"];
} else if (doc.status === "Rejected") {
return ["Rejected", "red", "status,=,Rejected"];
}
}
};
many other also like, validate, before_save, before_submit etc, but didn’t work
anyone please help?