forked from OCA/project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][BACKPORT] project_forecast_line_bokeh_chart from 15.0 to 14.0
- Loading branch information
1 parent
7721b37
commit 5be7294
Showing
10 changed files
with
122 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,31 +2,39 @@ | |
Project Forecast Lines Bokeh Chart | ||
================================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:c3531fb0c734d3d8fc5b939e61ebcdb3578fb6f36ffa26ee23a2a21c90907610 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
:alt: Alpha | ||
.. |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_bokeh_chart | ||
:target: https://github.com/OCA/project/tree/14.0/project_forecast_line_bokeh_chart | ||
: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_bokeh_chart | ||
:target: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_forecast_line_bokeh_chart | ||
: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 | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module improves the reports of project_forecast_line by using the bokeh widget available in OCA/web. | ||
|
||
.. IMPORTANT:: | ||
This is an alpha version, the data model and design can change at any time without warning. | ||
Only for development or testing purpose, do not use in production. | ||
`More details on development status <https://odoo-community.org/page/development-status>`_ | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
|
@@ -37,8 +45,8 @@ 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_bokeh_chart%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_forecast_line_bokeh_chart%0Aversion:%2014.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. | ||
|
||
|
@@ -54,6 +62,7 @@ Contributors | |
~~~~~~~~~~~~ | ||
|
||
* Alexandre Fayolle <[email protected]> | ||
* Nikos Tsirintanis <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
@@ -68,6 +77,14 @@ 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_bokeh_chart>`_ project on GitHub. | ||
.. |maintainer-ntsirintanis| image:: https://github.com/ntsirintanis.png?size=40px | ||
:target: https://github.com/ntsirintanis | ||
:alt: ntsirintanis | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-ntsirintanis| | ||
|
||
This module is part of the `OCA/project <https://github.com/OCA/project/tree/14.0/project_forecast_line_bokeh_chart>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import forecast_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2022 Therp BV <https://therp.nl>. | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import api, models | ||
|
||
|
||
class ForecastLine(models.Model): | ||
|
||
_inherit = "forecast.line" | ||
|
||
@api.model | ||
def _read_group_raw( | ||
self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True | ||
): | ||
""" | ||
Inherit and add __range key, like in odoo 15 | ||
https://github.com/odoo/odoo/blob/15.0/odoo/models.py#L2431 | ||
""" | ||
result = super()._read_group_raw( | ||
domain, | ||
fields, | ||
groupby, | ||
offset=offset, | ||
limit=limit, | ||
orderby=orderby, | ||
lazy=lazy, | ||
) | ||
dt = [ | ||
f | ||
for f in groupby | ||
if self._fields[f.split(":")[0]].type | ||
in ("date", "datetime") # e.g. 'date:month' | ||
] | ||
for group in result: | ||
if dt: | ||
group["__range"] = {} | ||
for df in dt: | ||
field_name = df.split(":")[0] | ||
if group.get(df): | ||
range_from, range_to = group[df][0].split("/") | ||
group["__range"][field_name] = {"from": range_from, "to": range_to} | ||
# Inject another date key in the result | ||
# for easier retrieval later on | ||
group["forecast_date_start"] = range_from | ||
else: | ||
group["__range"][field_name] = False | ||
group["forecast_date_start"] = False | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* Alexandre Fayolle <[email protected]> | ||
* Nikos Tsirintanis <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> | ||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" /> | ||
<title>Project Forecast Lines Bokeh Chart</title> | ||
<style type="text/css"> | ||
|
||
/* | ||
:Author: David Goodger ([email protected]) | ||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ | ||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ | ||
:Copyright: This stylesheet has been placed in the public domain. | ||
|
||
Default cascading style sheet for the HTML output of Docutils. | ||
|
||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to | ||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to | ||
customize this style sheet. | ||
*/ | ||
|
||
|
@@ -366,51 +366,62 @@ <h1 class="title">Project Forecast Lines Bokeh Chart</h1> | |
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:c3531fb0c734d3d8fc5b939e61ebcdb3578fb6f36ffa26ee23a2a21c90907610 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> | ||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/project/tree/15.0/project_forecast_line_bokeh_chart"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_forecast_line_bokeh_chart"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/140/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> | ||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/project/tree/14.0/project_forecast_line_bokeh_chart"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_forecast_line_bokeh_chart"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> | ||
<p>This module improves the reports of project_forecast_line by using the bokeh widget available in OCA/web.</p> | ||
<div class="admonition important"> | ||
<p class="first admonition-title">Important</p> | ||
<p class="last">This is an alpha version, the data model and design can change at any time without warning. | ||
Only for development or testing purpose, do not use in production. | ||
<a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p> | ||
</div> | ||
<p><strong>Table of contents</strong></p> | ||
<div class="contents local topic" id="contents"> | ||
<ul class="simple"> | ||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li> | ||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul> | ||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li> | ||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li> | ||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li> | ||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li> | ||
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul> | ||
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li> | ||
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li> | ||
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="section" id="bug-tracker"> | ||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1> | ||
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1> | ||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/project/issues">GitHub Issues</a>. | ||
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 | ||
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_forecast_line_bokeh_chart%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_forecast_line_bokeh_chart%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> | ||
<p>Do not contact contributors directly about support or help with technical issues.</p> | ||
</div> | ||
<div class="section" id="credits"> | ||
<h1><a class="toc-backref" href="#id2">Credits</a></h1> | ||
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1> | ||
<div class="section" id="authors"> | ||
<h2><a class="toc-backref" href="#id3">Authors</a></h2> | ||
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2> | ||
<ul class="simple"> | ||
<li>Camptocamp SA</li> | ||
</ul> | ||
</div> | ||
<div class="section" id="contributors"> | ||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2> | ||
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2> | ||
<ul class="simple"> | ||
<li>Alexandre Fayolle <<a class="reference external" href="mailto:alexandre.fayolle@camptocamp.com">alexandre.fayolle@camptocamp.com</a>></li> | ||
<li>Nikos Tsirintanis <<a class="reference external" href="mailto:ntsirintanis@therp.nl">ntsirintanis@therp.nl</a>></li> | ||
</ul> | ||
</div> | ||
<div class="section" id="maintainers"> | ||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2> | ||
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2> | ||
<p>This module is maintained by the OCA.</p> | ||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> | ||
<p>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.</p> | ||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/project/tree/15.0/project_forecast_line_bokeh_chart">OCA/project</a> project on GitHub.</p> | ||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> | ||
<p><a class="reference external image-reference" href="https://github.com/ntsirintanis"><img alt="ntsirintanis" src="https://github.com/ntsirintanis.png?size=40px" /></a></p> | ||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/project/tree/14.0/project_forecast_line_bokeh_chart">OCA/project</a> project on GitHub.</p> | ||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> | ||
</div> | ||
</div> | ||
|
1 change: 1 addition & 0 deletions
1
setup/project_forecast_line_bokeh_chart/odoo/addons/project_forecast_line_bokeh_chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../project_forecast_line_bokeh_chart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |