Skip to content
Open
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
65 changes: 65 additions & 0 deletions hr_timesheet_unpropagate_project/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

================================
HR Timesheet Unpropagate Project
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:02186f3de6b5866cd2b8a9942cbdc85eb64c228ea30ee13170689feadeafec63
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Fqrtl--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/qrtl-custom/tree/19.0/hr_timesheet_unpropagate_project
:alt: qrtl/qrtl-custom

|badge1| |badge2| |badge3|

This module changes the behavior of standard Odoo to ensure that when
you reassign a task to a different project, any timesheets linked to
that task are not automatically updated.

This can be useful in situations where your operation assumes that
timesheets may be linked to different projects than those of their
tasks.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/qrtl-custom/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/qrtl/qrtl-custom/issues/new?body=module:%20hr_timesheet_unpropagate_project%0Aversion:%2019.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
-------

* Quartile

Maintainers
-----------

This module is part of the `qrtl/qrtl-custom <https://github.com/qrtl/qrtl-custom/tree/19.0/hr_timesheet_unpropagate_project>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions hr_timesheet_unpropagate_project/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions hr_timesheet_unpropagate_project/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Quartile (https:/www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "HR Timesheet Unpropagate Project",
"summary": "Keep the project of validated or others' timesheet lines unchanged",
"category": "Timesheet",
"version": "19.0.1.0.0",
"author": "Quartile",
"website": "https://www.quartile.co",
"license": "AGPL-3",
"maintainers": ["AungKoKoLin1997"],
"depends": ["hr_timesheet"],
"installable": True,
}
1 change: 1 addition & 0 deletions hr_timesheet_unpropagate_project/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_timesheet
16 changes: 16 additions & 0 deletions hr_timesheet_unpropagate_project/models/hr_timesheet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


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

def _compute_project_id(self):
# Avoid updating the project of existing timesheet records which are already
# validated or not owned by the current user.
self = self.filtered(
lambda x: not x.validated and x.employee_id.user_id == self.env.user
)
return super()._compute_project_id()
3 changes: 3 additions & 0 deletions hr_timesheet_unpropagate_project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
7 changes: 7 additions & 0 deletions hr_timesheet_unpropagate_project/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module changes the behavior of standard Odoo to ensure that when
you reassign a task to a different project, any timesheets linked to
that task are not automatically updated.

This can be useful in situations where your operation assumes that
timesheets may be linked to different projects than those of their
tasks.
Loading
Loading