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

[16.0][FIX] purchase_security: Compute field correctly and prevent conflicts with other modules #2533

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

celm1990
Copy link
Contributor

Before this commit, in a computed field, the assignment was done using the write method. However, this caused incompatibilities with other modules, for example, purchase_tier_validation. For cache consistency, it is better to assign the field directly within the compute method instead of calling write.

Steps to reproduce with purchase_tier_validation:

Create a tier definition for purchase.order with any condition.
Create a new purchase.order that satisfies the conditions for the previous rule and request validation.
The message is displayed, and the user cannot open the record. This makes it unusable, as no records can be opened anymore.

This change was introduced during the migration process in PR #1902

Runboat instance
http://oca-purchase-workflow-16-0-db4563538698.runboat.odoo-community.org/web?debug=1#cids=1&menu_id=243&action=399&model=purchase.order&view_type=form&id=50

image

@HviorForgeFlow @pedrobaeza could you please review this? Thanks in advance!

…s with other modules

Before this commit, in a computed field, the assignment was done using the write method. However, this caused incompatibilities with other modules, for example, purchase_tier_validation. For cache consistency, it is better to assign the field directly within the compute method instead of calling write.
@OCA-git-bot
Copy link
Contributor

Hi @pilarvargas-tecnativa,
some modules you are maintaining are being modified, check this out!

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.

Indeed that's totally incorrect.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza added this to the 16.0 milestone Jan 26, 2025
@OCA-git-bot OCA-git-bot merged commit ff2b8f8 into OCA:16.0 Jan 26, 2025
9 checks passed
@OCA-git-bot
Copy link
Contributor

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

@celm1990 celm1990 deleted the 16.0-purchase_security branch January 26, 2025 14:26
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.

3 participants