Daily updates from Odoo
Thursday, November 29, 2018
5 changes · master
Enhancements to existing features
This change makes it easier to diagnose problems in automated server actions by producing clearer error details that point to the specific failing action and line. It also improves developer consistency by supporting a unified variable name while keeping existing names compatible, reducing troubleshooting time without changing normal business workflows.
Original PR description
Problem 1: It was completely impossible to debug a server action using pdb (or any other python debugger for that matter), in order for pdb to work properly it must read the file that it's supposed…
Problem 1: It was completely impossible to debug a server action using pdb (or any other python debugger for that matter), in order for pdb to work properly it must read the file that it's supposed to debug from disk, since the code for server actions is executed from memory with safe_eval, pdb can't display any relevant information of the code being debugged. Problem 2: Tracebacks for safe_eval'd code were pretty useless, since all they would do would be display the entire code that failed execution in raw format (single-line), this is obviously very hard to debug and offers absolutely no insight into which server action broke or where and why did it break. Solution 1: Before compiling code that is supposed to be safe_eval'd, we create a temporary file, this temporary file can have a suffix containing information of the location of the code (e.g. '_server_action_<id>') and where it should be stored (filestore location recommended), this file will contain the server action code (or any code being safe_eval'd) so that it can be debugged. This information must be passed explicitly from the calling code to safe_eval, through a context argument which is a dictionary with `fname` and `filestore` as keys, the former being an indication of the calling code (e.g. '_server_action_<id>') and the latter being the current db's filestore, so as to avoid file conflicts. After the code is executed, the file is destroyed from the filesystem. Solution 2: Thanks to solution 1, the traceback will print out the corresponding error message and the name of the file which ideally should contain information about the calling code (e.g. 'File ~/.local/Odoo/filestore/my_db/tmphHfj53j_server_action_55') as well as the line inside the code that triggered the traceback, effectively indetifying where the code broke. This commit also merges the `record` and `records` variables available in server actions into a single variable `self`, so that server action development is more consistent with native Odoo development, however both record and records are still kept for backwards compatibility. ~~This commit also adds the possibility to call pdb.set_trace() from within a server action by simply calling `pdb()`, to be reviewed later to support multiple debuggers (py37's breakpoint() comes to mind).~~ Task ID: 54014 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Purchase users who are also billing managers can now create or edit payment terms directly while working on a purchase order. This removes extra navigation through accounting menus and makes purchase order setup faster and smoother.
Original PR description
Task - https://www.odoo.com/web?#id=1868555&action=327&model=project.task&view_type=form&menu_id=4720 Pad - https://pad.odoo.com/p/r.460781e616941799b97e229e52a67cb2
Stock and delivery screens now show weights using the company’s configured unit instead of always showing kilograms. Several field labels were also clarified, making warehouse and delivery information easier for users to understand.
Original PR description
<b>Task: </b> https://www.odoo.com/web?#id=1895297&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720 <b>Pad: </b>https://pad.odoo.com/p/r.ebc07031e83dbc5b5da71f06c14506e1 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
Resolved issues and error corrections
Uninstalling Studio now also removes customizations created with Studio, preventing leftover custom models, views, and reports. Users will see clearer uninstall warnings that identify custom model records to be deleted and indicate affected custom views and reports before proceeding.
Original PR description
With this commit, customizations done with `web_studio` will be uninstalled whenever `web_studio` is uninstalled. To help prevent surprises, the uninstall modal will show users records of custom models that will be deleted as well as a warning message and indication of custom views and reports.
This update fixes a crash in the project overview caused by a renamed field being referenced incorrectly. Users can now open the affected project overview without interruption, restoring normal visibility into timesheet and forecast sales information.
Original PR description
Since 0eecc8ba654b1856fbf93f09f22db6e4bcceb94a, all type fields has been renamed, bu this also introduced some mistake, like crashing the project overview since it now use a undefined dict-key. This commit fixes it. Simply.