Skip to content

Conversation

geraldo29
Copy link
Contributor

Migration from 17.0 to 18.0

Issue: #1230

Followed technical method explained in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-18.0.

Changes:
1)Removed migration folder
2)Changed 17 to 18 version in a few places
3)Changed tree to list in a few places.
4)Added test-requirements.txt

jjscarafia and others added 30 commits May 21, 2025 10:04
For mis_builder to compute correctly bale we need accounts with user type include_initial_balance. We use receivable type which is the more accurate for this purpose
Currently translated at 100.0% (52 of 52 strings)

Translation: account-financial-reporting-12.0/account-financial-reporting-12.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-12-0/account-financial-reporting-12-0-mis_builder_cash_flow/pt/
Currently translated at 100.0% (53 of 53 strings)

Translation: account-financial-reporting-13.0/account-financial-reporting-13.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-mis_builder_cash_flow/es_AR/
Currently translated at 37.7% (20 of 53 strings)

Translation: account-financial-reporting-13.0/account-financial-reporting-13.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-mis_builder_cash_flow/nl/
Currently translated at 81.1% (43 of 53 strings)

Translation: account-financial-reporting-13.0/account-financial-reporting-13.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-mis_builder_cash_flow/es/
- On v13, invoices are journal entries, so we have to explicitly exclude
  cancelled invoices from the expression. We leave draft ones, as they
  are good for forecasting.
- Default value for the company of the forecast line doesn't follow new
  specification, putting an incorrect value.
- Extra improvement: avoid a non needed casting of the fixed column type.
"Target Moves" option in MIS report instance was previously ignored.

Now it's taken into account, but still excluding cancelled entries.
Currently translated at 100.0% (55 of 55 strings)

Translation: account-financial-reporting-13.0/account-financial-reporting-13.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-mis_builder_cash_flow/es_AR/
Currently translated at 100.0% (55 of 55 strings)

Translation: account-financial-reporting-14.0/account-financial-reporting-14.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-14-0/account-financial-reporting-14-0-mis_builder_cash_flow/it/
Currently translated at 100.0% (55 of 55 strings)

Translation: account-financial-reporting-15.0/account-financial-reporting-15.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-15-0/account-financial-reporting-15-0-mis_builder_cash_flow/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-reporting-16.0/account-financial-reporting-16.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-mis_builder_cash_flow/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-reporting-16.0/account-financial-reporting-16.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-mis_builder_cash_flow/
pedrobaeza and others added 9 commits May 21, 2025 10:04
Currently translated at 100.0% (54 of 54 strings)

Translation: account-financial-reporting-16.0/account-financial-reporting-16.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-mis_builder_cash_flow/sv/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-reporting-17.0/account-financial-reporting-17.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-17-0/account-financial-reporting-17-0-mis_builder_cash_flow/
Currently translated at 100.0% (53 of 53 strings)

Translation: account-financial-reporting-17.0/account-financial-reporting-17.0-mis_builder_cash_flow
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-17-0/account-financial-reporting-17-0-mis_builder_cash_flow/es_AR/
@geraldo29
Copy link
Contributor Author

Error: + pip install -r test-requirements.txt -c test-constraints.txt
Looking in indexes: https://wheelhouse.odoo-community.org/oca-simple-and-pypi
Collecting odoo-addon-date_range==18.0.* (from -r test-requirements.txt (line 1))
Downloading https://wheelhouse.odoo-community.org/oca-simple/odoo-addon-date-range/odoo_addon_date_range-18.0.1.0.0.5-py3-none-any.whl (2.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 91.6 MB/s eta 0:00:00
ERROR: Could not find a version that satisfies the requirement odoo-addon-mis_builder==18.0.* (from versions: 15.0.1.0.1, 15.0.4.0.1, 15.0.4.0.2, 15.0.4.0.2.1, 15.0.4.0.3, 15.0.4.0.3.1, 15.0.4.0.3.2, 15.0.4.0.4, 15.0.4.0.5, 15.0.4.1.0, 15.0.4.1.0.1, 15.0.4.1.1, 15.0.4.1.2, 15.0.4.1.3, 15.0.4.1.3.1, 15.0.4.1.3.2, 15.0.4.1.3.3, 15.0.4.1.3.4, 15.0.4.1.3.5, 15.0.4.1.3.6, 15.0.4.1.3.7, 15.0.4.1.3.8, 15.0.4.1.4, 15.0.4.1.4.1, 15.0.4.1.4.2, 15.0.4.1.4.4, 15.0.4.1.5, 15.0.4.1.5.1, 15.0.4.1.5.2, 15.0.4.1.5.3, 15.0.4.1.5.4, 15.0.4.1.5.5, 15.0.4.1.5.6, 15.0.4.1.5.7, 15.0.4.1.5.8, 15.0.4.1.6, 15.0.4.1.6.1, 16.0.5.0.1, 16.0.5.0.1.1, 16.0.5.1.0.3, 16.0.5.1.0.4, 16.0.5.1.1, 16.0.5.1.1.1, 16.0.5.1.1.2, 16.0.5.1.1.4, 16.0.5.1.1.5, 16.0.5.1.2, 16.0.5.1.3, 16.0.5.1.3.2, 16.0.5.1.3.5, 16.0.5.1.3.7, 16.0.5.1.4, 16.0.5.1.4.3, 16.0.5.1.5, 16.0.5.1.5.1, 16.0.5.1.5.3, 16.0.5.1.6, 16.0.5.1.7, 16.0.5.1.7.2, 16.0.5.1.8, 16.0.5.1.9, 16.0.5.1.9.1, 16.0.5.1.9.2, 16.0.5.1.9.3, 16.0.5.1.9.4, 16.0.5.1.9.5, 16.0.5.1.9.6, 16.0.5.1.9.7, 16.0.5.1.9.8, 16.0.5.1.9.9, 16.0.5.1.10, 16.0.5.1.10.1, 16.0.5.1.11, 16.0.5.1.11.1, 16.0.5.1.11.2, 16.0.5.1.11.3, 16.0.5.1.11.6, 16.0.5.1.12, 16.0.5.1.12.1, 16.0.5.1.13, 16.0.5.2.0, 16.0.5.2.0.1, 16.0.5.2.1, 16.0.5.2.1.1, 16.0.5.2.2, 16.0.5.2.2.2, 16.0.5.2.2.3, 16.0.5.2.3, 16.0.5.2.3.1, 17.0.1.0.0.2, 17.0.1.0.0.3, 17.0.1.0.0.4, 17.0.1.0.0.6, 17.0.1.0.0.7, 17.0.1.0.1, 17.0.1.0.2, 17.0.1.0.3, 17.0.1.0.4, 17.0.1.0.4.1, 17.0.1.0.5, 17.0.1.1.0, 17.0.1.2.0, 17.0.1.2.0.1, 17.0.1.2.0.2, 17.0.1.2.1, 17.0.1.2.1.1)
ERROR: No matching distribution found for odoo-addon-mis_builder==18.0.*

No version 18 for https://wheelhouse.odoo-community.org/oca-simple/odoo-addon-mis-builder/

@geraldo29
Copy link
Contributor Author

Previous error of no version 18 was already fixed and that worked.

Changed company_id to company_ids manytomany

@pedrobaeza
Copy link
Member

Please squash all your migration commits into one.

/ocabot migration mis_builder_cash_flow

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jun 14, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Jun 14, 2025
4 tasks
@geraldo29
Copy link
Contributor Author

/ocabot migration mis_builder_cash_flow

@OCA-git-bot
Copy link
Contributor

Sorry @geraldo29 you are not allowed to mark the addon to be migrated.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

@geraldo29 geraldo29 force-pushed the 18.0-mig-mis_builder_cash_flow branch 2 times, most recently from 6900d46 to b85467e Compare June 15, 2025 21:32
@geraldo29
Copy link
Contributor Author

Squashed commits. @pedrobaeza

@geraldo29
Copy link
Contributor Author

geraldo29 commented Jun 16, 2025

Tested in my Odoo 18 instance and working as expected. Let me know if any changes are needed. Thanks
WhatsApp Image 2025-06-15 at 23 06 18

@pedrobaeza
Copy link
Member

OK, thanks, but the commit message is not correct:

imagen

It should be changed to:

[MIG] mis_builder_cash_flow: Migration to 18.0

Extra explanation about the changes done if you want.

@geraldo29 geraldo29 force-pushed the 18.0-mig-mis_builder_cash_flow branch from b85467e to 8e6ce0c Compare June 16, 2025 13:55
@geraldo29
Copy link
Contributor Author

Changed commit message. Added the following:

image

@pedrobaeza
Copy link
Member

Thanks for the changes. Testing the module in runboat, for forecast lines, the change of company_id to company_ids is not correct: the forecast line still should be to one company. And the field has been put as readonly. What you should do is to allow to search for accounts of that company (shared or not).

- Standard Odoo17->18 migration procedures
- Replace company_id with company_ids (Many2one → Many2many) in forecast lines
- Update constraint validation to check company overlap instead of exact match
- Modify SQL query to handle Many2many relationship with proper JOIN
- Update UI views to use many2many_tags widget for better UX
- Fix test_company_constrain to properly test new validation logic
- Update translations for new validation error message
- Apply code formatting fixes for linting compliance
- Fixes compatibility with Odoo 18's shared account model where
account.account now uses company_ids instead of company_id
@geraldo29 geraldo29 force-pushed the 18.0-mig-mis_builder_cash_flow branch from 98e88a2 to 76f461a Compare June 25, 2025 05:06
@geraldo29
Copy link
Contributor Author

Fixed forecast line to be one company and editable. Allowed for search for accounts of that company shared or not.

image
image

Squashed commits again.

@@ -84,7 +84,7 @@ def init(self):
WHERE aml.parent_state != 'cancel'
UNION ALL
SELECT
fl.id as id,
fl.id + 1000000 as id,
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need this? If there's a conflict of ids, you are only delaying 100k records the conflict, not solving it.

@pedrobaeza
Copy link
Member

@geraldo29 are you going to continue this migration? Please answer remaining questions.

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.