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

[16.0][mig] project_timesheet_time_control #1133

Conversation

aktiv-heli-kantawala
Copy link
Contributor

No description provided.

sergio-teruel and others added 30 commits June 6, 2023 18:15
* 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
…esheet

This commit adds a field to the timesheet to store the end time. It is not required to enter the end time, if it is not entered it is calculated automatically by comparing the start time and the duration, if only a start time and end time are entered, then the duration is calculated accordingly. The end time field is set to optional in the tree view.
Currently translated at 100.0% (67 of 67 strings)

Translation: project-13.0/project-13.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_timesheet_time_control/he_IL/
Currently translated at 16.4% (11 of 67 strings)

Translation: project-13.0/project-13.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_timesheet_time_control/de/
Currently translated at 67.1% (45 of 67 strings)

Translation: project-13.0/project-13.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_timesheet_time_control/nl/
Currently translated at 86.5% (58 of 67 strings)

Translation: project-13.0/project-13.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_timesheet_time_control/nl/
Currently translated at 88.0% (59 of 67 strings)

Translation: project-13.0/project-13.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_timesheet_time_control/nl/
Currently translated at 100.0% (67 of 67 strings)

Translation: project-14.0/project-14.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_timesheet_time_control/es_AR/
oca-ci and others added 20 commits June 6, 2023 18:15
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/
Currently translated at 100.0% (48 of 48 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/es_AR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/
Currently translated at 100.0% (49 of 49 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/es_AR/
Currently translated at 100.0% (49 of 49 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/es/
Error: AttributeError: type object 'expression' has no attribute AND
That way, we don't have an error coming from the previous version
Currently translated at 100.0% (49 of 49 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/it/
Currently translated at 100.0% (49 of 49 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/it/
Currently translated at 100.0% (49 of 49 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/it/
Currently translated at 100.0% (49 of 49 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/it/
Currently translated at 100.0% (49 of 49 strings)

Translation: project-15.0/project-15.0-project_timesheet_time_control
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_timesheet_time_control/it/
@DorianMAG
Copy link

DorianMAG commented Jun 20, 2023

Hi @heliaktiv,
What branch have you use to resolv dependencies "web".
I find this for web_ir_actions_act_multi 2328
I cant find for web_ir_actions_act_view_reload
Regards

@@ -145,8 +144,6 @@ def test_aal_without_start_resume_button(self):
"""If a line has no start date, can only resume it."""
self.assertEqual(self.line.show_time_control, "stop")
self.line.date_time = False
self.line.invalidate_cache()
self.assertEqual(self.line.show_time_control, "resume")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing this checks?

@stefan-tecnativa
Copy link
Contributor

You can remove the dependencies of web_ir_actions_act_multi and web_ir_actions_act_view_reload. I've tested with @CarlosRoca13 that the module maintains it's functionallity without this dependencies.
ping @DorianMAG

@DorianMAG
Copy link

Hi @stefan-tecnativa .
Thx for this information.
I will test that
Regards

@DorianMAG
Copy link

Hi.
Some dependencies are almost merged.
OCA/timesheet#586
OCA/timesheet#592
i will try after this merges

@AntoniRomera
Copy link

@heliaktiv Dependencies have already been merged

@pedrobaeza
Copy link
Member

Superseded by #1148

@pedrobaeza pedrobaeza closed this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.