Skip to content

[16.0] [MIG] sale_timesheet_project_manual #2555

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

Open
wants to merge 6 commits into
base: 16.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
85 changes: 85 additions & 0 deletions sale_timesheet_project_manual/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
=============================
Sale Timesheet Project Manual
=============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/16.0/sale_timesheet_project_manual
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_timesheet_project_manual
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/sale-workflow&target_branch=16.0
:alt: Try me on Runboat

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

Allows to create the project/tasks before the sale confirmation.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

#. Create a service product and set its service tracking to *Create a task* or *Create a project*
#. Create a SO and select the previous product
#. When the SO is in draft, a button *Generate Project/Task* is available and it will create the project and tasks based on the order lines

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_timesheet_project_manual%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.

Credits
=======

Authors
~~~~~~~

* ACSONE SA/NV

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

* `Acsone <https://www.acsone.eu/>`__

* Benjamin Willig <[email protected]>
* Maxime Franco <[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/sale-workflow <https://github.com/OCA/sale-workflow/tree/16.0/sale_timesheet_project_manual>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions sale_timesheet_project_manual/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions sale_timesheet_project_manual/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sale Timesheet Project Manual",
"summary": """
Allows to create the project/tasks before the sale confirmation""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"depends": [
"sale_timesheet",
],
"data": [
"views/sale_order.xml",
],
"demo": [],
}
43 changes: 43 additions & 0 deletions sale_timesheet_project_manual/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_project_manual
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-16 07:18+0000\n"
"PO-Revision-Date: 2023-06-16 07:18+0000\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_project_manual
#: model:ir.model.fields,field_description:sale_timesheet_project_manual.field_sale_order__action_project_manual_allowed
msgid "Action Project Manual Allowed"
msgstr "Action Project Manual Allowed"

#. module: sale_timesheet_project_manual
#: model_terms:ir.ui.view,arch_db:sale_timesheet_project_manual.sale_order_form_view
msgid "Generate Project/Task"
msgstr "Générer Projet/Tâche"

#. module: sale_timesheet_project_manual
#: model:ir.model,name:sale_timesheet_project_manual.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_timesheet_project_manual
#. odoo-python
#: code:addons/sale_timesheet_project_manual/models/sale_order.py:0
#, python-format
msgid ""
"You can anticipate the project creation only for draft quotations which "
"contain service with timesheet generation. (SO: %s)"
msgstr ""
"Vous pouvez anticiper la création d'un projet seulement pour les devis "
"brouillons qui contiennent un service générant des feuilles de temps. (SO: "
"%s)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_project_manual
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-16 07:18+0000\n"
"PO-Revision-Date: 2023-06-16 07:18+0000\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_project_manual
#: model:ir.model.fields,field_description:sale_timesheet_project_manual.field_sale_order__action_project_manual_allowed
msgid "Action Project Manual Allowed"
msgstr ""

#. module: sale_timesheet_project_manual
#: model_terms:ir.ui.view,arch_db:sale_timesheet_project_manual.sale_order_form_view
msgid "Generate Project/Task"
msgstr ""

#. module: sale_timesheet_project_manual
#: model:ir.model,name:sale_timesheet_project_manual.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_timesheet_project_manual
#. odoo-python
#: code:addons/sale_timesheet_project_manual/models/sale_order.py:0
#, python-format
msgid ""
"You can anticipate the project creation only for draft quotations which "
"contain service with timesheet generation. (SO: %s)"
msgstr ""
1 change: 1 addition & 0 deletions sale_timesheet_project_manual/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
46 changes: 46 additions & 0 deletions sale_timesheet_project_manual/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo.exceptions import ValidationError


class SaleOrder(models.Model):

_inherit = "sale.order"

action_project_manual_allowed = fields.Boolean(
compute="_compute_action_project_manual_allowed"
)

@api.depends(
"state",
"order_line.is_service",
"order_line.product_id.service_tracking",
)
def _compute_action_project_manual_allowed(self):
for rec in self:
rec.action_project_manual_allowed = rec.state in ("draft", "sent") and any(
[
line.is_service
and line.product_id.service_tracking
in ("task_global_project", "project_only", "task_in_project")
for line in rec.order_line
]
)

def action_project_manual(self):
self.action_project_manual_allowed_check()
self.order_line._timesheet_service_generation()

def action_project_manual_allowed_check(self):
for rec in self:
if not rec.action_project_manual_allowed:
raise ValidationError(
_(
"You can anticipate the project creation only for "
"draft quotations which contain service with timesheet "
"generation. (SO: %s)"
)
% rec.display_name
)
4 changes: 4 additions & 0 deletions sale_timesheet_project_manual/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Acsone <https://www.acsone.eu/>`__

* Benjamin Willig <[email protected]>
* Maxime Franco <[email protected]>
1 change: 1 addition & 0 deletions sale_timesheet_project_manual/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allows to create the project/tasks before the sale confirmation.
5 changes: 5 additions & 0 deletions sale_timesheet_project_manual/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to:

#. Create a service product and set its service tracking to *Create a task* or *Create a project*
#. Create a SO and select the previous product
#. When the SO is in draft, a button *Generate Project/Task* is available and it will create the project and tasks based on the order lines
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading