Thursday, March 7, 2024
1 change · master
Resolved issues and error corrections
Opening a linked resource from the Documents inspector no longer causes an error. This helps users access related records from documents without interruption.
Original PR description
**Steps to reproduce:** - Select a document to open the document inspector.(say Employment Contract.pdf) - Click on the resource link of that document.(located below folder) **Issue:** When a user…
**Steps to reproduce:**
- Select a document to open the document inspector.(say Employment Contract.pdf)
- Click on the resource link of that document.(located below folder)
**Issue:**
When a user tries to open a document resource from the documents inspector, it leads to a traceback.
**Cause:**
The issue has been faced since https://github.com/odoo/odoo/pull/149906/commits/bc4ebf44e224a9e4dec0c924f835af52086ba4b6 as it introduces some code to handle the fields of type "many2one_reference" in 'utils.js', thus changing the returned value in case of res_id.
(i.e. Instead of simply returning the 'value' of resId, it returns an object { resId: value })
As a result, validateProps throws an error due to an invalid type of res_id received.
**Fix:**
This commit tweaks the arguments of the orm call in `onClickResModel` method to ensure that the res_id passed
is of type 'number'.
Task: [3764083](https://www.odoo.com/web#id=3764083&menu_id=4722&cids=2&action=333&active_id=10888&model=project.task&view_type=form)