ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Dashboard issue heatmap in v9


#41

Yes @joelios
Wonderful.
Every thing is working fine. BRAVO.
But still Student heatmap (and I know that still you did not do any thing with it) is not working properly. Actually it is showing the marks on the heatmap but in wrong date.

I need to add one more thing for your previous post, it is required to do the following command:

$ bench migrate

Because you need to create the field Heatmap Style in the database.

I have one point out of this post:
Do you have activity regarding grid? Because we would if it possible to resolve the list view problem (as we need to be able to add more fields and to have the horizontal scroll bar to navigate left and right).

Regards
Bilal


#42

I’m glad to hear that it works for you too!

Yes, sorry, you’re absolut right!

I will look at the heatmap of student in the near future. In the new topic you see my backlog and where I am currently.

As soon as the heatmap topic is finished, I can look at this.

cheers


#43

Hi @bghayad

I’ve finaly reworked the student heatmap also.
If you pull my latest commit, the student heatmap should work correct :slight_smile:

Cheers!


#44

Hello @joelios
Great full. Amazing.
It came after long long waiting time.

So it needs pull request to be merged.

Regards
Bilal


#45

Pull requests are placed. They waiting to be merged :wink:


#46

Thanks a lot for you @joelios

I was need to ask you about grid and if you can help to resolve the list view problem.
But first of all: what kind of activity you have about grid?
Second: Can we resolve the list view problem: because we would if it possible to resolve the list view problem (as we need to be able to add more fields and to have a horizontal scroll bar to navigate left and right).

Regards
Bilal


#47

Hi @bghayad

With changes on list_render.js, it is possible to add mor fields to listview:


but adding a horizontal scrollbar would involve significant changes to list_render.js!
My question; Do you really need to force more fields in the listview? you can solve the same also over a report …?

Cheers


How to add more columns to listview
#48

Hello @joelios
Wonderful and amazing. Thanks a lot for you on this big effort and great work.
I will try list_render.js as this will resolve maybe 80% of the problem.
Having horizontal scroll bar to navigate left and right for more columns is giving powerful to manage the business because the user will have a look for all the records with very enough information to decide which record is need to work on it. This will prevent from the opposite case where user will need to go through each record and check if this record is the needed or not and coming back to list and repeat this work.

One more feature is also important to have strength while working with the records:
Inside the document, there should be Next and Back button to be able to go for the next record or previous record without coming back to the list (of course this to be within the filtered records).

But let me tell you that you helped us a lot by directing us to list_render.js and as I told you, this resolved 80% of the problem. I will go for the posts that we placed about this problem and direct them for this link.

Regards
Bilal


#49

Youre welcome! :slight_smile:

The code youre looking for is in line 204 (if (me.total_colspans < 12)):

	docfields_in_list_view.forEach(function (d) {
		if (overridden.includes(d.fieldname) || d.fieldname === me.title_field) {
			return;
		}
		if (me.total_colspans < 12) {
			me.add_column(d);
		}
	}); 

and line 249:

		// Limit number of columns to 4
		this.columns = this.columns.slice(0, 4);

best regards
Joelios


#50

Hello @joelios

I would to notify about heatmap for education, certainly for student attendance.
I am getting the following error when I add attendance for the student and coming to student document which contains the heatmap:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 274, in get_open_count
out[‘timeline_data’] = module.get_timeline_data(doctype, name)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/education/doctype/student/student.py”, line 63, in get_timeline_data
timestamp = get_timestamp(date)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 126, in get_timestamp
return time.mktime(getdate(date).timetuple())
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 42, in getdate
return parser.parse(string_date).date()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 1182, in parse
return DEFAULTPARSER.parse(timestr, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 556, in parse
res, skipped_tokens = self._parse(timestr, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 675, in _parse
l = _timelex.split(timestr) # Splits the timestr into tokens
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 192, in split
return list(cls(s))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 61, in init
‘{itype}’.format(itype=instream.class.name))
TypeError: Parser must be a string or character stream, not int

I think that the problem maybe related to the unix_timestamp as the following line is causing the error:

timestamp = get_timestamp(date)

Again, it is happening only with student attendance transactions.

Regards
Bilal


#51

Hello @joelios

I am sorry, for education: I discovered that I did not do the frappe changes. I will re fix and come back to you.

Regards
Bilal


#52

Hello @joelios
I confirmed the problem that is related to the education heatmap that you proposed, but it is only related to the attendance and it seems that it is related to the unix_timestamp at the query which cause error that is related to the timestamp = get_timestamp(date) as in the following traceback:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 274, in get_open_count
out[‘timeline_data’] = module.get_timeline_data(doctype, name)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/education/doctype/student/student.py”, line 63, in get_timeline_data
timestamp = get_timestamp(date)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 126, in get_timestamp
return time.mktime(getdate(date).timetuple())
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 42, in getdate
return parser.parse(string_date).date()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 1182, in parse
return DEFAULTPARSER.parse(timestr, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 556, in parse
res, skipped_tokens = self._parse(timestr, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 675, in _parse
l = _timelex.split(timestr) # Splits the timestr into tokens
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 192, in split
return list(cls(s))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dateutil/parser.py”, line 61, in init
’{itype}’.format(itype=instream.class.name))
TypeError: Parser must be a string or character stream, not int

Can you please help?
Regards
Bilal


#53

Hello,

where this list_render.js is?


#54

Good question it seems nowhere to be found

frappe@ubuntu:~/frappe-bench$ find . -name ‘list_render.js’


#55

Found it. Now name is list_renderer.js


#56