Monday, November 30, 2020
2 changes · master
Enhancements to existing features
This change adds coverage to ensure the system handles missing external identifiers correctly during inheritance-related module loading. It helps reduce the risk of hidden setup or upgrade issues in dependent modules.
Original PR description
Task: 2235368
This update introduces a clearer, standardized way for developers to manage linked records behind the scenes while keeping existing integrations compatible. It improves code readability and maintainability across core areas and the Mail app, reducing the chance of mistakes in future changes.
Original PR description
One2many and Many2many use a special "command" to manipulate the set of records stored in/linked to the field. There is a total of 7 commands: create, update, delete, unlink, link, and set. * The…
One2many and Many2many use a special "command" to manipulate the set of records stored in/linked to the field. There is a total of 7 commands: create, update, delete, unlink, link, and set. * The **create** command (id: 0) is used to create a new record in the related model and to link it in the current record. * The **update** command (id: 1) is used to update the targeted record id with new values. * The **delete** command (id: 2) is used to both remove the target record id from the related table and to remove its link from the current record. * The **unlink** command (id: 3) is used to remove the link to the targeted record id from the current record. * The **link** command (id: 4) is used to link the targeted record id which exists already in the related model in the current record. * The **clear** command (id: 5) is used to empty the list of linked record ids. * The **set** command (id: 6) is used to replace the list of linked record ids with the provided. Each command is a tuple with up to 3 elements, the second and/or third element is ignored when it is not applicable to the command: * the mandatory command identifier * the targeted record id (1, 2, 3, 4) * create/write values dictionary (0, 1) or target record ids (6) -- Before this contribution, the several commands did not have a standardized name, the tuples were just hard-coded with the integer identifier. For long developers have been complaining the commands were hard to write and hard to read mainly due to the meaningless integer. This contribution provide a new namespace with the constants and functions desired to ease writting and reading the x2many commands. All modules have been updated to use the new constants instead of the integer identifier. Task: 2366606 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr