Daily updates from Odoo
Thursday, October 25, 2018
2 changes · master
Code cleanup and technical improvements
This update renames an internal website redirect field to avoid conflicts with reserved or commonly used field names. It helps improve system stability and maintainability without changing how users manage website redirects.
Original PR description
Part of odoo/odoo#27599 to rename fields named 'type' which may conflict
This change removes unnecessary automatic JSON parsing from a web utility used when reading view definitions. It makes attribute handling more predictable for downstream code, reducing complexity and the chance of inconsistent behavior without changing business features.
Original PR description
The utility function xml_to_json, which is mainly used by the views to parse their arch (from string to xml tree) had a peculiar behaviour: it tried to process some attributes as json. If by chance, these attributes are valid json, then they are replaced by their parsed value. It is difficult to say why it could be useful. Maybe this was done to prevent using pyeval many times later on. But if that is the case, it should be done by the view code and not the utility function (the view can precompute all attributes once). Also, this behaviour is annoying for code later in the chain, which needs to check if what it gets is an object or a string. With this change, attributes are always returned as string (at this point). 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