Skip to content

Commit 8c170dc

Browse files
committed
[FIX] purchase_requisition_tier_validation: avoid error editing alternative
Before this commit: * Install purchase_requisition and purchase_tier_validation *Create a Tier Validation for purchase model * Create an order and an alternative * Request for validation for one of the purchase order * Try to edit (and save) the alternative order * You will get a ValidationError: "The operation is under validation." After this commit: You could edit the alternative (that is not under validation) without problem
1 parent 188e2f7 commit 8c170dc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

purchase_requisition_tier_validation/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
from . import purchase_requisition
55
from . import tier_definition
6+
from . import tier_validation
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from odoo import api, models
2+
3+
4+
class TierValidation(models.AbstractModel):
5+
_inherit = "tier.validation"
6+
7+
@api.model
8+
def _get_under_validation_exceptions(self):
9+
"""Extend for more field exceptions."""
10+
res = super()._get_under_validation_exceptions()
11+
res.append("purchase_group_id")
12+
return res

0 commit comments

Comments
 (0)