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][FIX] base_tier_validation - fix 'false positive' raise #1024

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

luc-demeyer
Copy link

base_tier_validation/models/tier_validation.py may raise an exception in the _tier_validation_check_write_allowed() method when there is no change (when vals[fld] == rec[fld]).
I encountered this case while using the account_move_tier_validation module and posting a number of validated supplier invoices via the list view (Action -> Post entries).
In this case the account.move sequence mixin generates a write on the sequence_prefix field but vals["sequence_prefix"] is equal to rec.sequence_prefix hence this is not 'real' write and we should not prevent the posting in such a case (when Confirming these same invoices via the form view no raise is generated).
The solution is to limit raise to writes that do modify the field value.

base_tier_validation/models/tier_validation.py may raise an exception
in the _tier_validation_check_write_allowed() method when there is
no change (when vals[fld] == rec[fld]).
I encountered this case while using the account_move_tier_validation
module and posting a number of validated supplier invoices via the
list view (Action -> Post entries).
In this case the account.move sequence mixin generates a write on
the sequence_prefix field but vals["sequence_prefix"] is equal to
rec.sequence_prefix hence this is not 'real' write and we should
not prevent the posting in such a case (when Confirming these same
invoices via the form view no raise is generated).
The solution is to limit raise to writes that do modify the field value.
@OCA-git-bot
Copy link
Contributor

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

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.

2 participants