Showing different name than document name

Hello;

For example, I need to use the Vehicle and Vehicle Log document type in another module that I created which is called Taxi module.
But I need to display them in the module as Taxi Vehicle and Taxi Vehicle Log, but it should take you to the same document type (which is the Vehicle and Vehicle Log document type).

So, let us come back to the config directory which has the “taxi.py” as config file, it look like as below, what should be the settings in this py config file:

                    "label": _("Taxi Fleet Management"),
                    "items": [
                            {
                                    "type": "doctype",
                                    "name": "Vehicle",
                                    "description": _("Vehicle"),
                            },
                            {
                                    "type": "doctype",
                                    "name": "Vehicle Log",
                                    "description": _("Vehicle Log"),
                            }
                    ]

I tried to set the description “Taxi Vehicle” but still I see it “Vehicle” as shown in the below image:

Regards
Bilal

Try using the label prop, @bghayad. Like this:

                "label": _("Taxi Fleet Management"),
                "items": [
                        {
                                "type": "doctype",
                                "name": "Vehicle",
                                "label": _("Taxi Vehicle"),
                        },
                        {
                                "type": "doctype",
                                "name": "Vehicle Log",
                                "label": _("Taxi Vehicle Log"),
                        }
                ]
1 Like

Wonderful. It worked :+1:

how to get vehicle-doc.type odometer value (last) to shown in another one doc type field name.

eg : last vehicle odometer value is :10000

the same values shown in another one doc.type field.

pl explain

Hello @Sendilkumar

By using the following python method:

last_odometer = frappe.db.get_value(“Vehicle”,{“name”: docname, “last_odometer”)

And u can set the value of the other field in other document from python and from javascript, it depends on what u need to do, so in python, it will be as following:

frappe.db.set_value(“DocType”, “doc_name”, “field_name”, last_odometer)

And in javascript, it will be using the following (if it is parent doctype):

cur_frm.set_value(“field_name”, last_odometer);

And if it is child doctype, then it will be using the following (in javascript):

frappe.model.set_value(cdt, cdn, “field_name”, last_odometer);

Of course, to be able to use python method, you have to use frappe.call.

Regards
Bilal

Thanks Bilal, will apply the query and update.