Document States

Hello,

I have created a submittable doctype and in submittable doctype there is by default a status column that draft as default value.

Now i have a requirement to create one more status and give coloring effect to that statuses.I have created another field for status column and gave values to it.Also applied coloring effect on option using Document States but coloring effect is not applying.

Please guide!

Hi @NKAfridi:

status and docstatus are different fields.

docstatus is related to submittable feature. By default, until “Submit” your document has “Draft” state. This badge has priority on form view.

It’s pretty confusing because Frappe Framework manage this kind of things automatically just detecting field name status . But it works anyway …


Hope this helps.

Hello @avc

Thanks for the answer.

i understood what you said i just need to ask why coloring effect using Document States are not applying on my custom status column.

Screenshot attached for your reference.


@NKAfridi Open the record and check whether colours are applied or not.

the colours are still not applied i dont know whats the issue i even tried custom script.

frappe.listview_settings[‘Airplane Ticket’] = {
//add_fields: [“ticket_status”],
get_indicator: function(doc) {
if (doc.ticket_status === “Booked”) {
return [(“Booked”), “gray”, “ticket_status,=,Booked”];
} else if (doc.ticket_status === “Checked-In”) {
return [
(“Checked-In”), “purple”, “ticket_status,=,Checked-In”];
} else if (doc.ticket_status === “Boarded”) {
return [__(“Boarded”), “green”, “ticket_status,=,Boarded”];
}
}
};