Daily updates from Odoo
Monday, October 2, 2023
1 change · master
Code cleanup and technical improvements
This update reorganizes how messaging-related data is stored internally, allowing related information to be set in one step instead of through extra preparation calls. The change should make future development and maintenance of Discuss, chatter, documents, WhatsApp, and related features more reliable without changing day-to-day user workflows.
Original PR description
With this commit, instead of `Record.insert()` before setting
relation with records, we can immediately pass record data.
For example:
```js
message.author = { id: 3, type: "partner", name: "Admin" };
thread.messages.add({ id: 10, body: "some-text-content" })
```
This is supported on all relational fields that define a target
model.
To make this work while drastically avoiding cyclic dependencies
in code, whenever data have to be inserted in relation, they are
pre-inserted with essential data, and then they are fully inserted
after being registered in the relation.
https://github.com/odoo/odoo/pull/136539