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

[14.0][ADD] hr_timesheet_activity_begin_end_readonly_duration #13

Merged
merged 2 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions hr_timesheet_activity_begin_end_readonly_duration/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
==========================================================
Timesheet Activities - Begin/End Hours - Readonly Duration
==========================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-solvosci%2Fslv--timesheet-lightgray.png?logo=github
:target: https://github.com/solvosci/slv-timesheet/tree/14.0/hr_timesheet_activity_begin_end_readonly_duration
:alt: solvosci/slv-timesheet

|badge1| |badge2| |badge3|

Change the readonly attribute of field unit_amount to true
to force the Begin Hour and End Hour to be added

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/solvosci/slv-timesheet/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/solvosci/slv-timesheet/issues/new?body=module:%20hr_timesheet_activity_begin_end_readonly_duration%0Aversion:%2014.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.

Credits
=======

Authors
~~~~~~~

* Solvos

Contributors
~~~~~~~~~~~~

* Christian Santamaría <christian.santamaria@solvos.es>

Maintainers
~~~~~~~~~~~

This module is part of the `solvosci/slv-timesheet <https://github.com/solvosci/slv-timesheet/tree/14.0/hr_timesheet_activity_begin_end_readonly_duration>`_ project on GitHub.

You are welcome to contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions hr_timesheet_activity_begin_end_readonly_duration/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# © 2023 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Timesheet Activities - Begin/End Hours - Readonly Duration",
"summary": """
Change the readonly attribute of field unit_amount to true
to force the Begin Hour and End Hour to be added
""",
"author": "Solvos",
"license": "AGPL-3",
"version": "14.0.1.0.0",
"category": "Project",
"website": "https://github.com/solvosci/slv-timesheet",
"depends": ["hr_timesheet_activity_begin_end"],
"data": ["views/hr_timesheet_views.xml"],
'installable': True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import analytic_account
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# © 2023 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import fields, models, api
from datetime import timedelta


class AccountAnalyticLine(models.Model):
_inherit = "account.analytic.line"

unit_amount = fields.Float(readonly=True)

@api.constrains("time_start", "time_stop")
def _check_time_start_stop(self):
for line in self:
line.onchange_hours_start_stop()
super(AccountAnalyticLine, self)._check_time_start_stop()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Christian Santamaría <christian.santamaria@solvos.es>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Change the readonly attribute of field unit_amount to true
to force the Begin Hour and End Hour to be added
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading