Daily updates from Odoo
Monday, July 22, 2024
13 changes
4 changes
Resolved issues and error corrections
This fix adds the missing CRM lead model definition needed by related enterprise test cases. It helps ensure CRM-related automated tests run reliably and supports smoother validation of enterprise CRM functionality.
Original PR description
Purpose of this PR: Test cases of the `crm_enterprise` require definition of `crm.lead` model. Defining the model to match the dependency Part of task:[3818666](https://www.odoo.com/odoo/project/1519/tasks/3818666?cids=2) Related Enterprise PR: https://github.com/odoo/enterprise/pull/62256
Users can now leave Discuss channels without seeing an error. The system removes the leaving user from the channel before sending the departure notification, preventing the message from being sent back to them.
Original PR description
**Current behavior before PR:** when leaving discuss channel from discuss it results in error because leave notification is send to the leaving person itself. **Desired behavior after PR is merged:** The issue was resolved by replacing the logic. Now, before sending a notification to the channel, we remove the channel member and the channel itself from the thread of the person leaving. task-3893498 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The French accounting localization module name was changed from l10n_fr to l10n_fr_account without fixing the module references in the translation files. This commit fixes the module references in the i18n files. The French tax report was not showing the French translation. task-3986901 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Original PR description
The French accounting localization module name was changed from l10n_fr to l10n_fr_account without fixing the module references in the translation files. This commit fixes the module references in the i18n files. The French tax report was not showing the French translation. task-3986901 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fixes an unreliable automated test around messaging subscription updates. It helps keep quality checks stable by correctly handling cases where subscriptions are removed, reducing false test failures during development.
Original PR description
Before this PR, the "bus subscription updated when joining locally pinned thread" test was sometimes failing. Internally, it uses the waitForChannels helper, which was rewritten in [1] to handle subscription updates before the helper is called. However, the helper only works for channel addition, not deletion. The helper only works in this case due to a race condition. This PR fixes the helper to properly handle deletion. runbot-65320 [1]: https://github.com/odoo/odoo/pull/168438
5 changes
Resolved issues and error corrections
Salary rules that depend on a payslip input will now be displayed correctly, even when their payment amount is calculated another way. This prevents valid payroll rules from being hidden and helps ensure payslips are computed as expected.
Original PR description
Issue: If you create a salary rule with a condition based on an input but with something else than input for the amount, the rule will not be shown. Expected: The rule should be shown if the input is present in the payslip and the computation should happen normally. Fix: When checking if the rule should be shown or not, we were looking at the wrong field that is related to the amount and not the condition.
Fixes an installation error in the Swedish Point of Sale localization caused by an outdated daily sales report reference. Businesses using Swedish POS can install and use the module without being blocked by this report template issue.
Original PR description
### Steps to reproduce:
- Install pos_l10n_se
- the error `Element '<xpath expr="//div[hasclass('page')]">' cannot be located in parent view`
### Investigation:
- the reason for the error is that the `pos_daily_reports.xml` in `pos_l10n_se` refers to the no longer relevant `report_saledetails` template as it has been updated in [b3a6688a711a9229c7bfca60adf9594ad23a952d](https://github.com/odoo/odoo/pull/171383/commits)A test tour in Website Studio was made more precise so it waits for the right page update before continuing. This reduces false failures in automated checks and helps keep releases stable without changing user-facing behavior.
Original PR description
in tour engine, we listen for mutations in the DOM in order to look for the element pointed to by the "trigger". If it is found, we execute run(). In this tour, the div[name='name_slugified'] element is found even before the textContent modifications have been made. To resolve the problem, simply be more precise in the trigger selector. It should be noted that we can therefore remove the first assertion in run() which amounts to doing exactly the same thing as the trigger.
This update restores the date filter behavior in the Mexican closing reports after a broader reporting change left this module out. Users working with these reports should now see date filtering work consistently with the rest of the accounting reports.
Original PR description
The commit 6fe06c57fa7d4bce9ad9a9df0f773678047b9d06 changed the way the date filter works in the account reports. During the change, it forgot to apply the change to this niche localisation module.
This update corrects several internal filters and default values across multiple Odoo apps so they no longer require unnecessary processing. It should make these screens and automated rules behave more consistently without changing day-to-day workflows.
4 changes
Resolved issues and error corrections
This fix resolves a system crash that occurred when restaurant staff added an empty internal note to a product order in the Point of Sale system. The issue caused the order processing to fail with a technical error. With this fix, empty internal notes are now handled correctly, allowing orders to process smoothly without interruption.
Original PR description
When a customer adds an empty internal note and tries to order the product, a traceback will appear. Steps to reproduce the error: - Open PoS restaurant session - Add any product > Order - Add same…
When a customer adds an empty internal note and tries to order the product,
a traceback will appear.
Steps to reproduce the error:
- Open PoS restaurant session
- Add any product > Order
- Add same product again > Add an empty internal note
- Order
Traceback:
```
KeyError: (3, 'pou', '[]')
File "odoo/http.py", line 2248, in __call__
response = request._serve_db()
File "odoo/http.py", line 1823, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1843, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1821, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1828, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2053, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 220, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 756, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 38, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 34, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 458, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "home/odoo/src/enterprise/saas-17.2/pos_restaurant_preparation_display/models/preparation_display_order.py", line 33, in process_order
res = super().process_order(order_id, cancelled, note_history)
File "home/odoo/src/enterprise/saas-17.2/pos_preparation_display/models/preparation_display_order.py", line 28, in process_order
data = order._process_preparation_changes(cancelled, note_history)
File "home/odoo/src/enterprise/saas-17.2/pos_preparation_display/models/pos_order.py", line 95, in _process_preparation_changes
quantity_data[key_new]["display"] += old_quantity["display"]
```
https://github.com/odoo/enterprise/blob/4077a5e39fba7197d32d5db05171ad9c8f98c392/pos_preparation_display/models/pos_order.py#L95
Here when customer adds an empty internal note, ```quantity_data``` will become empty,
So, it will lead to the above traceback.
sentry-5494183916This fix resolves critical issues with the barcode app when managing inventory across multiple companies. Previously, scanning barcodes would sometimes open operations from the wrong company, create unauthorized records, or trap users in the interface. The fix ensures that barcode operations respect the currently active company and prevents creation of records the user doesn't have permission to access.
Original PR description
**Current behavior:** There are several related bugs when operating in a multi-company environment with the barcode app: *Given:* we have three companies in the selector (A, B, C) where company A is…
**Current behavior:** There are several related bugs when operating in a multi-company environment with the barcode app: *Given:* we have three companies in the selector (A, B, C) where company A is the first/default/primary of the three. ***Case 1: (CompanyB and CompanyC are checked, either can be focused)*** 1) Scanning the barcode for CompanyC's manufacturing operation and then, within the barcode view, scanning a product which belongs exclusively to CompanyB will make it impossible to use the back button (despite the product correctly not being added as a line in the operation). 2) Repeating the setup with a different operation type (e.g., receipt) *will* add the product to the picking but it will not be possible to validate/take out of draft from either the barcode app nor from the backend. ***Case 2: (only CompanyC checked and focused)*** 1) Scanning the barcode for CompanyC's manufacturing operation type will open the barcode operation view for CompanyA's manufacture operation. Products available to CompanyC can be added. Trying to validate the order will cause an access error, however the MO is still created in the backend. 2) Scanning the barcode for either CompanyB or CompanyA's non-manufacturing operations will show an access error dialog, but an (empty) transfer will still be created in the backend for the respective company. --- **Expected behavior:** In case 1, scanning a product which is not available to the current company should not trap the user in the barcode operation view. It should also not add these inaccessible products to a picking thereby making them unable to be validated. In case 2, we should respect the company defined on a manufacturing operation type which corresponds to a scanned barcode. Additionally, it should not be possible to create empty transfers for companies which are not currently checked/active. --- **Cause of the issue:** Problem 1: production records (unlike pickings) cannot be created until a product is added in the barcode view. Because of this different flow, they are created with less context than other operation types and there was no mechanism by which their `company_id` could be inferred. This caused them to use the default value as defined in the `MrpProduction` model (`self.env.company`)- which is problematic in the barcode app, as this field does not actually correspond to the focused/active company. Problem 2: when scanning a picking type from the main menu of the barcode app, the company of the picking type was not getting respected which would cause a new picking record to be created even when the current user/environment did not have permission. --- **Fix:** 1. Create production records using a default `company_id` value informed by their `picking_type_id` rather than the environment 2. In the main_menu barcode scan route, use the current user's allowed company ids (from their cookies) to restrict searchable records 3. When scanning products in a barcode operation view, use the company_id of the opened operation type to restrict the domain of searchable records. opw-3999622
Fixed an issue where the shopfloor display was showing all workcenters instead of only the one selected when opening from a specific workcenter, workorder, or production order. This improvement helps users focus on their relevant work area and reduces confusion when managing multiple production lines.
Original PR description
When opening the shopfloor from a specific workcenter, workorder or production order, only the concerned workcenter should be shown. task-4060857
Fixed an issue where only the first 25 WhatsApp message templates were being synced when users attempted to sync all templates from their WhatsApp Business Account. The system now properly fetches all available templates by requesting up to 200 per page and automatically retrieving additional pages as needed, ensuring users have access to their complete template library.
Original PR description
Only a few templates are fetched when the user tries to sync all the templates from the `WhatsApp Business Account` form view. Problem: The API request used to fetch all templates incorporates pagination. In the current scenario, the next URL to the subsequent page is included in the response, but we are not using it. Also, the limit parameter is not utilized in our API request to restrict the number of templates on a single page. Consequently, by default, 25 templates are received on the first page. As a result, only templates received on the first page are being created or updated(i.e. 25). Solution: The limit to fetch 200 templates on a single page is added to obtain 200 templates in the first request. However, if there are more than 200 templates, the remaining ones will be fetched from the next page. This process will continue in a loop until all templates are received. Task-3903321