Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][MIG] project_timesheet_time_control: Migration to 15.0 #989

Merged

Conversation

CarlosRoca13
Copy link
Contributor

cc @Tecnativa TT37806

This PR superseds: #939

please @pedrobaeza @sergio-teruel review this

@CarlosRoca13 CarlosRoca13 force-pushed the 15.0-MIG-project_timesheet_time_control branch from 4128756 to a865ca5 Compare October 5, 2022 14:52
@CarlosRoca13 CarlosRoca13 changed the title 15.0 mig project timesheet time control [15.0][MIG] project_timesheet_time_control: Migration to 15.0 Oct 5, 2022
@pedrobaeza
Copy link
Member

@CarlosRoca13 please check if all the changes from #1003 are here

@CarlosRoca13 CarlosRoca13 force-pushed the 15.0-MIG-project_timesheet_time_control branch from a865ca5 to f1d6bdc Compare November 3, 2022 12:20
@CarlosRoca13
Copy link
Contributor Author

Now all changes from #1003 were added.

@sergio-teruel
Copy link
Contributor

Check pre-commit
Tests are failing due to project_task_personal_stage_auto_fold module

@wildi1
Copy link

wildi1 commented Nov 4, 2022

There is also one bug in my scenario. Starting a timer in task's kanban view, will cause, that all tasks are folded after the wizard get's confirmed. See this video:
@CarlosRoca13 Can you reproduce that ?

odoo-2022-11-04_23.21.18.mp4

@pedrobaeza
Copy link
Member

That's not something of this module, but ir_act_window_reload

@wildi1
Copy link

wildi1 commented Nov 4, 2022

Are you sure to "web_ir_actions_act_view_reload", or could it also be "web_ir_actions_act_multi".
I found, that there are some cases where the tasks don't get folded. I could also capture it. But it is not constantly reproduceable.

odoo-2022-11-05_00.40.59.mp4

@pedrobaeza
Copy link
Member

Well, I can't say for sure, but it's related to that ones, not this module itself.

sergio-teruel and others added 19 commits November 7, 2022 08:13
* Decorate methods correctly + README imp
* Add tests
* Add button on tasks
* Better README
* open/close behaviour
Update README
Adapt tests
Redefine the new kanban and form view of account.analytic.line
to add 'Close/Open task' button and 'Stop' button
We need to override standard onchange, as it resets the previously
introduced task.
Currently translated at 100.0% (8 of 8 strings)

Translation: project-12.0/project-12.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_timesheet_time_control/pt_BR/
This is a huge improvement in this module's usability, although basic functionality stays the same. Let me summmarize:

- In `account.analytic.line` views, the *Stop* button is replaced by colorful *Resume/Stop* buttons.
- The new *Resume* button will display a wizard that will duplicate all meaningful fields from the previous `account.analytic.line` record and auto-stop the previous running timer, if any.
- If the previous running timer is very old, some warnings will be displayed.
- In `project.project` and `project.task` views, I added the same buttons (well... it's *Start* instead of *Resume*, because you could not have worked before in that project or task, but it behaves the same).
- If using it from a `project.task`, *Start* will duplicate meaningful fields from your latest line in that task.
- If using it from a `project.project`, *Start* will duplicate meaningful fields your latest line in that project that had no task associated.
- All kanban, kanban mobile, list and form views are covered.
- Access the new wizard directly from a menu item if you prefer.
- I removed, BTW, some Bootstrap 3 and bad replacements in some views.
…as found

Imagine this scenario:

1. In tab 1 of the browser, you have opened task 1.
2. In tab 2 of the browser, you have opened task 2.
3. You go to tab 1 and start a timer.
4. Work, work, work...
5. You go to tab 2 and start a timer, stopping that of task 1.
6. Work, work, work...
7. You go to tab 1 and see that timer as running (it is not, but you didn't refresh). You hit stop.

Before this commit, it just seemed like the timer was actually stopped. What did happen behind the scenes is that your view was refreshed, but no timer was touched fortunately.

After this commit, you get a message telling you that there's no timer to stop and that your browser is most likely out of sync. This mimics the behavior previously found when doing the same, but directly in the AAL. Now it's present in projects and tasks too.
Models related to timesheet time controls now inherit from a mixin that adds most needed logic automatically.
Currently translated at 32.3% (20 of 62 strings)

Translation: project-12.0/project-12.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_timesheet_time_control/sl/
Currently translated at 7.9% (5 of 63 strings)

Translation: project-12.0/project-12.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_timesheet_time_control/de/
- Standard procedure
- README regeneration
- Start new timer little adjustment
- Avoid new check for shared m2m tables
…ctivity_begin_end module

Prior to this commit, trying to resume an activity which had a start time or end time set would cause the newly created timesheet to throw a validation error because time_stop - time_start must equal duration. This commit fixes that issues by adding those fields to the ignore list
@CarlosRoca13 CarlosRoca13 force-pushed the 15.0-MIG-project_timesheet_time_control branch from f1d6bdc to a272316 Compare November 7, 2022 07:14
@wildi1
Copy link

wildi1 commented Nov 7, 2022

@pedrobaeza How to continue with that? Opening an issue in the OCA/web repository with the description from obove?

@pedrobaeza
Copy link
Member

Yes, that can be the option.

@pedrobaeza
Copy link
Member

pedrobaeza commented Nov 8, 2022

@CarlosRoca13 there's a mix of the diffs in the last 2 commits, and no cherry-picking of latest PRs of older versions, but they are introduced in the last commit.

CarlosRoca13 and others added 2 commits November 15, 2022 12:21
Some modules that add new fields dynamically, as analytic_tag_dimension, will cause an error when trying to read the fields to get them from cache. With this change we avoid that read and we make a copy of the analytic line if the wizard is opened from its and we create a new analytic line if don't.
Since v14, `string` attribute of <button> elements are directly shown in
the views as text instead of being a tooltip, and thus, it takes a lot
of space in screen.

And it was not the intended visualization when the modules was
conceived, just a side effect.

Thus, we restore what we expect, moving `string` to `title` for having
the tooltips again.

TT40169
@CarlosRoca13 CarlosRoca13 force-pushed the 15.0-MIG-project_timesheet_time_control branch from a272316 to cdcf601 Compare November 15, 2022 11:25
@CarlosRoca13
Copy link
Contributor Author

Changed @pedrobaeza

@pedrobaeza
Copy link
Member

/ocabot migration project_timesheet_time_control

@OCA-git-bot OCA-git-bot added this to the 15.0 milestone Nov 16, 2022
@OCA-git-bot OCA-git-bot mentioned this pull request Nov 16, 2022
32 tasks
@OCA-git-bot
Copy link
Contributor

The migration issue (#859) has been updated to reference the current pull request.
however, a previous pull request was referenced : #939.
Perhaps you should check that there is no duplicate work.
CC : @manuelcalerosolis

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 15.0-ocabot-merge-pr-989-by-pedrobaeza-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 16, 2022
Signed-off-by pedrobaeza
@OCA-git-bot
Copy link
Contributor

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 15.0-ocabot-merge-pr-989-by-pedrobaeza-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 15.0-ocabot-merge-pr-989-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 34d0e71 into OCA:15.0 Nov 16, 2022
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at eccfacf. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.