Daily updates from Odoo
Wednesday, July 31, 2024
11 changes · 17.0
New functionality added to Odoo
A new electronic invoicing module for Uruguay (l10n_uy_edi) has been added to Odoo Enterprise. This module enables electronic document submission and management for Uruguayan businesses, including support for invoices, currency handling, and compliance with local tax requirements. This expansion allows Odoo to better serve customers operating in Uruguay.
Original PR description
LATAM TASK 1105 ADHOc TASK 34125
Resolved issues and error corrections
This update fixes how Spanish tax reports (libros XLSX) handle pro rata taxes, which are used when companies have mixed deductible and non-deductible VAT activities. The system now correctly calculates deductible tax amounts by only including taxes that have been assigned to a tax grid, rather than including the full tax amount. This ensures accurate tax reporting for Spanish businesses using pro rata tax systems.
Original PR description
This commit implements the functionality to support exporting libros XLSX with some line using a tax of type Prorrata. Prorrata is a fiscal system here in Spain, in which companies who have…
This commit implements the functionality to support exporting libros XLSX with some line using a tax of type Prorrata. Prorrata is a fiscal system here in Spain, in which companies who have activities where they can deduct IVA, and activities where they don´t have that right, the fiscal Agency gives you a formula you can use to simplify the process, and deduct the percentage you get from that formula from the IVA amount of an invoice. For example, on an invoice with tax 21% IVA, from that amount we can apply the prorrata percentage, and get a deductable and non deductable amount. The deductable amount should go to the normal IVA account, and the non deductable should go to the same account as the tax base. To simulate Prorrata tax in Odoo, we can create a new tax with only partial of the tax percentage is applied an account, tax grid, and checked in 'use in tax closing'. When we create invoice/bill with this tax, only those partial amount should be included in the tax_deductible field of the libros XLSX. Before this commit: tax_deductible amount include the full tax amount. After this commit: tax_deductible amount only include the tax amount if the line have a tax grid. task-id: 3955233
This fix resolves a crash that occurred in the Report Editor when users repeatedly reset reports. The issue happened because the system was trying to update the report display before it was fully loaded. The fix ensures the report is completely loaded before attempting to refresh it, preventing the application from crashing.
Original PR description
Steps to reproduce ================== - Go to Accounting > Customer Invoices - Open studio - Switch to the Reports tab - Open the Invoices report - Click on "Reset Report" a few times => Eventually, OdooEditor will crash with an error like `Cannot read properties of undefined (reading 'innerHTML')` Cause of the issue ================== `onIframeLoaded` was called before the default report has been loaded. Solution ======== only update the render key after the report has been reset opw-3821992
This update resolves critical errors that occurred when creating or editing appointment events with missing start dates or when start and end times were identical. Users will no longer experience system crashes when managing appointments with these edge cases, making the appointment scheduling feature more reliable and user-friendly.
Original PR description
ISSUE 1 ======= **Steps to reproduce** 1). Create an event in any appointment type 2). Remove the start date from it -> Traceback occurs **video ref** - https://youtu.be/5NpfiKNdjbc **Technical** in the interval_from_events function when the end time or start time is not defined, it will not be able to unpack the values to their appropriate variables, due to this error occurred. ISSUE 2 ======= **How to reproduce** Step 1) Create an event on resources and set the start time = end time Step 2) Click on the edit button -> Traceback video ref - https://youtu.be/csFkJjO6hMQ **Technical** When we set the start = stop then we won't be able to find the interval so we failed to assign the value of the field due to this traceback occurs. **After this PR** Now traceback will not occur. Task-4010880
This fix resolves an issue where recurring invoices created for subscriptions in company branches were left in draft status due to a mismatch between the invoice company and the deferred accounting entries. The fix ensures that when the automated recurring invoice generation runs, all related accounting records are properly aligned with the correct company, allowing invoices to be successfully created and processed.
Original PR description
Steps to reproduce: - Install Subscriptions - Create a new branch for your main company - Switch to that branch and create a subscription - On the "Company" field set it to the branch - Add a subscription with the new product - Confirm it - Switch to the main company and untick the branch - Schedule action -> "Sale Subscription: generate recurring invoices and payments" - Run it Issues: A traceback is shown in the logs, an invoice is created but left on draft. This is because the deferred moves created is with the main company while the invoice is set to the branch which causes a mismatch. opw-3879384
This fix resolves an issue where the time portion of datetime fields wasn't properly hiding when toggling the "Show time" option in Studio's visual editor. Users can now drag and drop datetime fields into list views and toggle the time display without needing to reset the widget, providing a smoother field customization experience.
Original PR description
After making changes in community PR: https://github.com/odoo/odoo/pull/161705 The datetime widget was not being applied when we dragged and dropped a datetime field from the studio. Steps to reproduce: - Open the Sales module and toggle Studio. - Drag and drop a datetime field into the list view. - Try to tick and untick the Show time option. Observed behavior: When ticking and unticking the show time option, the time part is not hiding before resetting the widget. Expected behavior: The time part should be hidden when we tick and untick the show time option without resetting the widget. After this commit, the datetime widget will be applied when we drag and drop a datetime field from the studio and untick the show time boolean. Task-3698841
Fixed an issue where WhatsApp message templates were not displaying their quality scores when synced from Meta. Previously, all templates defaulted to 'none' quality status. Now when templates are synced, the system properly retrieves and displays the actual quality score assigned by Meta, giving users accurate information about template performance.
Original PR description
Problem: The quality_score field is not received in the response while syncing all the templates. As a result, the default 'none' quality will be applied to all the templates. And the same goes while syncing a single template. It will only be updated when Meta posts a request on the webhook to update the template quality. Solution: The quality_score field can only be received if we explicitly ask for the quality_score field in an API request, But the problem is that only the quality_score field will be received here. Due to this, the API request to sync a single template and multiple templates are modified, and all the basic fields like name, components, language, status, category, and ID are included along with the quality_score field so we receive all basic fields and quality_score field. Task-3908894
This fix resolves a crash that occurred when users tried to add new fields in the Studio form editor for certain views. The issue happened when a form had fields organized in a group without an outer group structure. The fix improves how the system identifies field locations, preventing the "Xpath resolved to nothing" error and allowing users to successfully add fields in these scenarios.
Original PR description
Steps to reproduce ================== - Install account_accountant,web_studio - Go to Accounting > Configuration > Account Groups - Open studio - Switch to the form view - Show invisible elements -…
Steps to reproduce
==================
- Install account_accountant,web_studio
- Go to Accounting > Configuration > Account Groups
- Open studio
- Switch to the form view
- Show invisible elements
- Add a new field before the invisible Company field
=> Error: Xpath resolved to nothing or multiple nodes
Cause of the issue
==================
The xpath props of the StudioHook is the string "null"
The fields of this view are defined inside an InnerGroup but there is no OuterGroup.
```xml
<form><sheet>
<group>
<field .../>
...
</group>
</sheet></form>
```
In the form compiler, when a group does not contain another group, it is an InnerGroup
The form editor compiler uses some `interestingSelector` to compute xpaths.
It assumed that an InnerGroup was always inside an OuterGroup
Solution
========
Since the `:has` selector has not been widely supported for long enough,
we do the equivalent of `:not(field) group:not(:has(> group)) > *` in
javascript to match any group that has no direct group as a child.
opw-4046558Fixed a bug that caused an error when users tried to submit a WhatsApp message template for approval without selecting a category. Previously, the system would crash with a technical error. Now it properly validates the required category field and shows a clear error message if it's missing.
Original PR description
When attempting to create a new template in WhatsApp, leaving the ``Category`` field empty results in an error. Steps to reproduce: - Install the ``WhatsApp`` module - Create a ``WhatsApp Business Account`` - Create a new template and leave the ``Category`` field empty - Click on ``Submit for Approval`` Traceback: ``AttributeError: 'bool' object has no attribute 'upper'`` This error occurs at [1] because ``template_type`` is not found in self. This commit will fix the above error by raising an error if ``template_type`` is not found in self. [1]- https://github.com/odoo/enterprise/blob/d6e3dcc5a37c82a0c1bfc1267c4e088aedfe8632/whatsapp/models/whatsapp_template.py#L512 sentry-5642705166
This fix resolves a system crash that occurred when trying to validate a delivery with a product line that had been reduced to zero quantity. The issue happened because the system attempted to calculate an average product value by dividing by zero, which is mathematically impossible. Now the delivery validation process handles zero-quantity items correctly without crashing.
Original PR description
Steps to reproduce the bug:
- Set up the sendcloud shipping method
- Create two a storable product “P1” and “P2”
- Create a sale order:
- 1 unit of P1 and P2
- add a shipping method: sendcloud
- Confirm the SO > result: a delivery is created
- Update the qty to 0 units of P2
- Go to the delivery and try to validate it
Problem:
A traceback is triggered:
```
File "/home/odoo/src/enterprise/delivery_sendcloud/models/sendcloud_service.py", line 535, in _get_products_values
'avg_value': float(val['tot_value'])/float(val['tot_qty'])
ZeroDivisionError: float division by zero
```
opw-4074859This update resolves a crash that occurred when users attempted to edit certain shipping reports (Shipping Labels and Shipping Documents) in the Web Studio editor. The fix prevents these incompatible reports from appearing in the editor, eliminating the error and improving the user experience.
Original PR description
before commit: while going to edit the report(Shipping Labels and Shipping Documents) this traceback is raised.For preventing from the error adding in rename_black_list to prevent from editing and…
before commit:
while going to edit the report(Shipping Labels and Shipping Documents) this traceback is raised.For preventing from the error adding in rename_black_list to prevent from editing and not showing in editor [these two reports ]( https://github.com/odoo/enterprise/blob/17.0/delivery_iot/report/delivery_carrier_reports.xml#L5-L6)
```
Traceback (most recent call last):
File "/data/build/odoo/odoo/http.py", line 1770, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/data/build/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/data/build/odoo/odoo/http.py", line 1797, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/data/build/odoo/odoo/http.py", line 2001, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/data/build/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "/data/build/odoo/odoo/addons/base/models/ir_http.py", line 222, in _dispatch
result = endpoint(**request.params)
File "/data/build/odoo/odoo/http.py", line 725, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/data/build/enterprise/web_studio/controllers/report.py", line 474, in load_report_editor
report_qweb = self._get_report_qweb(report)
File "/data/build/enterprise/web_studio/controllers/report.py", line 612, in _get_report_qweb
main_qweb.xpath("//*[@id='wrapwrap']")[0]
IndexError: list index out of range
```