Skip to content

Conversation

@legalsylvain
Copy link
Contributor

@legalsylvain legalsylvain commented Sep 19, 2025

Creation of mis_builder_report_xlsx

  • Extract "xlsx" feature from mis_builder, creating mis_builder_report_xlsx
  • migration scripts :
    • rename mis_builder.xls_export to mis_builder_report_xlsx.xls_export
    • install new module mis_builder_report_xlsx
  • Create Readme section in the new module

cloc of mis_builder

Before :

Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                          40            699            935           5667
XML                              9              2              6           1169
JavaScript                       1             24             15            164

After :

Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                          39            675            918           5395  (-5%)
XML                              8              2              6           1136  (-3%)
JavaScript                       1             23             15            155  (-5%)

Description

This module improves the MIS Reports modules, allowing to download MIS Reports in XLSX format.

Usage

  • Go to MIS Reports list and form views.
  • Click on 'Export' Button to download your XLSX file.
image
  • In the same way, a button is present in the 'preview' form view of your MIS reports.
image

@sbidoul : what do you think ?

Regards.

@OCA-git-bot
Copy link
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

@legalsylvain legalsylvain force-pushed the 18.0-REF-ADD-mis_builder_report_xlsx branch 3 times, most recently from a320ff0 to c6823a6 Compare September 19, 2025 22:56
Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

Thanks for this, Sylvain. I'm fine with extracting that part if you think it's useful.

It looks good to me overall. I have not verified all the code was moved correctly but I found one suspicious thing. See the comments.


xmlid_renames = [
("mis_builder.xls_export", "mis_builder_report_xlsx.xls_export"),
]
Copy link
Member

Choose a reason for hiding this comment

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

Is this not done automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if the original database is :

 id  |                    name                     |       type        
-----+---------------------------------------------+-------------------
 288 | {"en_US": "MIS report instance XLS report"} | ir.actions.report

With that script:

  • during update

2025-09-25 09:25:36,222 71906 DEBUG mis_builder_v1 OpenUpgrade: 1 rows affected after 0:00:00.000510 running UPDATE ir_model_data SET module = 'mis_builder_report_xlsx', name = 'xls_export' WHERE module = 'mis_builder' and name = 'xls_export'

  • in database, after the update
 id  |                    name                     |       type        
-----+---------------------------------------------+-------------------
 288 | {"en_US": "MIS report instance XLS report"} | ir.actions.report

Without that script

  • during update

2025-09-25 09:30:18,601 72300 INFO mis_builder_v2 odoo.addons.base.models.ir_model: Deleting 288@ir.actions.report (mis_builder.xls_export)

  • in database, after the update

 id  |                    name                     |       type        
-----+---------------------------------------------+-------------------
 289 | {"en_US": "MIS report instance XLS report"} | ir.actions.report

So it can be usefull if this action was referenced in some action_id field.
(It's maybe quite theoritical, but it's an OpenUpgrade good practice)

Comment on lines 12 to 19
SRC_ACTUALS = "actuals"
SRC_ACTUALS_ALT = "actuals_alt"
SRC_CMPCOL = "cmpcol"
SRC_SUMCOL = "sumcol"

MODE_NONE = "none"
MODE_FIX = "fix"
MODE_REL = "relative"
Copy link
Member

Choose a reason for hiding this comment

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

Why are these constants here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Totally useless. Removed.

" that allow to export MIS report in XSLX format.",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, GRAP, Odoo Community Association (OCA)",
Copy link
Member

Choose a reason for hiding this comment

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

Do feel it's important to add GRAP as author here. In a way it is not "new" as it is shuffling code around.

Copy link
Contributor Author

@legalsylvain legalsylvain Sep 25, 2025

Choose a reason for hiding this comment

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

Sorry, I don't understand. Do you want me to remove GRAP, or not?

Personally, I usually add my company name when I spend a significant amount of time on a module. (development, refactoring, etc.)
But it's a matter of taste, so tell me what to do!

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

I think this should be done in 19, not in this version.

@legalsylvain
Copy link
Contributor Author

I think this should be done in 19, not in this version.

Hi @pedrobaeza. Thanks for your answer ! In fact, this PR is, for the time being, just a PoC I did regarding the proposal present in #726.
As said in #726,

As a result, my question here is ONLY "in an ideal world, Do you think it's better to split modules, or to keep a single big one ?".
Once this first question answered, and if refactor is desired by PSC, we could focus on the next question : "on which version we are applying this refactor ? (current V18 version, or new V19 release).

Could you so give your PoV on the other main issue ?
thanks !

@pedrobaeza
Copy link
Member

Although the excel export requires the extra dependency, we already have it also on account_financial_report, so for me it's not critical to split it, and I will always install both.

@legalsylvain
Copy link
Contributor Author

Although the excel export requires the extra dependency, we already have it also on account_financial_report, so for me it's not critical to split it, and I will always install both.

Hi. I didn't make myself clear. I wanted you to comment on the other issue #726.

thanks.

@legalsylvain legalsylvain force-pushed the 18.0-REF-ADD-mis_builder_report_xlsx branch 3 times, most recently from e4fdc2d to a6330c6 Compare September 25, 2025 09:51
@legalsylvain legalsylvain marked this pull request as ready for review September 25, 2025 09:53
@sbidoul
Copy link
Member

sbidoul commented Oct 27, 2025

Thinking about this again I now have some doubts.

For instance, when the annotations feature was added it was added on the html, pdf and xlsx formats at once.
If the xlsx export had been in a separate module maybe the contributor could have argued that it was not necessary to implement it the Excel export and that would have been left with a PR doing only a part of the work.

That is very hypothetical of course, but I worry a bit that the different parts would then evolve at a different speed and therefore lead to a less cohesive result.

@legalsylvain legalsylvain force-pushed the 18.0-REF-ADD-mis_builder_report_xlsx branch from a6330c6 to 4bf9e8e Compare October 27, 2025 20:13
@legalsylvain
Copy link
Contributor Author

Hi @sbidoul. Well, I think that each design has its limitations.

  • Having a single module is harder to port, requires more dependencies, force users to install potentially non desired features.
  • With many modules, some users could ignore some features, because the features are present in an non installed module. Also it allows to have features not fully implemented, as you describe.
    To overcome this last concern, we can force contributors to implement each features in pdf / html / xlsx format. (whatever if there is one or more modules, it can be a prerequite to contribute).

Finally, It's up to you ! You are the chief architect of this repository !

Please let me know your decision.

…module

Co-authored-by: Stéphane Bidoul <stephane.bidoul@acsone.eu>
@legalsylvain legalsylvain force-pushed the 18.0-REF-ADD-mis_builder_report_xlsx branch from 4bf9e8e to e286a33 Compare November 12, 2025 21:01
@legalsylvain
Copy link
Contributor Author

Hi @sbidoul. could you finalize your review here :

  • merge this PR, if you agree.
  • close this PR, if you disagree.

Migration to V19 begin to be done. This work is starting to get moldy ;-)

Thanks !

@sbidoul
Copy link
Member

sbidoul commented Nov 22, 2025

I'm going to close this, as I think XLSX export is an integral part of the core MIS Builder app.

Thanks for your patience and sorry for the hesitation.

@sbidoul sbidoul closed this Nov 22, 2025
@legalsylvain
Copy link
Contributor Author

Thanks for your answer, @sbidoul.

Regarding my last PR on mis-builder, could you take a time to answer to that question when you have time ? thanks ! #732 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants