Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3953f7f
[ADD] report_dynamic
ntsirintanis Feb 8, 2022
11c7891
[UPD][WIP] review corrections
ntsirintanis Sep 20, 2022
c9daa24
fixup! [UPD][WIP] review corrections
Oct 2, 2022
cc36300
[UPD] separate menu item for reports, start out with templates
Oct 8, 2022
bf435c0
[UPD] code comments
Oct 8, 2022
617952e
[RFR] Don't direcly show is_template, expose to user only one action …
Oct 8, 2022
e02dea5
[UPD] A report should always have a template, and the link between th…
Oct 8, 2022
c1b3cd4
[IMP] visual representation of locking mechanism
Oct 8, 2022
a009ce2
[UPD] Remove model_name in favour of just model_id
Oct 8, 2022
e802e5b
[UPD] UI reshuffle
Oct 8, 2022
246aa7b
[UPD] wording
Oct 8, 2022
b88806a
[RFR] method for previewing
Oct 8, 2022
e316eec
[UPD] locking help text
Oct 8, 2022
ac925ff
[ADD] another method to create a report from a template, directly fro…
Oct 8, 2022
4c9a866
[IMP] coverage of things added so far
Oct 8, 2022
e5ad3d3
[RFR] now we can actually select empty models
Oct 8, 2022
d3cdbaf
[UPD] Also display exceptions in condition evaluation
Oct 8, 2022
c60d8f1
[UPD] avoid render preview exception when there is no valid resource_ref
Oct 8, 2022
affc36a
[FIX] model should come from template when it is a report
Oct 8, 2022
92d5799
[FIX] model was not copied on new duplication
Oct 8, 2022
18b3776
[FIX] bug where resource_ref is used for previewing and should be pre…
Oct 8, 2022
ee68255
[FIX] bring back sample record
Oct 8, 2022
5fc1ba1
[FIX] almost all the tests
Oct 8, 2022
4dbabd9
Merge pull request #7 from sunflowerit/13.0-report_dynamic-imp
thomaspaulb Oct 9, 2022
25722ae
[UPD] correct attribution and maintainer
Oct 9, 2022
c51fe59
[UPD] present display_name for sample record, increase test coverage
ntsirintanis Oct 10, 2022
cbd0e90
[IMP]Test Case type changed to SavepointCase
Jan 12, 2023
32785aa
Merge pull request #8 from SkiBY/13.0-report_dynamic
thomaspaulb Jan 12, 2023
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ repos:
rev: 2.5.2
hooks:
- id: setuptools-odoo-make-default
- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls rebase after #726 is merged and trash this change

rev: 3.7.9
hooks:
- id: flake8
Expand Down
32 changes: 32 additions & 0 deletions report_dynamic/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
Comment thread
thomaspaulb marked this conversation as resolved.
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=================
Report Dynamic
=================

Generate dynamic contracts based on Building Blocks/Section

Installation
============
* Just Install
Comment thread
simahawk marked this conversation as resolved.

Configuration
=============
* No configurations needed

Credits
=======

Contributors
------------

* Sunflower IT <[email protected]>



Maintainer
----------

This module is maintained by Sunflower IT <http://sunflowerweb.nl>
5 changes: 5 additions & 0 deletions report_dynamic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from . import utils
from . import wizards
30 changes: 30 additions & 0 deletions report_dynamic/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2022 Sunflower IT <http://sunflowerweb.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Report Dynamic",
"version": "13.0.1.0.0",
"category": "Report",
"author": "Sunflower IT, Therp BV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
"license": "AGPL-3",
Comment thread
thomaspaulb marked this conversation as resolved.
"development_status": "Alpha",
"summary": "Dynamic Report Builder",
"depends": ["base", "web_boolean_button"],
"data": [
"security/res_groups.xml",
"security/ir_rule.xml",
"security/ir.model.access.csv",
"data/res_users.xml",
"data/report_dynamic_alias.xml",
"report/report_dynamic_report.xml",
"views/report_dynamic.xml",
"views/report_dynamic_section.xml",
"views/report_dynamic_alias.xml",
"wizards/wizard_lock_report.xml",
"wizards/wizard_report_dynamic.xml",
],
"maintainers": ["thomaspaulb"],
"demo": ["demo/demo.xml"],
"installable": True,
}
29 changes: 29 additions & 0 deletions report_dynamic/data/report_dynamic_alias.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="alias_1" model="report.dynamic.alias">
<field name="expression_from">[H1val]</field>
<field name="expression_to">${h.value}</field>
</record>
<record id="alias_2" model="report.dynamic.alias">
<field name="expression_from">[H2val]</field>
<field name="expression_to">${h.child.value}</field>
</record>
<record id="alias_3" model="report.dynamic.alias">
<field name="expression_from">[H3val]</field>
<field name="expression_to">${h.child.child.value}</field>
</record>
<record id="alias_4" model="report.dynamic.alias">
<field name="expression_from">[H1]</field>
<field name="expression_to">${h.next}</field>
</record>
<record id="alias_5" model="report.dynamic.alias">
<field name="expression_from">[H2]</field>
<field name="expression_to">${h.value}.${h.child.next}</field>
</record>
<record id="alias_6" model="report.dynamic.alias">
<field name="expression_from">[H3]</field>
<field
name="expression_to"
>${h.value}.${h.child.value}.${h.child.child.next}</field>
</record>
</odoo>
11 changes: 11 additions & 0 deletions report_dynamic/data/res_users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Make admin a report dynamic admin by default-->
<record id="base.user_admin" model="res.users">
<field
name="groups_id"
eval="[(4,ref('group_report_dynamic_template_editors'))]"
/>
</record>

</odoo>
70 changes: 70 additions & 0 deletions report_dynamic/demo/demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure about using noupdate for demo data?

<!-- template for demo_report_1 -->
<record id="demo_template_1" model="report.dynamic">
Copy link
Copy Markdown

@SkiBY SkiBY Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know it is my problem only, but noupdate flag is ignored and second test fire up is blocked by _constrain_template_status

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normally demo data is loaded only w/ -i. Anyway, my comment above is not blocking.

<field name="name">Template for report</field>
<field name="model_id" ref="base.model_res_partner" />
<field name="is_template">True</field>
</record>
<!-- Reports -->
<record id="demo_report_1" model="report.dynamic">
<field name="name">Demo report</field>
<field name="resource_ref" ref="base.res_partner_1" />
<field name="template_id" ref="demo_template_1" />
</record>
<!-- Sections -->
<record id="demo_section_1" model="report.dynamic.section">
<field name="name">A paragraph</field>
<field name="is_paragraph">True</field>
<field name="content">Some Black content</field>
<field name="condition_python">object.name.startswith("D")</field>
<field name="report_id" ref="demo_template_1" />
</record>
<record id="demo_section_2" model="report.dynamic.section">
<field name="name">Not a paragraph</field>
<field name="is_paragraph">False</field>
<field name="content">
${object.name}
[H1] # 1
${page}
[H2] # 1.1
${page}
[H2] # 1.2
${page}
[H2] # 1.3

[H3] # 1.3.1
${page}
[H3] # 1.3.2
${page}
[H3] # 1.3.3
${page}
[H3] # 1.3.4
${page}
[H1] # 2
${page}
[H2] # 2.1
${page}
[H2] # 2.2
${page}
[H3] # 2.2.1
${page}
[H1val].[H2val].[H3val] # 2.2.1
</field>
<field name="condition_python">object.name.endswith("r")</field>
<field name="report_id" ref="demo_template_1" />
</record>
<!-- Aliases -->
<record id="demo_alias_1" model="report.dynamic.alias">
<field name="expression_from">Black</field>
<field name="expression_to">White</field>
</record>
<record id="demo_alias_2" model="report.dynamic.alias">
<field name="expression_from">${object.name}</field>
<field name="expression_to">Name: ${object.name}</field>
</record>
<!-- Make Marc Demo a dynamic report reader-->
<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4,ref('group_report_dynamic_report_users'))]" />
</record>
</odoo>
4 changes: 4 additions & 0 deletions report_dynamic/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import report_dynamic
from . import report_dynamic_section
from . import report_dynamic_alias
Loading