Monday, May 4, 2020
2 changes · master
Resolved issues and error corrections
This fix stops users from saving an action configuration that lists the same view type more than once. It prevents a web client crash that could make the interface unusable when opening affected Inventory transfer screens.
Original PR description
Description of the issue/feature this PR addresses: * connect to runbot with debug mode enabled * go to Inventory -> Operations -> Transfers * using the debug mode, edit the action and set the view mode to "tree,kanban,calendar,tree" * go back to the main menu, press Ctrl-F5 to force reload * go to Inventory -> Operations -> Transfers Current behavior before PR: You get a crash and the web client becomes unusable (can't click anywhere) Desired behavior after PR is merged: It is not possible to save the action with twice "tree" in view_mode. This is reported as OPW 2241415 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixed an issue where interface views loaded from files in developer XML mode could appear untranslated. This keeps the user experience consistent across normal and developer modes, while avoiding accidental storage of translated view definitions.
Original PR description
When computing the `arch` from the arch_db, the field gets translated as a matter of course as `arch_db` is a stored field with a translation method. This means `arch` is assumed to be in the proper…
When computing the `arch` from the arch_db, the field gets translated as a matter of course as `arch_db` is a stored field with a translation method. This means `arch` is assumed to be in the proper language in the cache. However when reading from the filesystem this is not the case, and the view XML ends up untranslated:  (left is without dev=xml, right is with) Fix the issue by applying the translation function from arch_db onto the stuff we got from the filesystem. Note: under the assumption that we *do not* want to store translated archs in arch_db, explicitly set the lang to None when resetting views. For `_compute_arch_diff` however I left it in place, such that the diff is in whatever language the user has selected as other `arch` fields are accessed directly. That aside, I don't know how well the view reset thing deals with not being in the default language as arch_prev and friend don't really seem to take language into account. Second half of task 2059557