Skip to content

[18.0][FIX] contract line successor: use parent.is_auto_renew to avoid EvalError in column_invisible #1254

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

Merged

Conversation

Anxo82
Copy link
Contributor

@Anxo82 Anxo82 commented Jun 16, 2025

@HaraldPanten
[T-8579]
When creating a new contract template and selecting "supplier" as the contract_type, show an EvalError "Can not evaluate python expression: (bool(parent.contract_type == 'purchase' and not is_auto_renew))"

image

The fix replaces is_auto_renew with parent.is_auto_renew to ensure the expression is evaluated correctly in the context of the parent form. To make this work, the is_auto_renew field was added as a computed Boolean field on the contract.template model.

@OCA-git-bot
Copy link
Contributor

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

@Anxo82 Anxo82 changed the title [18.0][FIX] contract line successor: use parent.is_auto_renew to avoid EvalError in column_invisible [WIP][18.0][FIX] contract line successor: use parent.is_auto_renew to avoid EvalError in column_invisible Jun 16, 2025
@Anxo82 Anxo82 marked this pull request as draft June 16, 2025 13:37
@Anxo82 Anxo82 force-pushed the 18.0-FIX-contract_line_successor branch 2 times, most recently from 67454d0 to f8c6a94 Compare June 16, 2025 13:55
@Anxo82 Anxo82 changed the title [WIP][18.0][FIX] contract line successor: use parent.is_auto_renew to avoid EvalError in column_invisible [18.0][FIX] contract line successor: use parent.is_auto_renew to avoid EvalError in column_invisible Jun 16, 2025
@Anxo82 Anxo82 marked this pull request as ready for review June 16, 2025 15:01
@Anxo82 Anxo82 force-pushed the 18.0-FIX-contract_line_successor branch from f8c6a94 to c657971 Compare June 17, 2025 11:35
@Anxo82 Anxo82 force-pushed the 18.0-FIX-contract_line_successor branch from c657971 to e03d038 Compare June 17, 2025 11:40
Copy link

@Jaimermaccione Jaimermaccione left a comment

Choose a reason for hiding this comment

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

@Anxo82 I’ve tested the described case and the error no longer occurs. I’d say this works fine now from a functional point of view. LGTM!

Copy link
Contributor

@Tisho99 Tisho99 left a comment

Choose a reason for hiding this comment

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

LGTM Technical review

@OCA-git-bot
Copy link
Contributor

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). 🤖

@HaraldPanten
Copy link

@pedrobaeza Could we merge this FIX?

THX! 🙏

@pedrobaeza pedrobaeza added this to the 18.0 milestone Jun 30, 2025
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.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1254-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit f809d91 into OCA:18.0 Jun 30, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@HaraldPanten HaraldPanten deleted the 18.0-FIX-contract_line_successor branch June 30, 2025 15:21
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