Skip to content

Commit

Permalink
Merge branch '14.0-mig-sale_timesheet_task_exclude' of https://github…
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorato committed Aug 29, 2023
2 parents 7da40ae + 12a7389 commit e78ea00
Show file tree
Hide file tree
Showing 19 changed files with 913 additions and 0 deletions.
103 changes: 103 additions & 0 deletions sale_timesheet_task_exclude/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
=============================================
Sales Timesheet: exclude Task from Sale Order
=============================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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-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-OCA%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/13.0/sale_timesheet_task_exclude
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-13-0/timesheet-13-0-sale_timesheet_task_exclude
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/117/13.0
:alt: Try me on Runbot

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

Allows to exclude specific *Task* and all *Timesheets* tracked towards it from
Sale Order.

This feature proves itself useful for *By Employee* billing approach, when
any timesheet entry tracked towards a specific task need to be excluded
from the Sale Order.

This functionality is not available in Odoo, reported in `odoo/odoo#31042 <https://github.com/odoo/odoo/pull/31042>`_.

**Table of contents**

.. contents::
:local:

Usage
=====


# Go to *Project > All Tasks*
# Open specific task for editing
# Check *Exclude From Billing*

Known issues / Roadmap
======================

* **Important**: The use of this module makes that the hours of timesheets in the
tasks excluded, will not appear or taken in consideration as
"Quantity Delivered" in the Sales Order Lines and Sale Order Reports.

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

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

* CorporateHub

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

* `CorporateHub <https://corporatehub.eu/>`__

* Alexey Pelykh <alexey.pelykh@corphub.eu>

* `Guadaltech Soluciones Tecnológicas, S.L. <https://www.guadaltech.es/>`_:

* Fernando La Chica <fernandolachica@gmail.com>

* Dhara Solanki <dhara.solanki@initos.com>

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/timesheet <https://github.com/OCA/timesheet/tree/13.0/sale_timesheet_task_exclude>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sale_timesheet_task_exclude/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
17 changes: 17 additions & 0 deletions sale_timesheet_task_exclude/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2020 CorporateHub (https://corporatehub.eu)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Sales Timesheet: exclude Task from Sale Order",
"version": "14.0.1.0.0",
"category": "Sales",
"website": "https://github.com/OCA/timesheet",
"author": "CorporateHub, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"application": False,
"summary": "Exclude Task and related Timesheets from Sale Order",
"depends": ["sale_timesheet"],
"data": ["views/project_task.xml"],
}
34 changes: 34 additions & 0 deletions sale_timesheet_task_exclude/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_task_exclude
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-07-12 13:43+0000\n"
"Last-Translator: Maria Sparenberg <maria.sparenberg@gmx.net>\n"
"Language-Team: none\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.7.1\n"

#. module: sale_timesheet_task_exclude
#: model:ir.model.fields,help:sale_timesheet_task_exclude.field_project_task__exclude_from_sale_order
msgid "Checking this would exclude any timesheet entries logged towards this task from Sale Order"
msgstr ""
"Wenn der Haken gesetzt ist, werden alle Zeiterfassungen dieser Aufgabe für "
"die Abrechnung über einen Verkaufsauftrag ausgeschlossen."

#. module: sale_timesheet_task_exclude
#: model:ir.model.fields,field_description:sale_timesheet_task_exclude.field_project_task__exclude_from_sale_order
msgid "Exclude from Sale Order"
msgstr "von Abrechnung ausschließen"

#. module: sale_timesheet_task_exclude
#: model:ir.model,name:sale_timesheet_task_exclude.model_project_task
msgid "Task"
msgstr "Aufgabe"
34 changes: 34 additions & 0 deletions sale_timesheet_task_exclude/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_task_exclude
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-05-18 20:19+0000\n"
"Last-Translator: Josep M <jmyepes@mac.com>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.10\n"

#. module: sale_timesheet_task_exclude
#: model:ir.model.fields,help:sale_timesheet_task_exclude.field_project_task__exclude_from_sale_order
msgid "Checking this would exclude any timesheet entries logged towards this task from Sale Order"
msgstr ""
"Marcando esto excluirá cualquier entrada del Parte de horas registrada para "
"esta tarea del pedido de venta"

#. module: sale_timesheet_task_exclude
#: model:ir.model.fields,field_description:sale_timesheet_task_exclude.field_project_task__exclude_from_sale_order
msgid "Exclude from Sale Order"
msgstr "Excluir del pedido de venta"

#. module: sale_timesheet_task_exclude
#: model:ir.model,name:sale_timesheet_task_exclude.model_project_task
msgid "Task"
msgstr "Tarea"
31 changes: 31 additions & 0 deletions sale_timesheet_task_exclude/i18n/sale_timesheet_task_exclude.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_task_exclude
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_timesheet_task_exclude
#: model:ir.model.fields,help:sale_timesheet_task_exclude.field_project_task__exclude_from_sale_order
msgid ""
"Checking this would exclude any timesheet entries logged towards this task "
"from Sale Order"
msgstr ""

#. module: sale_timesheet_task_exclude
#: model:ir.model.fields,field_description:sale_timesheet_task_exclude.field_project_task__exclude_from_sale_order
msgid "Exclude from Sale Order"
msgstr ""

#. module: sale_timesheet_task_exclude
#: model:ir.model,name:sale_timesheet_task_exclude.model_project_task
msgid "Task"
msgstr ""
3 changes: 3 additions & 0 deletions sale_timesheet_task_exclude/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import project_task
40 changes: 40 additions & 0 deletions sale_timesheet_task_exclude/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ProjectTask(models.Model):
_inherit = "project.task"

exclude_from_sale_order = fields.Boolean(
string="Exclude from Sale Order",
help=(
"Checking this would exclude any timesheet entries logged towards"
" this task from Sale Order"
),
)

@api.depends(
"sale_line_id",
"project_id",
"allow_billable",
"non_allow_billable",
"exclude_from_sale_order",
)
def _compute_sale_order_id(self):
super(ProjectTask, self)._compute_sale_order_id()
excluded = self.filtered("exclude_from_sale_order")
for task in excluded:
task.sale_order_id = False

def write(self, vals):
res = super().write(vals)
if "exclude_from_sale_order" in vals:
# If tasks changed their exclude_from_sale_order, update all AALs
# that have not been invoiced yet
for timesheet in self.timesheet_ids.filtered(
lambda line: not line.timesheet_invoice_id
):
timesheet._onchange_task_id_employee_id()
return res
9 changes: 9 additions & 0 deletions sale_timesheet_task_exclude/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* `CorporateHub <https://corporatehub.eu/>`__

* Alexey Pelykh <alexey.pelykh@corphub.eu>

* `Guadaltech Soluciones Tecnológicas, S.L. <https://www.guadaltech.es/>`_:

* Fernando La Chica <fernandolachica@gmail.com>

* Dhara Solanki <dhara.solanki@initos.com>
8 changes: 8 additions & 0 deletions sale_timesheet_task_exclude/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Allows to exclude specific *Task* and all *Timesheets* tracked towards it from
Sale Order.

This feature proves itself useful for *By Employee* billing approach, when
any timesheet entry tracked towards a specific task need to be excluded
from the Sale Order.

This functionality is not available in Odoo, reported in `odoo/odoo#31042 <https://github.com/odoo/odoo/pull/31042>`_.
3 changes: 3 additions & 0 deletions sale_timesheet_task_exclude/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* **Important**: The use of this module makes that the hours of timesheets in the
tasks excluded, will not appear or taken in consideration as
"Quantity Delivered" in the Sales Order Lines and Sale Order Reports.
4 changes: 4 additions & 0 deletions sale_timesheet_task_exclude/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Go to *Project > Tasks*
# Open specific task for editing
# Check *Exclude From Billing*
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e78ea00

Please sign in to comment.