-
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] core: fix non-attachment binary fields for web_save
When bin_size=True is in the context, a computed non-attachment binary is incorrectly saved to the database. The row is actually updated with the size of the binary instead of the value itself. This commit fixes the problem by avoiding setting the cache with the bin_size value as dirty. Moreover, the binary size is computed with `pg_size_pretty` for non-attachment binary fields. Also, method compute_value() calls b64decode() on the value that was previously encoded in base64 by _compute_datas(). But _compute_datas() is specific to attachments, and is not used in this case. Thus b64decode() doesn't make sense. These 3 bugs are now covered by testing web_save(), where cache consistency is required. It was first reported for this method. Closes #156673 Co-authored-by: Renaud Thiry <reth@odoo.com>
- Loading branch information
Showing
3 changed files
with
48 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