Skip to content

Commit

Permalink
[MIG] project_timesheet_time_control: Migration to 18.0
Browse files Browse the repository at this point in the history
[IMP] project_timesheet_time_control: pre-commit execution

[MIG] project_timesheet_time_control: Migration to 18.0

[MIG] project_timesheet_time_control: Migration to 18.0
  • Loading branch information
jdebetaz committed Jan 15, 2025
1 parent 4bd0a63 commit 91a0530
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 47 deletions.
42 changes: 21 additions & 21 deletions project_timesheet_time_control/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Project timesheet time control
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github
:target: https://github.com/OCA/project/tree/17.0/project_timesheet_time_control
:target: https://github.com/OCA/project/tree/18.0/project_timesheet_time_control
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-17-0/project-17-0-project_timesheet_time_control
:target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_timesheet_time_control
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -42,8 +42,8 @@ Installation

This module depends on modules found in these repositories:

- `OCA/timesheet <https://github.com/OCA/timesheet>`__
- `OCA/web <https://github.com/OCA/web>`__
- `OCA/timesheet <https://github.com/OCA/timesheet>`__
- `OCA/web <https://github.com/OCA/web>`__

Usage
=====
Expand Down Expand Up @@ -112,16 +112,16 @@ that belongs to another user.
Known issues / Roadmap
======================

- Rename to ``hr_timesheet_time_control``.
- Move to `OCA/timesheet <https://github.com/OCA/timesheet>`__.
- Rename to ``hr_timesheet_time_control``.
- Move to `OCA/timesheet <https://github.com/OCA/timesheet>`__.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_timesheet_time_control%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_timesheet_time_control%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -136,21 +136,21 @@ Authors
Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:
- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Antonio Espinosa
- Carlos Dauden
- Sergio Teruel
- Luis M. ontalba
- Ernesto Tejeda
- Jairo Llopis
- Carlos Roca
- Pedro M. Baeza
- Antonio Espinosa
- Carlos Dauden
- Sergio Teruel
- Luis M. ontalba
- Ernesto Tejeda
- Jairo Llopis
- Carlos Roca

- `Sygel <https://www.sygel.es>`__:
- `Sygel <https://www.sygel.es>`__:

- Valentín Vinagre
- Roger Sans
- Valentín Vinagre
- Roger Sans

Maintainers
-----------
Expand All @@ -173,6 +173,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ernestotejeda|

This module is part of the `OCA/project <https://github.com/OCA/project/tree/17.0/project_timesheet_time_control>`_ project on GitHub.
This module is part of the `OCA/project <https://github.com/OCA/project/tree/18.0/project_timesheet_time_control>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion project_timesheet_time_control/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
"name": "Project timesheet time control",
"version": "17.0.1.0.1",
"version": "18.0.1.0.0",
"category": "Project",
"author": "Tecnativa," "Odoo Community Association (OCA)",
"maintainers": ["ernestotejeda"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _compute_show_time_control(self):
groupby=[related_field],
)
lines_per_record = {
group[related_field][0]: group["%s_count" % related_field]
group[related_field][0]: group[f"{related_field}_count"]
for group in grouped
}
button_per_lines = {0: "start", 1: "stop"}
Expand All @@ -50,7 +50,7 @@ def button_start_work(self):
"""Create a new record starting now, with a running timer."""
related_field = self._relation_with_timesheet_line()
return {
"context": {"default_%s" % related_field: self.id},
"context": {f"default_{related_field}": self.id},
"name": _("Start work"),
"res_model": "hr.timesheet.switch",
"target": "new",
Expand Down
6 changes: 3 additions & 3 deletions project_timesheet_time_control/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Project timesheet time control</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:79fd416fe32b5f66051581268833fd8479c5dd9a8904a4e5a7f563f9862deb07
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/project/tree/17.0/project_timesheet_time_control"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/project-17-0/project-17-0-project_timesheet_time_control"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/project&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/project/tree/18.0/project_timesheet_time_control"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_timesheet_time_control"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/project&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Allow to track the exact moment when a timesheet line is started (not
only the day, but also the minute and second) and let users start and
stop timers easily.</p>
Expand Down Expand Up @@ -471,7 +471,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/project/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_timesheet_time_control%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_timesheet_time_control%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -520,7 +520,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/ernestotejeda"><img alt="ernestotejeda" src="https://github.com/ernestotejeda.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/project/tree/17.0/project_timesheet_time_control">OCA/project</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/project/tree/18.0/project_timesheet_time_control">OCA/project</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,15 @@
<field name="date_time" />
<field name="date_time_end" />
</field>
<xpath
expr="//templates//t[@t-esc='record.date.value']"
position="attributes"
>
<xpath expr="//templates//field[@name='date']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//templates//t[@t-esc='record.date.value']" position="after">
<t t-esc="record.date_time.value" />
<t t-if="record.date_time_end.value">
<xpath expr="//templates//field[@name='date']" position="after">
<field name="date_time" />
<t t-if="date_time_end">
<br />
<span>to</span>
<t t-esc="record.date_time_end.value" />
<field name="date_time_end" />
</t>
</xpath>
</field>
Expand Down
4 changes: 2 additions & 2 deletions project_timesheet_time_control/views/project_project_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project" />
<field name="arch" type="xml">
<tree position="inside">
<list position="inside">
<field
name="show_time_control"
invisible="1"
Expand Down Expand Up @@ -111,7 +111,7 @@
title="End work"
groups="hr_timesheet.group_hr_timesheet_user"
/>
</tree>
</list>
</field>
</record>
</odoo>
18 changes: 9 additions & 9 deletions project_timesheet_time_control/views/project_task_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
</div>
<!-- Sub-tree view for timesheet_ids -->
<xpath
expr="//field[@name='timesheet_ids']/tree//field[@name='date']"
expr="//field[@name='timesheet_ids']/list//field[@name='date']"
position="attributes"
>
<attribute name="invisible">1</attribute>
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/tree//field[@name='date']"
expr="//field[@name='timesheet_ids']/list//field[@name='date']"
position="after"
>
<field name="date_time" string="Date" required="1" />
</xpath>
<xpath expr="//field[@name='timesheet_ids']/tree" position="inside">
<xpath expr="//field[@name='timesheet_ids']/list" position="inside">
<field name="show_time_control" invisible="1" />
<button
name="button_resume_work"
Expand All @@ -69,18 +69,18 @@
groups="hr_timesheet.group_hr_timesheet_user"
/>
</xpath>
<xpath expr="//field[@name='timesheet_ids']/tree" position="attributes">
<xpath expr="//field[@name='timesheet_ids']/list" position="attributes">
<attribute name="default_order">date_time</attribute>
</xpath>
<!-- Sub-kanban view for timesheet_ids -->
<xpath
expr="//field[@name='timesheet_ids']/kanban//*[@t-esc='record.date.value']"
expr="//field[@name='timesheet_ids']/kanban//*[@name='date']"
position="attributes"
>
<attribute name="invisible">1</attribute>
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/kanban//*[@t-esc='record.date.value']"
expr="//field[@name='timesheet_ids']/kanban//*[@name='date']"
position="after"
>
<field name="date_time" required="1" />
Expand Down Expand Up @@ -165,7 +165,7 @@
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_kanban" />
<field name="arch" type="xml">
<xpath expr="//*[hasclass('oe_kanban_bottom_left')]" position="inside">
<xpath expr="//footer" position="inside">
<field
name="show_time_control"
invisible="1"
Expand Down Expand Up @@ -197,7 +197,7 @@
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_tree2_inherited" />
<field name="arch" type="xml">
<tree position="inside">
<list position="inside">
<field
name="show_time_control"
invisible="1"
Expand Down Expand Up @@ -225,7 +225,7 @@
title="End work"
groups="hr_timesheet.group_hr_timesheet_user"
/>
</tree>
</list>
</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class HrTimesheetSwitch(models.TransientModel):

def _domain_project_id(self):
domain = [("allow_timesheets", "=", True)]
if not self.user_has_groups("hr_timesheet.group_timesheet_manager"):
if not self.env.user.has_group("hr_timesheet.group_timesheet_manager"):
return expression.AND(
[
domain,
Expand Down

0 comments on commit 91a0530

Please sign in to comment.