Skip to content

[19.0] [MIG] contract: Migration to 19.0#1312

Open
BhaveshHeliconia wants to merge 198 commits into
OCA:19.0from
HeliconiaIO:19.0-mig-contract
Open

[19.0] [MIG] contract: Migration to 19.0#1312
BhaveshHeliconia wants to merge 198 commits into
OCA:19.0from
HeliconiaIO:19.0-mig-contract

Conversation

@BhaveshHeliconia
Copy link
Copy Markdown
Contributor

No description provided.

@BhaveshHeliconia BhaveshHeliconia force-pushed the 19.0-mig-contract branch 2 times, most recently from b18f362 to 885e5a6 Compare October 8, 2025 12:17
@tishmen
Copy link
Copy Markdown

tishmen commented Oct 17, 2025

@BhaveshHeliconia can you please handle the failing tests so we can push this forward?

@BhaveshHeliconia BhaveshHeliconia force-pushed the 19.0-mig-contract branch 5 times, most recently from a38846e to c99f54f Compare October 17, 2025 03:57
@mamcode
Copy link
Copy Markdown
Member

mamcode commented Oct 27, 2025

@BhaveshHeliconia could you please re-run the CI checks?
I’ve tested locally with the latest ghcr.io/oca/oca-ci:py3.11-19.0 image, and it seems the CI is using an outdated cache because I am getting different errors from unit tests.

@BhaveshHeliconia BhaveshHeliconia force-pushed the 19.0-mig-contract branch 2 times, most recently from a653227 to 3251a90 Compare November 12, 2025 12:05
@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

@tishmen @mamcode : CI is green now. Thanks!

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot migration contract

Please cherry-pick #1343

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Nov 19, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Nov 19, 2025
27 tasks
@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

/ocabot migration contract

Please cherry-pick #1343

@pedrobaeza : Done. Thanks!

Comment thread contract/models/contract_template_line.py Outdated
Comment thread contract/tests/test_contract.py Outdated
Comment thread contract/tests/test_contract.py Outdated
Comment thread contract/tests/test_portal.py Outdated
@BhaveshHeliconia BhaveshHeliconia force-pushed the 19.0-mig-contract branch 2 times, most recently from 65801a9 to 4ce03c5 Compare November 21, 2025 04:27
@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

@pedrobaeza : I’ve completed all the changes you recommended. Thanks for the feedback!

Comment thread contract/models/contract_template_line.py Outdated
Comment thread contract/models/contract_template_line.py Outdated
Comment thread contract/tests/test_contract.py Outdated
Comment thread contract/tests/test_contract.py Outdated
Comment thread contract/tests/test_contract.py Outdated
@BhaveshHeliconia BhaveshHeliconia force-pushed the 19.0-mig-contract branch 2 times, most recently from b527c46 to 4e377c2 Compare November 21, 2025 09:51
@pedrobaeza
Copy link
Copy Markdown
Member

Please include #1341

@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

Please include #1341

Done. Thanks!

rousseldenis and others added 22 commits May 13, 2026 10:10
…ing onchanges

When copying values from the contract template, skip assignment if the
value is already the same on the contract. This prevents triggering
unnecessary onchanges without altering the behavior.
…ct lines

This field is unused in this module, but in the contract_sale_invoicing module it is used to search Sales Orders. However, many times this field goes unnoticed and users set the analytic distribution directly on the lines.

After this commit, the field is computed automatically based on the contract lines.
On portal, the cancelled lines are not distinguished from running ones,
as the next invoice date is still displayed, and the color is the same
(on contrary than the backend, that appears greyed).

So let's do something similar in portal:

- Put the row as grey.
- Hide the nexte invoice date on that case.

TT59704
@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

@carlos-lopez-tecnativa thanks for the review. I’ve addressed your comments.

@bosd
Copy link
Copy Markdown
Contributor

bosd commented May 13, 2026

Hello @sbidoul , @AaronHForgeFlow , sorry for pinging you directly, can you pls trigger merge here?

Copy link
Copy Markdown

@MohamedOsman7 MohamedOsman7 left a comment

Choose a reason for hiding this comment

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

Tested with runboat, LGTM

Copy link
Copy Markdown
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

In my previous comment, I suggested squashing the administrative commits for the same language and the same author, but I noticed that you squashed commits that should not have been squashed and merged them into the previous commit, losing the original author. Please review this and rework the Git history correctly.

You can read this documentation if it helps:
https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests

Comment on lines +455 to +457
invoices |= self.env["account.move"].search(
[("old_contract_id", "=", self.ids)]
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I’m not sure if this issue is caused by this change, but please check it.

In v19, when you create a new contract without a customer, the invoice count is incorrect. This causes the Recurrence at line level field to become readonly because invoice_count != 0.
Image

In v18, this works fine.
Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additionally, if you pass a list of IDs, the operator should be in instead of =. Please clarify the reason for this change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Changed to in to correctly handle NewId in Odoo 19. This fixes the incorrect count for new contracts and keeps the recurrence field editable. Thanks!

I squashed all translation-related commits together, but I understand now that some commits should have remained separate to preserve the original authorship. I'll rework the Git history accordingly and add it to my TODO list.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, you should only merge translation commits coming from the same author, not all the translations commits together.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.