timesheet icon indicating copy to clipboard operation
timesheet copied to clipboard

[16.0][hr_timesheet_sheet] New timesheet lines are added at the bottom of the list

Open innovara opened this issue 1 year ago • 2 comments

Module

hr_timesheet_sheet

Describe the bug

In List view, new timesheet lines are added at the bottom of the list whereas the lines are listed in reverse chronological order.

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior: Timesheets -> My Timesheets -> My Timesheets -> NEW

Expected behavior As it happens in 14.0, I would expect the new line to go at the top of the list so you can add the details and save quickly and to be consistent with the reverse chronological order used to list the entries.

Additional context I have tried on Firefox and Chrome in Windows and Linux and it's exactly the same. I have used hr_timesheet_sheet in 14.0 for a number of years and now I am testing 16.0 to see if I make the jump. It's a self-hosted server and I can provide more details of Python and modules upon request.

innovara avatar May 11 '24 00:05 innovara

Hi @innovara

I can't reproduce this, on my side, new created sheet are displayed first in the list. If you still have the problem can you provide screenshots or a screencast?

maisim avatar Sep 10 '24 14:09 maisim

Hi. Thanks for looking into this. I am not reporting a problem adding timesheets. I am reporting a problem adding lines to an existing timesheet.

Steps to reproduce the behavior: Timesheets -> My Timesheets -> My Timesheets -> NEW

Yes, I still have the problem and I could send a screencast but can you please confirm that you are trying to reproduce the problem adding a new line to an existing timesheet on the screen as per the path above?

innovara avatar Sep 10 '24 16:09 innovara

In case you are still interested in looking into this, this a screencast on Odoo 17.0. Same as what I reported on 16.0. The new lines go at the bottom. On Odoo 14.0 they go at the top. I'll prepare a test environment for 14.0 and upload another screencast for comparison. It could be something to do with Odoo itself, rather than the timesheet add on, or web_widget_x2many_2d_matrix maybe.

https://github.com/user-attachments/assets/f22ca391-b1bb-4148-8f17-c753237e317a

innovara avatar Mar 05 '25 22:03 innovara

Here is the screencast on 14.0, it took less time to set it up than I thought.

https://github.com/user-attachments/assets/ea0e91a6-6162-4419-beff-b162a0ad3b12

innovara avatar Mar 05 '25 22:03 innovara

I've investigated this a bit more and it seems to me that the menu My Timesheets is just basically Odoo standard functionality. I've also set up a few test environments to see which version introduced the change.

In 15.0 it worked as in 14.0 with the new line going on top of the list.

https://github.com/user-attachments/assets/56edacfd-5eec-4e6e-833f-9090bd01072d

In 16.0 it starts to go to the bottom.

https://github.com/user-attachments/assets/aca6ebf8-6878-424b-a06b-fcd6361ca393

And I've also registered for a trial on Odoo and checked their Timesheet module on 18.0 and it does the same, it goes to the bottom.

https://github.com/user-attachments/assets/2aee3561-ec55-4089-806b-8aebaaf5caff

I will try my luck and open an issue on Odoo's repo. For me is a clear regression. When you have many lines, and professionals billing time on timesheets do have them, you don't want to scroll all the way down every time to complete the line.

innovara avatar Mar 07 '25 16:03 innovara

After opening an issue on Odoo's repo I got pointed in the right direction and I traced down the change to the following commit and PR.

https://github.com/odoo/odoo/commit/4887354558513e0cdfaa3630c626e3f1705af8c5 https://github.com/odoo/odoo/pull/87630

So, what I see as an issue is to do with changing editable="top" to editable="bottom" on the view defined on addons/hr_timesheet/views/hr_timesheet_views.xml, which is nothing to do with hr_timesheet_sheet so I will close this issue.

innovara avatar Mar 08 '25 11:03 innovara

Actually, there is a module to do this on 16.0 published after I opened this issue: https://github.com/OCA/timesheet/commits/16.0/hr_timesheet_editable_top

I hadn't seen it when I revisited this topic.

innovara avatar Mar 11 '25 21:03 innovara