[13.0][ADD] report_dynamic - Lets Odoo users build reports
This new module allows Odoo users to create a report on any model without the need of a developer:
- Report content is a sequence of Jinja-capable HTML template blocks.
- Each block can be conditionally shown or hidden by evaluation of an Odoo domain or a Python expression.
- Aliases can be defined as shorthand expressions to more complicated ones. As the original requirement was for generating contracts, it also includes a macro for automatic section numbering (1.1, 1.2, 1.2.1 etc).
- For usage, the module adds a "More.." server action to generate the report from the record's form view.
- Multiple templates can exists per each model, and a domain expression can be defined on each template to define on which records it should apply. If the server action is called on a record and multiple report templates match the record, a popup comes to let the user choose which template to use.
@Kiplangatdan Opened it slightly differently
@thomaspaulb This is alright, it can be picked from here.
Hey @thomaspaulb, thank you for your Pull Request.
It looks like some users haven't signed our Contributor License Agreement, yet. You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla Here is a list of the users:
- douglas-tabut [email protected] (no github login found)
Appreciation of efforts, OCA CLAbot
CLA for @douglas-tabut is OK (checked manually, I'll look into why the clabot is not finding it)
@gurneyalex Thanks for checking!
Depends on https://github.com/OCA/web/pull/1822 which is not merged yet.
Now merged.
@thomaspaulb let's please set this to draft until we have something complete
@thomaspaulb let's please set this to draft until we have something complete @ntsirintanis done
@thomaspaulb great PR!
Hi @thomaspaulb , do you plan on working further on this one? thanks!
@francesco-ooops Yes! There only two todo's left:
-
Find a better solution for the "preview record" selection widget, currently it's
fields.Referencebut it doesnt really work well -
Automatically create/remove a "Create report" server action on any record type where we have dynamic reports enabled - we started on that but didn't finish yet.
Hey @ntsirintanis, this is on your plate but it looks like you didn't get to it yet - do you need more pointers on this one? If yes, reassign back to me, if no, let's plan some time to get this over the finish line.
@thomaspaulb great PR! any good news about these two points ?
@thomaspaulb could you also do a rebase? :)
I am going to continue on this when I manage to find some time.
TODO: One window action per model
TODO: provide search view, add column resource_ref in tree view, hide it when there is a template.
I've run out of ideas of how to make this (functionally) better. If anyone's feels like doing some functional testing and bring forth also some ideas, please do so. I will start thinking about how to unit test everything here.
Hi @thomaspaulb and @ntsirintanis really thanks for this PR!!!
This is just my review from the UX point of view:
1 Create new Tab “Dynamic Placeholder” for all fields about this argument

2 Move the field “Preview Record” above

3 Enable/Disable expression Python (with the switch widget) when it’s disabled then hide the description

4 Archive in the first place as the standard

5 Why i need this list in the form when i can manage and create my sections directly from smart button ?
For my perspective when i tested this in runboat it’s more comfortable from smart button then from popup.
From smart button i have more space and more “air” because as the final user when i creating the new report i need stay there not 2 mins but maybe 1 hour or more.

POPUP

FORM

Please let me know your opinion of these points.
@elvise thanks a lot for taking the time to test this, and respond with some really meaningful feedback! I'll go through your points and implement them as needed.
3 Enable/Disable expression Python (with the switch widget) when it’s disabled then hide the description
@ntsirintanis I tested again, i think we need to add a new menu “Report” because right now its reachable only if you click in the name “Dynamic Reports”

https://user-images.githubusercontent.com/5269577/174481867-4dfb182d-8126-4638-b842-b178989776e9.mov
@ntsirintanis what do you think ?
Hi @ntsirintanis do you already have some ideas on how to manage o2m fields such as "sale orde line"?
@elvise many thanks for your suggestions and time taken from your side concerning this module. I plan to evolve it further when I find some time.
@elvise many thanks for your suggestions and time taken from your side concerning this module. I plan to evolve it further when I find some time.
@ntsirintanis great! can you fix pre-commit and codecov ?
I would like to try to merge and then port to 14
@elvise pre-commit and codecov are now fixed. Please note that I do not consider this module complete yet, it still needs some work.
@ntsirintanis really good! what is your plan about this module ?
@ntsirintanis really good! what is your plan about this module ?
@ntsirintanis just a gentle reminder
@ntsirintanis really good! what is your plan about this module ?
@ntsirintanis just a gentle reminder
At this moment it is not really high at my priority list, so I am not quite sure when I will resume working on this one. For now, let's just remove draft state. @thomaspaulb can you please do that?
@ntsirintanis Could you reiterate your TODO list on this module, and highlight if you consider any of them breaking to merge it in? If none are breaking, we can just add them to the ROADMAP and other people can pick them up after merge.
@thomaspaulb at this very moment I do not have any more ideas to edit this functionally. Rendering One2many fields should be investigated though. Beyond that, this module is quite stable.