Customize Lead List

Hi,
I’m trying to customize the Lead List, at the version 4.7 is
[checkbox | user-avatar | company | status]

My goal is to show it in this format
[ lead-id | lead-owner | lead-date-created | lead-email-id ]

After reading some topics here I could do this

  1. Go to apps/erpnext/erpnext/selling/doctype/lead folder

  2. Change lead_list.js

    frappe.listview_settings[‘Lead’] = {
    add_fields: [“creation”, “lead_owner”, “email_id” ,“status”]
    };

  3. Change lead_list.html

My result was this

But I still need to make these changes

  1. Remove the avatar
  2. Remove the “Contact Name”
  3. Show the created as date, not as date-time
  4. Show the lead-owner as lead-owner-name and lead-owner-lastname

I’ve read ALL the doc of frappe and ERPNext and I can NOT image what to do next. Because the documentation is still almost NULL.
At least if somebody going to answer me, please, let me know if we are doing stuff on the server side or this functions belongs to the client side.

PS:
HOW you can debug a variable in the *.py OR in the template engine(JINJA) ? Because I’ve tried
in python

frappe.debug('message') --->NOTHING

in JINJA
{% pprint() %} —>DONT WORK
{# this is a commment #} ---->DONT WORK

Please, DO NOT replay me to go to https://frappe.io/docs

Thanks

This design has been changed in v5, so I recommend you hold and redesign it in version 5.

These are all client side templates, so you need to use js functions

  1. For date formatting you can use frappe.format(mydate, {"fieldtype":"Date"})
  2. To get full name: frappe.user.full_name(userid)

To remove the avatar you will have to edit in frappe - listview.js

Thanks for the replay!
I will update to version 5.
Please, can you clarify these doubts to me.

  1. To process the tags in the lead_list.html
 {%= list.get_avatar_and_id(doc)%}

is NOT JINJA, is javascript, what are you using for that?
2. In order to override the function get_avatar_and_id in listview.js I had a better idea:
a. I created a new app called testapp
b. I added in apps/testapp/testapp these folders public/js and added the testapp.js.
c. Inside testapp.js i wrote

	frappe.views.ListView = frappe.views.ListView.extend({
		get_avatar_and_id: function(data, without_workflow) {
		   -- HERE I MADE MY CHANGE --
		},
	});;

d. Add in public the file build.json

{
	"js/testapp.min.js": [
			"public/js/testapp.js"

	]
}

e. Uncomment in my module the hook.py module

app_include_js = "/assets/js/testapp.min.js"

e. Build the *.js compressed for my default site site1.local

bench frappe site1.local --build

f. My missing step is to add to my header /assets/js/testapp.min.js
Can you help me with that please…

I got it!
I had to restart the bench

bench restart

For client side templating we are using John Resig’s microtemplate

Version 5 looks pretty good!
But…How can I edit this row?
Instead of show Lead Owner as email, show it as Name LastName.

Why I can’t override the lead_list.js from Lead in my own testapp app?
When I set in my /assets/js/testapp.min.js

frappe.listview_settings.Lead.add_fields = ["territory","status", "source"];

I got this error frappe.listview_settings is undefined
Does the view render later ?

Maybe needs to be a way to hook your own _list.js - do you want to give it a shot.

Here is a starting point:

https://github.com/frappe/frappe/blob/v5.0/frappe/desk/form/meta.py#L63