Skip to content

Commit

Permalink
[MIG] maintenance_timesheet: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-RB committed Jul 20, 2023
1 parent 6418ea1 commit c46097d
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 35 deletions.
24 changes: 14 additions & 10 deletions maintenance_timesheet/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
Maintenance Timesheets
======================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a3af16571faa620b072191148b6b2117b43fcbef94109d9af481ffedd60afdfe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
Expand All @@ -14,16 +17,16 @@ Maintenance Timesheets
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github
:target: https://github.com/OCA/maintenance/tree/15.0/maintenance_timesheet
:target: https://github.com/OCA/maintenance/tree/16.0/maintenance_timesheet
:alt: OCA/maintenance
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/maintenance-15-0/maintenance-15-0-maintenance_timesheet
:target: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_timesheet
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/240/15.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds timesheets to a request.

Expand All @@ -37,8 +40,8 @@ Bug Tracker

Bugs are tracked on `GitHub Issues <https://github.com/OCA/maintenance/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_timesheet%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_timesheet%0Aversion:%2016.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 @@ -55,6 +58,7 @@ Contributors

* David Alonso <david.alonso@solvos.es>
* Luisa Miguéns <luisa.miguens@solvos.es>
* Christian Ramos <c.ramos@binhex.es>

Maintainers
~~~~~~~~~~~
Expand All @@ -69,6 +73,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/15.0/maintenance_timesheet>`_ project on GitHub.
This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/16.0/maintenance_timesheet>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions maintenance_timesheet/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ msgstr ""

#. module: maintenance_timesheet
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet.hr_equipment_request_view_form
msgid "<span class=\"o_label\" style=\"padding-left: 5px;\">Hours</span>"
msgstr "<span class=\"o_label\" style=\"padding-left: 5px;\">horas</span>"
msgid "<span class=\"o_label\" >Hours</span>"
msgstr "<span class=\"o_label\" >horas</span>"

#. module: maintenance_timesheet
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet.hr_equipment_request_view_kanban
Expand Down
2 changes: 1 addition & 1 deletion maintenance_timesheet/i18n/maintenance_timesheet.pot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ msgstr ""

#. module: maintenance_timesheet
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet.hr_equipment_request_view_form
msgid "<span class=\"o_label\" style=\"padding-left: 5px;\">Hours</span>"
msgid "<span class=\"o_label\" >Hours</span>"
msgstr ""

#. module: maintenance_timesheet
Expand Down
1 change: 1 addition & 0 deletions maintenance_timesheet/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* David Alonso <david.alonso@solvos.es>
* Luisa Miguéns <luisa.miguens@solvos.es>
* Christian Ramos <c.ramos@binhex.es>
13 changes: 8 additions & 5 deletions maintenance_timesheet/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Maintenance Timesheets</title>
<style type="text/css">

Expand Down Expand Up @@ -366,8 +366,10 @@ <h1 class="title">Maintenance Timesheets</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a3af16571faa620b072191148b6b2117b43fcbef94109d9af481ffedd60afdfe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/OCA/maintenance/tree/15.0/maintenance_timesheet"><img alt="OCA/maintenance" src="https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/maintenance-15-0/maintenance-15-0-maintenance_timesheet"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/240/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" 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" href="https://github.com/OCA/maintenance/tree/16.0/maintenance_timesheet"><img alt="OCA/maintenance" src="https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_timesheet"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/builds?repo=OCA/maintenance&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds timesheets to a request.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -385,8 +387,8 @@ <h1 class="title">Maintenance Timesheets</h1>
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/maintenance/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_timesheet%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
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/maintenance/issues/new?body=module:%20maintenance_timesheet%0Aversion:%2016.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 All @@ -402,6 +404,7 @@ <h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<ul class="simple">
<li>David Alonso &lt;<a class="reference external" href="mailto:david.alonso&#64;solvos.es">david.alonso&#64;solvos.es</a>&gt;</li>
<li>Luisa Miguéns &lt;<a class="reference external" href="mailto:luisa.miguens&#64;solvos.es">luisa.miguens&#64;solvos.es</a>&gt;</li>
<li>Christian Ramos &lt;<a class="reference external" href="mailto:c.ramos&#64;binhex.es">c.ramos&#64;binhex.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -411,7 +414,7 @@ <h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/maintenance/tree/15.0/maintenance_timesheet">OCA/maintenance</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/maintenance/tree/16.0/maintenance_timesheet">OCA/maintenance</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
31 changes: 16 additions & 15 deletions maintenance_timesheet/tests/test_maintenance_timesheet.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# Copyright 2019 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

import odoo.tests.common as test_common
from odoo import fields
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase


class TestMaintenanceTimesheet(test_common.TransactionCase):
def setUp(self):
super().setUp()
class TestMaintenanceTimesheet(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()

self.stage_undone = self.env.ref("maintenance.stage_0")
self.stage_done = self.env.ref("maintenance.stage_4")
cls.stage_undone = cls.env.ref("maintenance.stage_0")
cls.stage_done = cls.env.ref("maintenance.stage_4")

self.request_demo1 = self.env.ref("maintenance_timesheet.request_1")
self.request2 = self.env["maintenance.request"].create(
cls.request_demo1 = cls.env.ref("maintenance_timesheet.request_1")
cls.request2 = cls.env["maintenance.request"].create(
{
"name": "Corrective #2 for Generic Monitor",
"equipment_id": self.env.ref("maintenance_project.equipment_1").id,
"user_id": self.env.ref("base.user_admin").id,
"equipment_id": cls.env.ref("maintenance_project.equipment_1").id,
"user_id": cls.env.ref("base.user_admin").id,
"schedule_date": fields.Date.today(),
"stage_id": self.stage_undone.id,
"stage_id": cls.stage_undone.id,
"maintenance_type": "corrective",
}
)
self.timesheet21_data = {
cls.timesheet21_data = {
"name": "Some tasks done",
"project_id": self.request2.project_id.id,
"user_id": self.env.ref("base.user_admin").id,
"project_id": cls.request2.project_id.id,
"user_id": cls.env.ref("base.user_admin").id,
"date": fields.Date.today(),
"unit_amount": 1.5,
}
self.request2.timesheet_ids = [(0, 0, self.timesheet21_data)]
cls.request2.timesheet_ids = [(0, 0, cls.timesheet21_data)]

def test_request_timesheets(self):
self.assertEqual(self.request_demo1.timesheet_total_hours, 2)
Expand Down
13 changes: 11 additions & 2 deletions maintenance_timesheet/views/maintenance_request_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,17 @@
icon="fa-calendar"
groups="hr_timesheet.group_hr_timesheet_user"
>
<field name="timesheet_total_hours" widget="timesheet_uom" />
<span class="o_label" style="padding-left: 5px;">Hours</span>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field
name="timesheet_total_hours"
widget="timesheet_uom"
/>
</span>
<span class="o_stat_text">
Hours
</span>
</div>
</button>
</xpath>
</field>
Expand Down

0 comments on commit c46097d

Please sign in to comment.