-
-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] base_tier_validation: support computed state field
Computed fields bypass `write`, so we need to override `_write` for that case. Also, the current value before the update needs to be fetched from the database because the new value is already set in the cache.
- Loading branch information
1 parent
33f9425
commit 6e019ed
Showing
8 changed files
with
224 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,12 @@ development. | |
|
||
See `purchase_tier_validation <https://github.com/OCA/purchase-workflow>`_ as an example of implementation. | ||
|
||
Additionally, if your state field is a (stored) computed field, you need | ||
to set ``_tier_validation_state_field_is_computed`` to ``True`` in your | ||
model Python file, and you will want to add the dependent fields of the | ||
compute method in ``_get_after_validation_exceptions`` and | ||
``_get_under_validation_exceptions``. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
|
@@ -233,6 +239,8 @@ Contributors | |
|
||
* Houzéfa Abbasbhay | ||
|
||
- Stefan Rijnhart <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
* `XCG Consulting <https://xcg-consulting.fr>`_: | ||
|
||
* Houzéfa Abbasbhay | ||
* Stefan Rijnhart <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters