mis-builder icon indicating copy to clipboard operation
mis-builder copied to clipboard

[18.0][MIG] mis_builder: Migration to 18.0

Open chaule97 opened this issue 1 year ago • 19 comments

  • When searching for accounts by code, we only search for accounts by code within a single company. I will add a TODO note to improve this query in future updates.
  • In Odoo 18, name_search already searches by display_name, so I override the _search_display_name method in mis.report.kpi.expression.
  • in the reporting-engine module, the report_type field in report_type model has a new value xlsx. However, the test_report in odoo 18 can't examine it. I have to add with self.assertLogs("odoo.tools.test_reports", level="WARNING"): to ignore the warning.

chaule97 avatar Dec 02 '24 05:12 chaule97

search _fetch is a new feature, sometime we are not not familiar with it. but you are right when we don't need to over optimize. I think if code that can't be overridden or queries that can only be used once then it is still good for modules.

image

chaule97 avatar Dec 10 '24 05:12 chaule97

I'm aware of the optimization that search_fetch brings, but it comes at a cost of code that is harder to read, and also the optimization benefit is easily lost when later modifying the code to read another field as it's easy to forget to add the new field to the search_fetch call. So I think we should reserve these for places where it really matters.

It is anyway unrelated to the migration. Could you remove these search_fetch changes, and possibly open another PR if you think it is important in some places, so we can discuss it separately from the migration?

Could you also move the constraint on style name to a separate PR? It is also unrelated to the migration and it will be easier for me to track the backports if it is separated.

Thanks for moving the self.env._ part to a separate commit!

I'll look closer at the multicompany parts soon.

sbidoul avatar Dec 10 '24 08:12 sbidoul

I think self.env._ is part of the migration itself, as it's something of 18.0 version that comes with the migration (we have included in fact in the migration guide). It's not a different feature. And it can't be backported.

pedrobaeza avatar Dec 10 '24 08:12 pedrobaeza

I think self.env._ is part of the migration itself, as it's something of 18.0 version that comes with the migration (we have included in fact in the migration guide). It's not a different feature. And it can't be backported.

Yes, it is in a separate commit, that is fine. I'm not asking to have it in a separate PR.

sbidoul avatar Dec 10 '24 08:12 sbidoul

I don't think it should go in a separate commit as said.

pedrobaeza avatar Dec 10 '24 09:12 pedrobaeza

Could you also move the constraint on style name to a separate PR? It is also unrelated to the migration and it will be easier for me to track the backports if it is separated.

Should I create PR for 17.0 or 18.0?

chaule97 avatar Dec 10 '24 09:12 chaule97

@chaule97 as you prefer. Even 16.0 if you like.

sbidoul avatar Dec 10 '24 09:12 sbidoul

I don't think it should go in a separate commit as said.

My reasoning is that it's similar to the changes done by pre-commit. Mechanical changes done by odoo-module-migrator are best in a separate commit and keep the changes done by a human in a distinct commit.

sbidoul avatar Dec 10 '24 10:12 sbidoul

My reasoning is that it's similar to the changes done by pre-commit. Mechanical changes done by odoo-module-migrator are best in a separate commit and keep the changes done by a human in a distinct commit.

Well, I do that changes by hand, not using odoo-module-migrator, but then let's normalize this into a commit [MIG] <module>: odoo-module-migrator auto-changes, but not specific commits for each of the changes.

pedrobaeza avatar Dec 10 '24 10:12 pedrobaeza

Anyway, thinking twice, at the end, odoo-module-migrator is doing the same job as you as human, so we differentiate them? What we want is to have all the changes needed for a migration in one place (or is it only me that this is what I want to check while reviewing a migration - among other things, of course -?)

pedrobaeza avatar Dec 10 '24 10:12 pedrobaeza

odoo-module-migrator is doing the same job as you as human, so we differentiate them

By that reasaoning, why then requiring a separate commit for pre-commit changes? When there are massive mechanical changes like that it makes the review much easier when they are isolated from the rest.

sbidoul avatar Dec 10 '24 10:12 sbidoul

pre-commit changes are only syntactic or tool-related ones. They can be mostly ignored. These other changes involves framework changes and other modifications that may affect with more probability with the features/functioning of the module.

pedrobaeza avatar Dec 10 '24 10:12 pedrobaeza

@chaule97 I pushed a commit to your branch with the _read_group improvement.

There is still another one I'm working on right now.

sbidoul avatar Jan 31 '25 13:01 sbidoul

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

OCA-git-bot avatar Jan 31 '25 13:01 OCA-git-bot

This is the test I just did, not successful unfortunately:

  • created a report template with 2 lines, crd[60%] and dbt[60%] image

  • created a report for 2025 period

  • the database had the following entries on this account:

image

  • MIS report shows: 30 for the credit line (not ok, should be 0 based on the entries) 30 for the debit line (ok) image

When clicking on the 30 figures (on the 3 lines, same effect), the following error is shown: image

vdewulf avatar Jan 31 '25 15:01 vdewulf

Added a couple commits with the refactoring of prorata.read_group.mixin to use _read_group instead of read_group, and a basic test. Other tests for that are in the mis_builder_budget module.

sbidoul avatar Jan 31 '25 16:01 sbidoul

I removed a jquery remnant in the js code.

@vdewulf the drilldown issue should be fixed. The debit/credit calculation seems correct.

sbidoul avatar Jan 31 '25 16:01 sbidoul

I'll get back to this soon to finalize and merge.

sbidoul avatar Apr 02 '25 12:04 sbidoul

/ocabot migration mis_builder

sbidoul avatar May 09 '25 06:05 sbidoul

Functional Test 👍

BhaveshHeliconia avatar May 14 '25 07:05 BhaveshHeliconia

@sbidoul: Would it be possible to kindly merge this PR at your earliest convenience? We’re hoping to start using it in the production environment. Appreciate your support!

Thank you! 😊

BhaveshHeliconia avatar May 14 '25 07:05 BhaveshHeliconia

We are also looking forward to this module. Any plans on merging any time soon?

andrius-preimantas avatar May 27 '25 12:05 andrius-preimantas

Yes, it will be merged next week latest. In the meantime the data model should not change, so it is safe to use.

sbidoul avatar May 27 '25 12:05 sbidoul

Thanks for the response @sbidoul , highly appreciated

andrius-preimantas avatar May 28 '25 05:05 andrius-preimantas

Alright, this one looks good now. We'll finish mis_builder_budget and mis_builder_demo separately.

/ocabot merge nobump

sbidoul avatar Jun 02 '25 16:06 sbidoul

This PR looks fantastic, let's merge it! Prepared branch 18.0-ocabot-merge-pr-652-by-sbidoul-bump-nobump, awaiting test results.

OCA-git-bot avatar Jun 02 '25 16:06 OCA-git-bot

Congratulations, your PR was merged at 4cdc69ba0034fbeab478fa1be7a7c843ccef2ec4. Thanks a lot for contributing to OCA. ❤️

OCA-git-bot avatar Jun 02 '25 16:06 OCA-git-bot

I realised I did lose @chaule97 's authorship on two commit during my work here.

So since the merge is still very young I exceptionally did a rebase and force push to 18.0 to restore authorship on 39efa86fb1ff22563fa7dcc68095a4979a289699 and df5bbd74777fca57a95bd6af324ed31819704aa3.

sbidoul avatar Jun 03 '25 03:06 sbidoul

I realised I did lose @chaule97 's authorship on two commit during my work here.

So since the merge is still very young I exceptionally did a rebase and force push to 18.0 to restore authorship on 39efa86 and df5bbd7.

No problem, just stay it

chaule97 avatar Jun 03 '25 03:06 chaule97