Daily updates from Odoo
Navigate
Branch
Thursday, November 29, 2018
12 changes
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
This change improves the efficiency of record filtering by allowing operations to stop once the needed result is found. It can reduce unnecessary processing in common internal workflows, helping the system respond faster without changing user-facing behavior.
Original PR description
Hi guys
This commit is to improve speed in some filtered operations.
- when you need to select only one record, it is better to stop the loop when you have find one. Replace `self.filtered(func)[:1]` by `self.filtered(func, limit=1)`.
- when you use filtered to get a boolean :
```
if self.filtered(func):
return ....
```
you don't need to compute the condition for all records, you can add `limit=1` and `count=True`
what do you think ?
@odony
@alnslang
@Yenthe666
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prPurchase 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
Purchase orders will now show the billing status as "Fully Billed" instead of "No Bill to Receive" when invoicing is complete. This makes the status easier for users to understand and better reflects the actual business state of the order.
Original PR description
Task: https://www.odoo.com/web#id=1857963&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720 Pad: https://pad.odoo.com/p/r.227bf37c690c32e1719a8eb87ceb27ee 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
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
The Quality Control Points form has been reorganized so its tabs appear in a more logical order. This makes the screen easier to navigate for users setting up or reviewing quality checks, reducing friction in day-to-day quality management.
Original PR description
Task: https://www.odoo.com/web?#id=1895297&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720 Pad: https://pad.odoo.com/p/r.ebc07031e83dbc5b5da71f06c14506e1
Resolved issues and error corrections
This corrects an internal import issue that could cause delete instructions in XML data files to fail. The affected use was rare, so the practical impact is limited, but it helps keep system updates and data loading reliable.
Original PR description
_tag_delete was not properly converted when tag handling's calling convention was modified in 4d581e26c2c30a53c41fcdc89d42c79e9ba1ef2f, so `<delete>` tags don't work anymore. There's only one left in master so the impact was limited, though it's a bit strange it didn't blow up runbot.
This update ensures the Tax Amount column appears correctly on printed invoice reports when sections are enabled in Sales settings. It helps users see tax details consistently, avoiding confusion in customer-facing documents.
Original PR description
Issue: https://www.odoo.com/web?#id=1814954&view_type=form&model=project.task 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
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.
Code cleanup and technical improvements
Odoo has removed old compatibility code that was only needed while supporting both Python 2 and Python 3. This simplifies the codebase and supports the platform’s move fully onto Python 3, with little direct impact on everyday users.
Original PR description
We can now proceed along our transition path to Python 3 - and get rid of all the shims and helpers that were only needed for dual-compatibility. Corresponding Enterprise PR: https://github.com/odoo/enterprise/pull/3036
This update removes outdated Python 2 compatibility code across several Enterprise apps, keeping the platform aligned with modern Python 3 standards. It also restores email validation support for CRM scoring when the required validation library is available, improving reliability for lead handling.
Original PR description
Complement of https://github.com/odoo/odoo/pull/28519