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][FIX] Fails on hr.employee.public record #3

Open
wants to merge 33 commits into
base: 14.0-backport-project_forecast_line
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ecb88c6
[15.0][ADD] project_forecast_line
yankinmax Jul 18, 2022
fa3d72a
[UPD] Update project_forecast_line.pot
Aug 17, 2022
5a2aacf
[UPD] README.rst
OCA-git-bot Aug 17, 2022
c99df8b
project_forecast_line: improve documentation
gurneyalex Aug 17, 2022
db498da
[UPD] README.rst
OCA-git-bot Aug 31, 2022
39abf09
project_forecast_line 15.0.1.0.1
OCA-git-bot Aug 31, 2022
733013e
[FIX] project_forecast_line consolidated capacity
gurneyalex Aug 31, 2022
5cafbbf
project_forecast_line 15.0.1.0.2
OCA-git-bot Sep 2, 2022
03ebd53
[15.0][FIX] project_forecast_line: take roles into account on calc
yankinmax Aug 30, 2022
8794f99
[15.0][IMP] project_forecast_line: setting to control consumption states
yankinmax Sep 5, 2022
cb60cd8
bump version after clicking on merge by mistake
gurneyalex Sep 5, 2022
f3e3d88
[UPD] Update project_forecast_line.pot
Sep 5, 2022
4ca2225
Update translation files
oca-transbot Sep 5, 2022
fde40b7
[14.0][BACKPORT][WIP]project_forecast_line from 15.0 to 14.0
ntsirintanis Sep 7, 2022
8cafc37
[15.0][FIX] project_forecast_line: add missing access rights
yankinmax Sep 7, 2022
9a8eab7
project_forecast_line: improve documentation
gurneyalex Aug 17, 2022
1926c7b
[14.0][IMP] project_forecast_line: replace project.project.stage with…
ntsirintanis Sep 12, 2022
f30cf98
[FIX] project_forecast_line: error in consolidated capacity
gurneyalex Sep 13, 2022
a9b28d3
[FIX] project_forecast_line: handle lack of project status
gurneyalex Oct 11, 2022
2a45f79
Revert "[15.0][IMP] project_forecast_line: setting to control consump…
yankinmax Sep 15, 2022
736ad37
[FIX] project_forecast_line:
yankinmax Sep 15, 2022
9984b0c
[FIX] project_forecast_line: give sudo rights on hr.leave to create f…
yankinmax Sep 16, 2022
86694a5
fix the computation of the field and the tests
gurneyalex Oct 11, 2022
d696a91
[14.0][IMP][WIP] project_forecast_line: fix backport unit tests
ntsirintanis Nov 9, 2022
8f27174
[FIX] project_forecast_line consolidated capacity
gurneyalex Aug 31, 2022
877e74f
[15.0][FIX] project_forecast_line: take roles into account on calc
yankinmax Aug 30, 2022
f58ceb1
[15.0][IMP] project_forecast_line: setting to control consumption states
yankinmax Sep 5, 2022
a01987b
[FIX] project_forecast_line consolidated capacity
gurneyalex Aug 31, 2022
3c08a46
[15.0][FIX] project_forecast_line: take roles into account on calc
yankinmax Aug 30, 2022
630c358
[15.0][IMP] project_forecast_line: setting to control consumption states
yankinmax Sep 5, 2022
759e42c
[FIX] This fails when the field is being read by a user with readonly…
thomaspaulb Dec 14, 2022
935a0e8
fixup! [FIX] This fails when the field is being read by a user with r…
thomaspaulb Dec 14, 2022
1cfd05e
fixup! fixup! [FIX] This fails when the field is being read by a user…
thomaspaulb Dec 14, 2022
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
148 changes: 148 additions & 0 deletions project_forecast_line/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
======================
Project Forecast Lines
======================

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

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

This module allows to plan your resources using forecast lines.

For each employee of the company, the module will generate forecast line
records with a positive capacity based on their working time schedules. Then,
tasks assigned to employees will generate forecast lines with a negative
capacity which will "consume" the work time capacity of the employees.

The idea is that you can then see the work capacity and scheduled work of
people by summing the "forecasts" per time period. If you have more resources
(positive forecast) than work (negative forecast) you will have a positive net
sum. Otherwise you are in trouble and need to recruit or reschedule your
work. Another way to use the report is checking when the work capacity of a
department becomes positive (or high enough) in order to provide you potential
customers with an estimate of when a project would be able to start.

Forecast lines also come in two states "forecast" or "confirmed", depending on
whether the consumption is confirmed or not. For instance, holidays requests
and sales quotation lines create lines of type "forecast", whereas tasks for
project which are in a running state create lines with type "confirmed".


**Table of contents**

.. contents::
:local:

Usage
=====

Forecast lines have the following data:

* Forecast hours: it is positive for resources (employees) and negative for
things which consume time

* From and To date which are the beginning and ending of the period of the
capacity

* Consolidated forecast: this is a computed field, which is computed as follows:

* for costs (project tasks for instance) we take the absolute value of the
forecast hours (so it is a positive number)

* for resources (employee capacity for a period), we take the capacity and
substract all the costs for that employee on the same period. So it will be
positive if the employee still has some free time, and negative if he is
overloaded with work.


Objects creating forecast lines:

* employees with a forecast role will create forecast line with a positive
capacity and type "confirmed" for each day on which they work. This
information comes from their work calendar, and the different roles that are
linked to the employee.

* draft sale orders (if enabled in the settings) will create forecast lines of
type "forecast" for each sale order line having a product with a forecast
role and start and end dates. The forecast hours are negative

* confirmed sale orders don't create forecast lines. This is handled by the
tasks created at the confirmation of the sale order

* project tasks create forecast lines if they have a linked role and start/end
date. The type of the line will depend on the related project's stage. The
forecast quantity is based on the remaining time of the task, which is spread
on the work days of the planned start and end date of the task. If the
current date is in the middle of the planned duration of the task, it is used
as the start date. If the planned end date is in the past the task does not
generate forecast lines (and you need to fix your planning). In case multiple
employees are assigned to the task the forecast is split equally between
them.

* holiday requests create negative forecast lines with type "forecast" when
they are pending manager validation.

* Validated holiday requests do not generate forecast lines, as they alter the
work calendar of the employee: the employee will not have a positive line
associated to his leave days.



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

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

* Camptocamp SA

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

* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
* Maksym Yankin <maksym.yankin@camptocamp.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/project <https://github.com/OCA/project/tree/15.0/project_forecast_line>`_ 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 project_forecast_line/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
29 changes: 29 additions & 0 deletions project_forecast_line/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Project Forecast Lines",
"summary": "Project Forecast Lines",
"version": "14.0.1.0.3",
"author": "Camptocamp SA, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Project",
"website": "https://github.com/OCA/project",
"depends": ["sale_timesheet", "sale_project", "hr_holidays", "project_status"],
"data": [
"security/forecast_line_security.xml",
"security/ir.model.access.csv",
"views/sale_order_views.xml",
"views/hr_employee_views.xml",
"views/forecast_line_views.xml",
"views/forecast_role_views.xml",
"views/product_views.xml",
"views/project_task_views.xml",
"views/project_status_views.xml",
"views/res_config_settings_views.xml",
"data/ir_cron.xml",
"data/project_status.xml",
],
"installable": True,
"development_status": "Alpha",
"application": True,
}
14 changes: 14 additions & 0 deletions project_forecast_line/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="cron_forecast_lines" model="ir.cron">
<field name="name">Forecast recomputation</field>
<field name="model_id" ref="project_forecast_line.model_forecast_line" />
<field name="user_id" ref="base.user_root" />
<field name="state">code</field>
<field name="code">model._cron_recompute_all()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
</record>
</odoo>
12 changes: 12 additions & 0 deletions project_forecast_line/data/project_status.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Project Status -->
<record id="project_status.project_status_pending" model="project.status">
<field name="forecast_line_type">forecast</field>
</record>

<record id="project_status.project_status_in_progress" model="project.status">
<field name="forecast_line_type">confirmed</field>
</record>

</odoo>
Loading