Skip to content

Commit

Permalink
[17.0][FIX] mis_builder: fixed version
Browse files Browse the repository at this point in the history
  • Loading branch information
mpascuall committed May 6, 2024
1 parent 9a29e11 commit 9773d66
Show file tree
Hide file tree
Showing 31 changed files with 1,492 additions and 1,474 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^mis_builder/|
^mis_builder_budget/|
^mis_builder_demo/|
# END NOT INSTALLABLE ADDONS
Expand Down
902 changes: 474 additions & 428 deletions mis_builder/README.rst

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions mis_builder/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "MIS Builder",
"version": "16.0.5.1.9",
"version": "17.0.1.0.0",
"category": "Reporting",
"summary": """
Build 'Management Information System' Reports and Dashboards
Expand Down Expand Up @@ -38,7 +38,7 @@
],
},
"qweb": ["static/src/xml/mis_report_widget.xml"],
"installable": False,
"installable": True,
"application": True,
"license": "AGPL-3",
"development_status": "Production/Stable",
Expand Down
10 changes: 0 additions & 10 deletions mis_builder/migrations/16.0.5.0.0/end-migrate.py

This file was deleted.

29 changes: 0 additions & 29 deletions mis_builder/migrations/8.0.2.0.0/post-migration.py

This file was deleted.

20 changes: 0 additions & 20 deletions mis_builder/migrations/8.0.2.0.0/pre-migration.py

This file was deleted.

4 changes: 1 addition & 3 deletions mis_builder/models/mis_kpi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MisKpiData(models.AbstractModel):
_name = "mis.kpi.data"
_description = "MIS Kpi Data Abtract class"

name = fields.Char(compute="_compute_name", required=False, readonly=True)
name = fields.Char(compute="_compute_name", required=False)
kpi_expression_id = fields.Many2one(
comodel_name="mis.report.kpi.expression",
required=True,
Expand All @@ -39,13 +39,11 @@ class MisKpiData(models.AbstractModel):
seq1 = fields.Integer(
related="kpi_expression_id.kpi_id.sequence",
store=True,
readonly=True,
string="KPI Sequence",
)
seq2 = fields.Integer(
related="kpi_expression_id.subkpi_id.sequence",
store=True,
readonly=True,
string="Sub-KPI Sequence",
)

Expand Down
27 changes: 17 additions & 10 deletions mis_builder/models/mis_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,17 @@ class MisReportKpi(models.Model):

_order = "sequence, id"

def name_get(self):
res = []
@api.depends("description")
def _compute_display_name(self):
for rec in self:
name = f"{rec.description} ({rec.name})"
res.append((rec.id, name))
return res
rec.display_name = f"{rec.description} ({rec.name})"
return rec

@api.model
def name_search(self, name="", args=None, operator="ilike", limit=100):
domain = args or []
domain += ["|", ("name", operator, name), ("description", operator, name)]
return self.search(domain, limit=limit).name_get()
return self.search(domain, limit=limit)._compute_display_name()

@api.constrains("name")
def _check_name(self):
Expand Down Expand Up @@ -292,7 +291,7 @@ class MisReportKpiExpression(models.Model):
_description = "MIS Report KPI Expression"
_order = "sequence, name, id"

sequence = fields.Integer(related="subkpi_id.sequence", store=True, readonly=True)
sequence = fields.Integer(related="subkpi_id.sequence", store=True)
name = fields.Char(string="Expression")
kpi_id = fields.Many2one("mis.report.kpi", required=True, ondelete="cascade")
# TODO FIXME set readonly=True when onchange('subkpi_ids') below works
Expand All @@ -306,7 +305,14 @@ class MisReportKpiExpression(models.Model):
)
]

def name_get(self):
@api.depends(
"kpi_id.description",
"subkpi_id.description",
"kpi_id.name",
"subkpi_id.name",
"kpi_id.display_name",
)
def _compute_display_name(self):
res = []
for rec in self:
kpi = rec.kpi_id
Expand All @@ -317,7 +323,8 @@ def name_get(self):
)
else:
name = rec.kpi_id.display_name
res.append((rec.id, name))
rec.display_name = name
res.append(rec)
return res

@api.model
Expand Down Expand Up @@ -354,7 +361,7 @@ def name_search(self, name="", args=None, operator="ilike", limit=100):
]
)
domain = osv_expression.AND([domain, name_search_domain])
return self.search(domain, limit=limit).name_get()
return self.search(domain, limit=limit)._compute_display_name()


class MisReportQuery(models.Model):
Expand Down
4 changes: 1 addition & 3 deletions mis_builder/models/mis_report_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def _compute_pivot_date(self):
_description = "MIS Report Instance"

name = fields.Char(required=True, translate=True)
description = fields.Char(related="report_id.description", readonly=True)
description = fields.Char(related="report_id.description")
date = fields.Date(
string="Base date", help="Report base date " "(leave empty to use current date)"
)
Expand Down Expand Up @@ -539,12 +539,10 @@ def _compute_pivot_date(self):
temporary = fields.Boolean(default=False)
source_aml_model_id = fields.Many2one(
related="report_id.move_lines_source",
readonly=True,
)
source_aml_model_name = fields.Char(
related="source_aml_model_id.model",
related_sudo=True,
readonly=True,
)
analytic_domain = fields.Text(
default="[]",
Expand Down
29 changes: 29 additions & 0 deletions mis_builder/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- Stéphane Bidoul \<<[email protected]>\>
- Laetitia Gangloff \<<[email protected]>\>
- Adrien Peiffer \<<[email protected]>\>
- Alexis de Lattre \<<[email protected]>\>
- Alexandre Fayolle \<<[email protected]>\>
- Jordi Ballester \<<[email protected]>\>
- Thomas Binsfeld \<<[email protected]>\>
- Giovanni Capalbo \<<[email protected]>\>
- Marco Calcagni \<<[email protected]>\>
- Sébastien Beau \<<[email protected]>\>
- Laurent Mignon \<<[email protected]>\>
- Luc De Meyer \<<[email protected]>\>
- Benjamin Willig \<<[email protected]>\>
- Martronic SA \<<[email protected]>\>
- nicomacr \<<[email protected]>\>
- Juan Jose Scarafia \<<[email protected]>\>
- Richard deMeester \<<[email protected]>\>
- Eric Caudal \<<[email protected]>\>
- Andrea Stirpe \<<[email protected]>\>
- Maxence Groine \<<[email protected]>\>
- Arnaud Pineux \<<[email protected]>\>
- Ernesto Tejeda \<<[email protected]>\>
- Pedro M. Baeza \<<[email protected]>\>
- Alexey Pelykh \<<[email protected]>\>
- Jairo Llopis (<https://www.moduon.team/>)
- Dzung Tran \<<[email protected]>\>
- Hoang Diep \<<[email protected]>\>
- [APSL](<https://apsl.tech>):
- Miquel Pascual \<<[email protected]>\>
27 changes: 0 additions & 27 deletions mis_builder/readme/CONTRIBUTORS.rst

This file was deleted.

5 changes: 5 additions & 0 deletions mis_builder/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module allows you to build Management Information Systems
dashboards. Such style of reports presents KPI in rows and time periods
in columns. Reports mainly fetch data from account moves, but can also
combine data coming from arbitrary Odoo models. Reports can be exported
to PDF, Excel and they can be added to Odoo dashboards.
5 changes: 0 additions & 5 deletions mis_builder/readme/DESCRIPTION.rst

This file was deleted.

7 changes: 7 additions & 0 deletions mis_builder/readme/DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
A typical extension is to provide a mechanism to filter reports on
analytic dimensions or operational units. To implement this, you can
override \_get_additional_move_line_filter and \_get_additional_filter
to further filter move lines or queries based on a user selection. A
typical use case could be to add an analytic account field on
mis.report.instance, or even on mis.report.instance.period if you want
different columns to show different analytic accounts.
6 changes: 0 additions & 6 deletions mis_builder/readme/DEVELOP.rst

This file was deleted.

Loading

0 comments on commit 9773d66

Please sign in to comment.