Saturday, July 16, 2022
2 changes · master
Resolved issues and error corrections
This fixes an internal data consistency issue that could cause searches involving linked records to miss valid results. Businesses benefit from more accurate record lookups and reports in cases where related data has pending updates that have not yet been saved to the database.
Original PR description
Consider two models A and B, where - model A has a many2one_reference field `res_id` with model field `res_model`; - model B has an auto-join one2many field `stuff_ids` to A using field `res_id`; -…
Consider two models A and B, where
- model A has a many2one_reference field `res_id` with model field `res_model`;
- model B has an auto-join one2many field `stuff_ids` to A using field `res_id`;
- the field `res_model` is not flushed on some record.
```
model | A | B
-----------+-------------------+-------------------
memory | res_model = B |
-----------+-------------------+-------------------
database | res_model = NULL | id = 42
| res_id = 42 |
| foo = 'bar' |
```
Now, perform a search on model B that should return record with id=42 by matching some condition on the unflushed record in model A, like:
```py
B.search([('stuff_ids.foo', '=', 'bar')])
```
Before this patch, the search method would not flush the field `res_model`, which causes the method to return incorrect results. This patch fixes the issue by ensuring that searches on one2many fields flush all the fields on which the one2many field depends.This fixes an issue where users saw a placeholder image instead of the actual company logo. Company branding will now appear correctly in the web interface, improving consistency and professionalism.
Original PR description
`odoo.tools._vendor.send_file` is called with the kwargs of `http.send_file`; it raises error and the `http.Stream.from_path` is always called instead. Current behavior before PR: It always shows the placeholder logo rather than the company logo Desired behavior after PR is merged: Show the company logo -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr