Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][IMP] contract: Terminate contract lines with last_date_invoiced if it is higher than terminate date from wizard #1177

Merged

Conversation

sergio-teruel
Copy link
Contributor

cc @Tecnativa TT52602

Well, when you have a contract with some lines with diferents recurrences you can different last date invoiced values so if you try to terminate all contrat from wizard you can obtain an error because the date in the wizard is lower than the last date invoiced in the line.

With this improvement user can choose if terminate the line with last date invoiced instead if is higher than the date of the wizard.

ping @carlosdauden @carlos-lopez-tecnativa

self.contract_line_ids.filtered("is_stop_allowed").stop(terminate_date)
for line in self.contract_line_ids.filtered("is_stop_allowed"):
line.stop(
max(terminate_date, line.last_date_invoiced)
Copy link
Contributor

Choose a reason for hiding this comment

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

If any line does not have a date, I encounter this error
image

@rousseldenis
Copy link
Contributor

@sergio-teruel Tests should be welcome

@sergio-teruel sergio-teruel force-pushed the 17.0-IMP-contract-terminate-last_invoice-date branch 2 times, most recently from f1631c7 to 9b6b369 Compare January 10, 2025 12:47
@sergio-teruel
Copy link
Contributor Author

@carlos-lopez-tecnativa Fixed , thanks...

@rousseldenis Oks..

@sergio-teruel sergio-teruel force-pushed the 17.0-IMP-contract-terminate-last_invoice-date branch from 9b6b369 to 35852ea Compare January 10, 2025 13:04
@sergio-teruel
Copy link
Contributor Author

Copy link
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.

LGTM

@pedrobaeza
Copy link
Member

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-1177-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0c82b1c into OCA:17.0 Jan 10, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza deleted the 17.0-IMP-contract-terminate-last_invoice-date branch January 10, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants