[13.0][MIG] base_exception: Migration to 13.0 - #1920
Merged
Merged
Conversation
* Fix menu in base_exception * Fix base_exception/views/base_exception_view.xml
…lled by constraint methods 'detect_exception' can be called on an empty recordset.
Defines a new mechanism to build odoo classes that are only defined during testing.
- Show menu only to Exception Rule Managers - Use sequence and active widgets on tree view - Updated form to use sheet
… the _popup_exceptions mehtod
improve the perfs dramastically when there is a lot of records
No more empty fields after changing type.
Add a note about safe_eval
[IMP] Computed exception descriptions field, to display better help messages [IMP] Exceptions shouldn't be copied
This recently added feature is counter intuitive, error prone and is already causing bugs in sale_workflow.
The goal of the modified method is to create or remove the relationship (in the M2m relation tabel) between the tested model (such as sale_order) and the exception rules. When the ORM writes on ExceptionRule.sale_ids (using the example of sale_exception), it will first proceeds with these updates: * an UPDATE on exception_rule to set the write_date * INSERT or DELETE on the relation table * but then, as "write" is called on the exception rule, the ORM will trigger the api.depends to recompute all the "main_exception_ids" of the records (sales, ...) related to it, leading to an UPDATE for each sale order We end up with RowExclusiveLock on such records: * All the records of the relation table added / deleted for the current sale order * All the records of exception_rule matching the current sale order * All the records of sale_order related to the exception rules matching the current sale order The first one is expected, the next 2 are not. We can remove the lock on the exception_rule table by removing `_log_access`, however in any case, the main_exception_ids computed field will continue to lock many sale orders, effectively preventing 2 sales orders with the same exception to be confirmed at the same time. Reversing the write by writing on SaleOrder instead of ExceptionRule fixes the 2 unexpected locks. It should not result in more queries: the "to remove" part generates a DELETE on the relation table for the rule to remove and the "to add" part generates an INSERT for the rule to add, both will be exactly the same in both cases. Related to OCA#1642 Replaces OCA#1638
…ected exceptions (with test)
29 tasks
joao-p-marques
force-pushed
the
13.0-mig-base_exception
branch
from
October 30, 2020 15:34
6e97974 to
cbc4aa4
Compare
Member
Author
|
Also updated README |
victoralmau
reviewed
Nov 3, 2020
victoralmau
approved these changes
Nov 3, 2020
Contributor
|
This PR has the |
Member
|
/ocabot merge nobump |
Contributor
|
What a great day to merge this nice PR. Let's do it! |
Contributor
|
Congratulations, your PR was merged at fd6ed9a. Thanks a lot for contributing to OCA. ❤️ |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseeds #1760
Ran pre-commit and squashed latest commits that attended comments in previous PR.
@Tecnativa
TT21615
ping @pedrobaeza