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

project_forecast_line_bokeh_chart: add tree view and cron #17

Draft
wants to merge 1 commit into
base: 14.0-backport-project_forecast_line_bokeh_chart
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion project_forecast_line_bokeh_chart/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project Forecast Lines Bokeh Chart
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c3531fb0c734d3d8fc5b939e61ebcdb3578fb6f36ffa26ee23a2a21c90907610
!! source digest: sha256:a7327f21c129e75331cfde1eca3cd0fbbf712c6360a449038e6d09bd8cfe2718
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
Expand Down
1 change: 1 addition & 0 deletions project_forecast_line_bokeh_chart/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"data": [
"security/ir.model.access.csv",
"report/forecast_line_reporting_views.xml",
"data/ir_cron.xml",
],
"development_status": "Alpha",
"installable": True,
Expand Down
21 changes: 21 additions & 0 deletions project_forecast_line_bokeh_chart/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="cron_forecast_lines" model="ir.cron">
<field name="name">Update Forecast reports date to the current date</field>
<field
name="model_id"
ref="project_forecast_line_bokeh_chart.model_forecast_line_reporting"
/>
<field name="user_id" ref="base.user_root" />
<field name="state">code</field>
<field name="code">model._cron_update_date_from()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field
name="nextcall"
eval="(DateTime.now().replace(hour=1, minute=0) + timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S')"
/>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
</record>
</odoo>
142 changes: 142 additions & 0 deletions project_forecast_line_bokeh_chart/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_forecast_line_bokeh_chart
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-10-09 07:43+0000\n"
"Last-Translator: Ivorra78 <[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 4.17\n"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Available"
msgstr "Disponible"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__bokeh_chart
msgid "Bokeh Chart"
msgstr "Gráfico Bokeh"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__create_uid
msgid "Created by"
msgstr "Creado por"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__create_date
msgid "Created on"
msgstr "Creado el"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__date_from
msgid "Date From"
msgstr "Fecha desde"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields.selection,name:project_forecast_line_bokeh_chart.selection__forecast_line_reporting__granularity__day
msgid "Day"
msgstr "Día"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__employee_ids
msgid "Employee"
msgstr "Empleado/a"

#. module: project_forecast_line_bokeh_chart
#: model:ir.actions.act_window,name:project_forecast_line_bokeh_chart.action_forecast_lines_reporting
#: model:ir.ui.menu,name:project_forecast_line_bokeh_chart.menu_forecast_line_reporting
#: model_terms:ir.ui.view,arch_db:project_forecast_line_bokeh_chart.forecast_line_reporting_form
msgid "Forecast Reporting"
msgstr "Informes de previsión"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model,name:project_forecast_line_bokeh_chart.model_forecast_line_reporting
msgid "Forecast reporting wizard"
msgstr "Asistente de informes de previsiones"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__granularity
msgid "Granularity"
msgstr "Granularidad"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__id
msgid "ID"
msgstr "ID (identificación)"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__write_uid
msgid "Last Updated by"
msgstr "Actualizado por Última vez por"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__write_date
msgid "Last Updated on"
msgstr "Última Actualización el"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields.selection,name:project_forecast_line_bokeh_chart.selection__forecast_line_reporting__granularity__month
msgid "Month"
msgstr "Mes"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__nb_months
msgid "Nb Months"
msgstr "Meses Nb"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Not assigned to an employee"
msgstr "No asignado a un empleado"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Nothing to plot. Select some employees"
msgstr "Nada que trazar. Seleccione algunos empleados"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Overload"
msgstr "Sobrecarga"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__project_ids
msgid "Project"
msgstr "Proyecto"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,help:project_forecast_line_bokeh_chart.field_forecast_line_reporting__project_ids
msgid ""
"Setting this will automatically add all employees assigned to tasks on the "
"project"
msgstr ""
"Al establecer esta opción, se añadirán automáticamente todos los empleados "
"asignados a las tareas del proyecto"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields.selection,name:project_forecast_line_bokeh_chart.selection__forecast_line_reporting__granularity__week
msgid "Week"
msgstr "Semana"
2 changes: 1 addition & 1 deletion project_forecast_line_bokeh_chart/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ msgstr ""
#. module: project_forecast_line_bokeh_chart
#: model:ir.actions.act_window,name:project_forecast_line_bokeh_chart.action_forecast_lines_reporting
#: model:ir.ui.menu,name:project_forecast_line_bokeh_chart.menu_forecast_line_reporting
#: model_terms:ir.ui.view,arch_db:project_forecast_line_bokeh_chart.view_forecast_line_reporting
#: model_terms:ir.ui.view,arch_db:project_forecast_line_bokeh_chart.forecast_line_reporting_form
msgid "Forecast Reporting"
msgstr ""

Expand Down
142 changes: 142 additions & 0 deletions project_forecast_line_bokeh_chart/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_forecast_line_bokeh_chart
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-04-11 15:22+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\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 4.14.1\n"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Available"
msgstr "Disponibile"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__bokeh_chart
msgid "Bokeh Chart"
msgstr "Grafico Bokeh"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__create_uid
msgid "Created by"
msgstr "Creato da"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__create_date
msgid "Created on"
msgstr "Creato il"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__date_from
msgid "Date From"
msgstr "Dalla data"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields.selection,name:project_forecast_line_bokeh_chart.selection__forecast_line_reporting__granularity__day
msgid "Day"
msgstr "Giorno"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__employee_ids
msgid "Employee"
msgstr "Dipendente"

#. module: project_forecast_line_bokeh_chart
#: model:ir.actions.act_window,name:project_forecast_line_bokeh_chart.action_forecast_lines_reporting
#: model:ir.ui.menu,name:project_forecast_line_bokeh_chart.menu_forecast_line_reporting
#: model_terms:ir.ui.view,arch_db:project_forecast_line_bokeh_chart.forecast_line_reporting_form
msgid "Forecast Reporting"
msgstr "Resoconto previsionale"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model,name:project_forecast_line_bokeh_chart.model_forecast_line_reporting
msgid "Forecast reporting wizard"
msgstr "Procedura guidata resoconto previsionale"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__granularity
msgid "Granularity"
msgstr "Granularità"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__id
msgid "ID"
msgstr "ID"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields.selection,name:project_forecast_line_bokeh_chart.selection__forecast_line_reporting__granularity__month
msgid "Month"
msgstr "Mese"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__nb_months
msgid "Nb Months"
msgstr "Nr. mesi"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Not assigned to an employee"
msgstr "Non assegnato a un dipendente"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Nothing to plot. Select some employees"
msgstr "Niente da disegnare. Selezionare qualche dipendente"

#. module: project_forecast_line_bokeh_chart
#: code:addons/project_forecast_line_bokeh_chart/report/forecast_line_reporting.py:0
#, python-format
msgid "Overload"
msgstr "Sovraccarico"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,field_description:project_forecast_line_bokeh_chart.field_forecast_line_reporting__project_ids
msgid "Project"
msgstr "Progetto"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields,help:project_forecast_line_bokeh_chart.field_forecast_line_reporting__project_ids
msgid ""
"Setting this will automatically add all employees assigned to tasks on the "
"project"
msgstr ""
"Questa impostazione aggiungerà automaticamente tutti i dipendenti assegnati "
"alle attività al progetto"

#. module: project_forecast_line_bokeh_chart
#: model:ir.model.fields.selection,name:project_forecast_line_bokeh_chart.selection__forecast_line_reporting__granularity__week
msgid "Week"
msgstr "Settimana"
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ msgstr ""
#. module: project_forecast_line_bokeh_chart
#: model:ir.actions.act_window,name:project_forecast_line_bokeh_chart.action_forecast_lines_reporting
#: model:ir.ui.menu,name:project_forecast_line_bokeh_chart.menu_forecast_line_reporting
#: model_terms:ir.ui.view,arch_db:project_forecast_line_bokeh_chart.view_forecast_line_reporting
#: model_terms:ir.ui.view,arch_db:project_forecast_line_bokeh_chart.forecast_line_reporting_form
msgid "Forecast Reporting"
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
class ForecastLineReporting(models.TransientModel):
_name = "forecast.line.reporting"
_description = "Forecast reporting wizard"
# allow reports to exist for 12h
_transient_max_hours = 24.0

name = fields.Char(required=True)
bokeh_chart = fields.Text(compute="_compute_bokeh_chart")
date_from = fields.Date(default=fields.Date.today)
nb_months = fields.Integer(default=2)
Expand Down Expand Up @@ -217,3 +220,9 @@ def _build_plots(self, height=300, width=1024):
p.add_layout(p.legend[0], "right")
plots.append(p)
return plots

@api.model
def _cron_update_date_from(self):
today = fields.Date.context_today(self)
forecast_reports = self.search([])
forecast_reports.write({"date_from": today})
Loading
Loading