reporting-engine icon indicating copy to clipboard operation
reporting-engine copied to clipboard

[13.0][ADD] report_dynamic - Lets Odoo users build reports

Open thomaspaulb opened this issue 3 years ago • 52 comments

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.

thomaspaulb avatar Feb 23 '22 08:02 thomaspaulb

@Kiplangatdan Opened it slightly differently

thomaspaulb avatar Feb 23 '22 08:02 thomaspaulb

@thomaspaulb This is alright, it can be picked from here.

Kiplangatdan avatar Feb 23 '22 08:02 Kiplangatdan

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:

Appreciation of efforts, OCA CLAbot

oca-clabot avatar Feb 24 '22 18:02 oca-clabot

CLA for @douglas-tabut is OK (checked manually, I'll look into why the clabot is not finding it)

gurneyalex avatar Feb 28 '22 08:02 gurneyalex

@gurneyalex Thanks for checking!

thomaspaulb avatar Feb 28 '22 10:02 thomaspaulb

Depends on https://github.com/OCA/web/pull/1822 which is not merged yet.

gurneyalex avatar Feb 28 '22 11:02 gurneyalex

Now merged.

thomaspaulb avatar Feb 28 '22 19:02 thomaspaulb

@thomaspaulb let's please set this to draft until we have something complete

ntsirintanis avatar Apr 05 '22 10:04 ntsirintanis

@thomaspaulb let's please set this to draft until we have something complete @ntsirintanis done

gurneyalex avatar Apr 06 '22 11:04 gurneyalex

@thomaspaulb great PR!

elvise avatar May 02 '22 16:05 elvise

Hi @thomaspaulb , do you plan on working further on this one? thanks!

francesco-ooops avatar May 16 '22 15:05 francesco-ooops

@francesco-ooops Yes! There only two todo's left:

  • Find a better solution for the "preview record" selection widget, currently it's fields.Reference but 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 avatar May 16 '22 15:05 thomaspaulb

@thomaspaulb great PR! any good news about these two points ?

elvise avatar May 27 '22 09:05 elvise

@thomaspaulb could you also do a rebase? :)

elvise avatar May 27 '22 09:05 elvise

I am going to continue on this when I manage to find some time.

ntsirintanis avatar May 30 '22 07:05 ntsirintanis

TODO: One window action per model

ntsirintanis avatar Jun 01 '22 14:06 ntsirintanis

TODO: provide search view, add column resource_ref in tree view, hide it when there is a template.

ntsirintanis avatar Jun 02 '22 13:06 ntsirintanis

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.

ntsirintanis avatar Jun 08 '22 10:06 ntsirintanis

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
IMG_1128

2 Move the field “Preview Record” above IMG_1129

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

4 Archive in the first place as the standard IMG_1131

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. IMG_1132

POPUP IMG_1134

FORM IMG_1133

Please let me know your opinion of these points.

elvise avatar Jun 08 '22 18:06 elvise

@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.

ntsirintanis avatar Jun 09 '22 07:06 ntsirintanis

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” IMG_1140

https://user-images.githubusercontent.com/5269577/174481867-4dfb182d-8126-4638-b842-b178989776e9.mov

@ntsirintanis what do you think ?

elvise avatar Jun 19 '22 12:06 elvise

Hi @ntsirintanis do you already have some ideas on how to manage o2m fields such as "sale orde line"?

elvise avatar Jun 24 '22 13:06 elvise

@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 avatar Jun 27 '22 08:06 ntsirintanis

@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 avatar Jun 27 '22 17:06 elvise

@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 avatar Jul 15 '22 13:07 ntsirintanis

@ntsirintanis really good! what is your plan about this module ?

elvise avatar Jul 29 '22 16:07 elvise

@ntsirintanis really good! what is your plan about this module ?

@ntsirintanis just a gentle reminder

elvise avatar Aug 15 '22 13:08 elvise

@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 avatar Aug 16 '22 07:08 ntsirintanis

@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 avatar Aug 16 '22 09:08 thomaspaulb

@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.

ntsirintanis avatar Aug 18 '22 08:08 ntsirintanis