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] [mig] sale_timesheet_task_exclude #440

Open
wants to merge 14 commits into
base: 14.0
Choose a base branch
from
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
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 <[email protected]>

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

* Fernando La Chica <[email protected]>

* Dhara Solanki <[email protected]>

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 <[email protected]>\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 <[email protected]>\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 <[email protected]>

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

* Fernando La Chica <[email protected]>

* Dhara Solanki <[email protected]>
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