-
Notifications
You must be signed in to change notification settings - Fork 23k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] product: make cache invalidation more specific
Some aggressive cache invalidation in the middle of method write() where the model has children models (in the _inherits sense) causes very nasty errors that are hard to fix. Consider two models A and B, where B inherits from A. Also consider two fields a1 and a2 on A, which are thus both inherited by B. Now take a record from model B, and update both fields as: record.write({'a1': ..., 'a2': ...}) As both fields appear as related fields on model B, the method write() puts all values in cache, then it proceeds to call the inverse method of both fields. The inverse method of a1 is called, and this writes on the parent record. Now imagine that some override on A invalidates the whole cache. When the inverse method of a2 is called, the field's value on B has been invalidated, and this therefore writes the value False on the record's parent. This patch removes and adapt such cache invalidations: - Since 4b1cb41, the cache invalidation in method write() of product.product is no longer necessary. - The cache invalidation in method write() of product.pricelist.item has been made more specific: it only invalidates the field that needs to be recomputed. Fixes #76946, #77042 closes #82933 Opw: 2657461 X-original-commit: 3c8a6e7 Signed-off-by: Raphael Collet <rco@odoo.com>
- Loading branch information
Showing
3 changed files
with
54 additions
and
7 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
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