Daily updates from Odoo
Navigate
Branch
Saturday, March 16, 2024
21 changes
6 changes
Resolved issues and error corrections
This fix ensures that preparation printers accurately print the details of product variants on receipts, resolving an issue where only the product template name was displayed. This improves kitchen staff's ability to prepare orders correctly, reducing potential errors and improving order fulfillment. The change was implemented as a result of a previous update and includes new tests for variant name and quantity.
Original PR description
Before this fix: Receipts printed with kitchen/preparation printer does not show the details of variants products. Just the product template name. This is ambigious for kitchen as the variant information is generally necessary in order to prepare the order correctly After this fix: Restore the previous behavior regarding the product name used This bug is a side effect of: https://github.com/odoo/odoo/pull/152213 due to the changes to `set_full_product_name` Was also a good occasion to add some tests on the changes name & qty opw-3755391 Forward-Port-Of: odoo/odoo#156390
This update addresses minor discrepancies between Odoo's chart of accounts and the latest Portuguese tax regulations (OCC). The changes ensure Odoo remains compliant with Portuguese accounting standards, specifically for companies under the general regime. This is a routine maintenance fix.
Original PR description
In #87572, the CoA was refactored to follow the regulation for companies under the general regime, which can be found at https://www.occ.pt/fotos/editor2/taxonomiasplanocontas_fev2019.pdf This commit fixes minor discrepancies between our version and the published regulation. Enterprise PR: https://github.com/odoo/enterprise/pull/58387 taskid:3060790 Forward-Port-Of: odoo/odoo#157780 Forward-Port-Of: odoo/odoo#157131
This update corrects a technical issue that prevented custom models inheriting from the mail thread functionality from properly configuring a 'user_id' field. Previously, a specific field type caused an error during message processing. This fix ensures that custom models can correctly define and utilize the 'user_id' field, improving the flexibility of email workflows.
Original PR description
-Step to reproduce: any custom model that inherit from mail.thread then define a field user_id but with type is char and boom error happen at method '_message_get_suggested_recipients' because it always expect 'user_id' to be a many2one field -Solution: need to check the type of 'user_id' also 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 Forward-Port-Of: odoo/odoo#157350 Forward-Port-Of: odoo/odoo#155149
This update resolves a bug where the 'Email' field within website forms didn't appear correctly when using the new OWL date picker. The fix ensures that the 'Email' field is always visible when the associated date field is populated, eliminating a previous requirement to add text to the 'Name' field. This improves the user experience by ensuring consistent form functionality.
Original PR description
Steps to reproduce [17.0+]: - Create a website form of any type in which you have: - One "Name" or other text field. - One field with the "Date" type. - One field "Email" with the visibility…
Steps to reproduce [17.0+]:
- Create a website form of any type in which you have:
- One "Name" or other text field.
- One field with the "Date" type.
- One field "Email" with the visibility condition: "Only visible if"
a field of type "Date" "Is set".
- When you complete the "Date" field, the "Email" one should show but it
does not > It shows if you also add at least two characters to the text
field.
Starting from [1], an OWL date picker component was introduced mainly to
replace the use of `TempusDominus` and `DateRangePicker` libraries.
After this change, an adaptation (from [2]) was done to completely
replace every usage of `TempusDominus` with the new OWL component
(including the form date[time]picker fields).
One of the lost features from `TempusDominus` was the trigger of an
"input" event on date [time] change, which also triggers the form field
visibility check.
The goal of this commit is to fix this behaviour by simply updating
fields visibility on every component value change.
[1]: https://github.com/odoo/odoo/commit/b5794e89e1ad29e2a86c7ddaf241e3fc24654b5f
[2]: https://github.com/odoo/odoo/commit/910897fc97d87b08f01627094ec8c159f5267628
opw-3778129
Forward-Port-Of: odoo/odoo#157328This update fixes a discrepancy between the printed sale order report and the customer portal preview. Previously, the customer portal only showed the payment term name, but now it accurately displays the payment term note, ensuring consistent information for customers. This improves transparency and reduces potential confusion.
Original PR description
Description: There is a discrepancy between the printed sale order report and the customer preview when it comes to displaying the Payment Terms. On the SO report, Odoo prints the 'note' field, whereas on the preview, Odoo only displays the 'name' field. Desired behavior after PR is merged: Customer preview now matches the printed report by displaying the payment_term.note field as well opw-3790997 Forward-Port-Of: odoo/odoo#157475
This update corrects a potential issue where users could accidentally select incorrect payment method lines when creating payments. The fix prevents outdated values by validating the payment method selection, ensuring data integrity and accurate payment recording. This improves the reliability of financial transactions.
Original PR description
When you create or register a payment, the domain of the payment method lines is based on a computed field dependent of the selected journal. The issue is that the interface isn't blocked when…
When you create or register a payment, the domain of the payment method lines is based on a computed field dependent of the selected journal. The issue is that the interface isn't blocked when waiting for the onchange return. So if the user changes the journal, then select the payment method quickly enough while the onchange is still pending, he will be able to select outdated values. It is a limitation of the js framework, so to avoid the user encoding wrong datas, the fix here is to raise a `ValidationError` telling to re-select the payment method. To reproduce: - create second bank journal, with outbound payment method lines having different names than the ones of the first bank journal (in order to distinct them). - slow down the `_compute_payment_method_line_fields` method - create a vendor payment, switch the journal to the one created and select the second payment method (before the onchange ends). - save the payment. -> The payment has a payment method line from a different journal opw-3587241 Enterprise PR: https://github.com/odoo/enterprise/pull/56602 Forward-Port-Of: odoo/odoo#157872 Forward-Port-Of: odoo/odoo#147583
14 changes
Enhancements to existing features
Appointment Gantt planning now groups bookings by all assigned resources, making it easier to manage appointment types that use multiple resources, such as restaurants with shared capacity. Resource capacity allocation has also been simplified so staff can handle complex bookings more reliably.
Original PR description
We now group the gantt view by appointment_resource_ids to manage appointment type where multiple resources can be chosen for the booking. It is now possible to manage appointment types of restaurant type (aka with manage capacity and multi resources). The field appointment_resource_id on the calendar event is removed as no longer useful. Everything is now managed with the appointment_resource_ids field. The capacity distribution between resources is simplified and takes the shared resources in last. task-3496901
The spreadsheet component was updated to a newer library version, with related tests adjusted to match the change. This helps keep spreadsheet features current and maintainable without introducing a major visible change for users.
Original PR description
…-alpha.8 Adapt test for odoo/o-spreadsheet@171a827c6
Miscellaneous changes
Forward-Port-Of: odoo/enterprise#58716 Forward-Port-Of: odoo/enterprise#58426
Original PR description
Forward-Port-Of: odoo/enterprise#58716 Forward-Port-Of: odoo/enterprise#58426
In Portugal, there are four regimes of regulations, which include a CoA and financial statements: general regime, small companies, micro-companies and non-profits. Regulations are published at https://www.cnc.min-financas.pt/snc2016.html As a result of the refactor in https://github.com/odoo/odoo/pull/87572, the CoA (almost) perfectly follows the general regime regulation. However, the financial reports are not up-to-date. This commit implements the Portuguese Balance Sheet and Profit and
Original PR description
In Portugal, there are four regimes of regulations, which include a CoA and financial statements: general regime, small companies, micro-companies and non-profits. Regulations are published at https://www.cnc.min-financas.pt/snc2016.html As a result of the refactor in https://github.com/odoo/odoo/pull/87572, the CoA (almost) perfectly follows the general regime regulation. However, the financial reports are not up-to-date. This commit implements the Portuguese Balance Sheet and Profit and Loss for companies under the general regime, as defined at pp.42-45, 53-55 of https://www.occ.pt/fotos/editor2/manualapoiosaf-t_1.pdf. The correspondence between account 'Taxonomy Codes' and account codes was taken from https://www.occ.pt/fotos/editor2/taxonomiasplanocontas_fev2019.pdf. Community PR: https://github.com/odoo/odoo/pull/157131 taskid:3060790 Forward-Port-Of: odoo/enterprise#58709 Forward-Port-Of: odoo/enterprise#58387
Bug === When we send a SODA file by email, it is not detected as a SODA file. Technical ========= Since odoo/odoo@82142475f70517045f1fbbd700e202b8dd0a522b the XML files are imported as plain text. But the check for the SODA file check only the mimetype XML. Task-3792364 Forward-Port-Of: odoo/enterprise#58568
Original PR description
Bug === When we send a SODA file by email, it is not detected as a SODA file. Technical ========= Since odoo/odoo@82142475f70517045f1fbbd700e202b8dd0a522b the XML files are imported as plain text. But the check for the SODA file check only the mimetype XML. Task-3792364 Forward-Port-Of: odoo/enterprise#58568
<strike> ## [FIX] l10n_mx_edi: Set "CFDI to public" to true for foreign invoices The field "CFDI to public" is currently only set to true in the domestic to public case (special VAT / Rfc value XAXX010101000). After this commit "CFDI to public" will also be set to true in the XEXX010101000 case. related: task-3731058 </strike> A part of the original PR was reverted and left out in 17.0+ (https://github.com/odoo/enterprise/pull/58522) ## [FIX] l10n_mx_edi: import: fix
Original PR description
<strike> ## [FIX] l10n_mx_edi: Set "CFDI to public" to true for foreign invoices The field "CFDI to public" is currently only set to true in the domestic to public case (special VAT / Rfc value…
<strike>
## [FIX] l10n_mx_edi: Set "CFDI to public" to true for foreign invoices
The field "CFDI to public" is currently only set to true in
the domestic to public case (special VAT / Rfc value XAXX010101000).
After this commit "CFDI to public" will also be set to true in the
XEXX010101000 case.
related: task-3731058
</strike>
A part of the original PR was reverted and left out in 17.0+ (https://github.com/odoo/enterprise/pull/58522)
## [FIX] l10n_mx_edi: import: fix partner creation and detection logic
There are currently the following problems when importing an invoice
with an unknown partner. A new partner is created in this case.
For invoices with an unknown domestic partner (no special VAT values):
- (1) There may be a VAT validation error.
- (2) The "CFDI to public" field (l10n_mx_edi_cfdi_to_public) on the
invoice will be set to True. It should be False.
For invoices with an unknown foreign partner (no special VAT values):
- (3) The partner is created w/o country or VAT value (since only
the special VAT / Rfc value XEXX010101000 is used).
Thus the detection logic applied to the partner to decide
whether we are in the domestic non-public, domestic public or
foreign case does not work correctly.
The issues are solved after this commit by the following changes
- (A) The country is set to Mexico for all created partners that are not
from a foreign invoice (XEXX010101000).
- (B) The detection logic to decide the case is updated.
Also see (C).
- (C) The "Foreign Customers" fiscal position is set for partners
created during the import of foreign invoices.
Note on (B) / (C):
We still want to assume that partners without a country are Mexican
partners. This is done since (many) Mexican users will not set an
explicit country for Mexican customers.
(One would e.g. not put the country for domestic letters either.)
This is why we use the "Foreign Customers" fiscal position (C).
### Details
(1)
Due to the missing country the wrong VAT validation is used.
The same error can be reproduced on a runbot when creating a new
customer without country and VAT DEA040805DZ4
(works after setting the country to Mexico).
(2) / (3)
Due to the missing country on the partner the invoice is wrongly
interpreted as a domestic invoice to public (XAXX010101000).
This leads to the wrong "CFDI to public" value.
### task
task-3731058
Forward-Port-Of: odoo/enterprise#58522
Forward-Port-Of: odoo/enterprise#57516On an IDE (VSCode) with a TypeScript Server. For some reason, it was not possible to have imports suggestion to OWL in enterprise after commit [1]. Our main hypothesis is that, due to commit [1] who points to odoo/addons, import lines in those files are resolved first in the scope of the odoo directory. Consider a file in enteprise: ```js import { registry } from "@web/core"; import { Component } from "@odoo/owl" ``` From the TSServer point of view it needs to resolve `@web` firs
Original PR description
On an IDE (VSCode) with a TypeScript Server. For some reason, it was not possible to have imports suggestion to OWL in enterprise after commit [1]. Our main hypothesis is that, due to commit [1] who…
On an IDE (VSCode) with a TypeScript Server.
For some reason, it was not possible to have imports suggestion to OWL in enterprise after commit [1].
Our main hypothesis is that, due to commit [1] who points to odoo/addons, import lines in those files are resolved first in the scope of the odoo directory.
Consider a file in enteprise:
```js
import { registry } from "@web/core";
import { Component } from "@odoo/owl"
```
From the TSServer point of view it needs to resolve `@web` first, which itself has to resolve `@odoo/owl` in its directory scope, that is, in the scope of odoo community. It then keeps it in cache for later and importantly shadows the one present in enterprise/node_modules. Only then the explicit `@odoo/owl` is resolved with the odoo community's owl module from the cache.
Since that owl module from the cache is not explicitly available in enterprise, there are no imports suggestions.
This commit defines a main.d.ts file that only exposes the community's `@odoo/owl` explicitly. This hypothesis is confirmed by some hints that we discover during debugging:
- delete odoo/nodule_modules in enterprise: @odoo/owl becomes a suggestion again.
- comment the path line of @web/* in enterprise/jsconfig.json, owl is suggested.
- replace the copy of node_modules in enterprise by a symlink to odoo/node_modules, owl is suggested. This last one should also be considered as a valid fix for the current issue, as node_modules in odoo and enterprise *are the same*.
After this commit, owl is proposed for imports in VSCode.
[1]: 62cbb20
Forward-Port-Of: odoo/enterprise#58601Before this commit: - We do not get the prompt to close the YOUTUBE video preview. After this commit: - We get the prompt to close the preview. Task-3748193 Forward-Port-Of: odoo/enterprise#58665 Forward-Port-Of: odoo/enterprise#56812
Original PR description
Before this commit: - We do not get the prompt to close the YOUTUBE video preview. After this commit: - We get the prompt to close the preview. Task-3748193 Forward-Port-Of: odoo/enterprise#58665 Forward-Port-Of: odoo/enterprise#56812
Steps: - Install Timesheets - Click on To validate - Click on Last week Issue: - In grid view ,the highlight on the row doesn't go all the way to the sides Fix: - Modify the scss and java script elements so that the highlight goes all the way of the sides task-3537811 Forward-Port-Of: odoo/enterprise#58681 Forward-Port-Of: odoo/enterprise#49102
Original PR description
Steps: - Install Timesheets - Click on To validate - Click on Last week Issue: - In grid view ,the highlight on the row doesn't go all the way to the sides Fix: - Modify the scss and java script elements so that the highlight goes all the way of the sides task-3537811 Forward-Port-Of: odoo/enterprise#58681 Forward-Port-Of: odoo/enterprise#49102
When creating a batch payment with a sub company, we get an access error. Steps: - Create a company X and a branch Y - Select branch Y - Create and validate a payment P - Create a batch payment with payment P and save -> AccesError: ... "Due to multi company" With this commit, we adapt the domain in the security rule to take the parent company into account. opw-3716721 Forward-Port-Of: odoo/enterprise#58526
Original PR description
When creating a batch payment with a sub company, we get an access error. Steps: - Create a company X and a branch Y - Select branch Y - Create and validate a payment P - Create a batch payment with payment P and save -> AccesError: ... "Due to multi company" With this commit, we adapt the domain in the security rule to take the parent company into account. opw-3716721 Forward-Port-Of: odoo/enterprise#58526
## Steps to reproduce - Install **Payroll**, **Planning** and **Time Off** apps - Create a new working time of 56 hours per week: - Go to **Payroll** app - Go to **Configuration** > **Working Times** - Create a **NEW** working time -named 56 hours/week- that has 7 days (Monday to Sunday), each from **8:00** to **16:00** - Set a time zone of your choice, in my case it Africa/Cairo - Go to **Employees** app and create a **NEW** Employee -named 56 hours/week employee- with the same time
Original PR description
## Steps to reproduce - Install **Payroll**, **Planning** and **Time Off** apps - Create a new working time of 56 hours per week: - Go to **Payroll** app - Go to **Configuration** > **Working Times**…
## Steps to reproduce - Install **Payroll**, **Planning** and **Time Off** apps - Create a new working time of 56 hours per week: - Go to **Payroll** app - Go to **Configuration** > **Working Times** - Create a **NEW** working time -named 56 hours/week- that has 7 days (Monday to Sunday), each from **8:00** to **16:00** - Set a time zone of your choice, in my case it Africa/Cairo - Go to **Employees** app and create a **NEW** Employee -named 56 hours/week employee- with the same time zone as the new working time - Create a new Contract for the newly created employee: - Click on the Contract smart button - Click on **CREATE** - Set the **Contact Start Date** -ex. 1 Feb 2024- - Set the **Working Schedule** to the newly created working time (56 hours/week) - Set the **Work Entry Source** as **Planning** - Set the state of the contract to be **RUNNING** - Create a 10 day planning: - Go to the newly created 56 hours/week employee - Click on the Planning smart button - Click on **NEW** to add a new Shift (example values): - from 20 Feb 2024 - to 29 Feb 2024 - from 8:00 to 16:00 - Click on **PUBLISH** - Go to the newly created 56 hours/week employee. Click on the Work Entries smart button. Set the view as _list_. We now have a planning of 10 days totaling 80 hours. - Create a time off: - Go to the newly created 56 hours/week employee - Click on the Time Off smart button - Click on a day to request a time off -for our example set as 23 Feb 2024- - Go to the **Time Off** app > **Approvals** > **Time Off** - Remove **My Team** filter - Approve the newly created time off - Go back to the Work Entries of our employee - Click on **REGENERATE WORK ENTRIES** - Set the Work Entries in _list_ view - Notice how the duration of the last work entry is **_incorrectly_** calculated: - The 1st entry has 24 hours for 3 days of work (20 Feb, 21 Feb, 22 Feb) which is CORRECT - The 2nd entry is for the time off having 8 hours for 1 day (23 Feb) which is CORRECT - The 3rd entry has **24** hours! although it's for 8 days (24, 25, 26, 27, 28, 29 Feb) totaling **48** hours. There are **24** hours difference (3 days), which actually (3 holidays in my case) ## Investigation #### First, let's see how we reach to recalculating the duration (allocated hours) of the planning slots: - When the work entries are regenerated, the slots durations are recalculated via `_get_duration_batch()` https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/hr_work_entry_contract_planning/models/hr_work_entry.py#L43 more precisely `_get_planning_duration` which recompute the durations by creating new temporary planning slots -notice how we didn't pass the `resource_id` of the slot-https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/hr_work_entry_contract_planning/models/hr_work_entry.py#L29-L36 passing the values from the original slot but the new start and end date. - That triggers `_compute_allocated_hours()` https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L239 #### Second we'll examine three cases: 1. What if the slot has no resource_id ? (This is actually the issue specific to the ticket, the `resource_id` is not passed) - the `planning_slots` will be empty, while the `slots_with_calendar` will have our respective slot which triggers the `if slots_with_calendar:` block https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L242-L248 - As we have no resource, we fall back to the `company_id.resource_calendar_id` which is the standard 40 hours/week https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L269-L271 - We then go into `_get_working_hours_over_period()` which will use the `company_id.resource_calendar_id` as it has no `resource_id` https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L1677-L1679 2. What if the slot has a resource with `flexible_hours = False`? Same as 1 3. What if the slot has a resource with `flexible_hours = True`? - the `planning_slots` will will have our respective slot https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L242-L248 - which will trigger this block https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L249-L252 - going into the `_calculate_slot_duration()` function that has a drawback: - The period is a timedelta object https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L1106 that has days (`period.days`) which is the number of full days in that period and seconds (`period.seconds`) - if the `period.seconds` is not ZERO that means we have a non-full day. - when `max_duration` is calculated we always round up the days by adding 1 https://github.com/odoo/enterprise/blob/2afcea7c129148e9be158adb7728888525547cd4/planning/models/planning.py#L1108 even though `period.seconds` can be 0. in that case we should only take `period.days` into consideration ## The Fix: - By passing the `resource_id` when creating the new temporary slots, we make sure we are dealing with the correct `resource_calendar_id` - The `_calculate_slot_duration()` modification addresses the issue when `resource_id` has `flexible_hours = True` basically if the employee work with flexible hours opw-3662389 Forward-Port-Of: odoo/enterprise#58562 Forward-Port-Of: odoo/enterprise#57205
This commit fixes some access rights errors that were occuring when clicking on buttons that would change the resource_id in the planning front-end or from the planning automatic emails. Behaviour prior to fix: Clicking on "I take it", "I am unavailable" in the front-end or in the automatic planning emails would lead to a planning rights error. Cause: When changing the resource_id from the front-end we do it trough sudo. Apparently, when redirecting the user and fetching the edited slot,
Original PR description
This commit fixes some access rights errors that were occuring when clicking on buttons that would change the resource_id in the planning front-end or from the planning automatic emails. Behaviour prior to fix: Clicking on "I take it", "I am unavailable" in the front-end or in the automatic planning emails would lead to a planning rights error. Cause: When changing the resource_id from the front-end we do it trough sudo. Apparently, when redirecting the user and fetching the edited slot, the env changes, the sudo is lost, and the slot_properties field is recomputed. The access rights error is raised from the re-computation of that field. Fix: We call the field after changing the resource so it is re-computed with sudo. Then, when re-directing, there is no-need for re-computation and thus we don't get an access rights error. task-3793005 Forward-Port-Of: odoo/enterprise#58280
Versions -------- - saas-16.4+ Steps ----- 1. Create a pricelist wich shows discounts; 2. create a SO using this pricelist; 3. add a non-subscription-based product; 4. modify its discount; 5. confirm the SO. Issue ----- The manually modified discount gets overwritten by the pricelist one. Cause ----- Commit 71f15a9af4063bfb960b4706c3f237e69dd28e16 started protecting the discount field in `action_confirm` to protect it from recomputation when a start date would be added. This
Original PR description
Versions -------- - saas-16.4+ Steps ----- 1. Create a pricelist wich shows discounts; 2. create a SO using this pricelist; 3. add a non-subscription-based product; 4. modify its discount; 5. confirm the SO. Issue ----- The manually modified discount gets overwritten by the pricelist one. Cause ----- Commit 71f15a9af4063bfb960b4706c3f237e69dd28e16 started protecting the discount field in `action_confirm` to protect it from recomputation when a start date would be added. This was adequate for earlier versions, but commit 4ac62c700826ce1b38307641f91b7c9ce4f91d54 added a line setting `subscription_state` to `False` for any SO that isn't an upsell or subscription. As this field is also a dependent of `_compute_subscription`, a recompute is triggered. Solution -------- Move the `with self.env.protecting` clause up, before the for-loop which modifies `subscription_state`. opw-3646915 Forward-Port-Of: odoo/enterprise#58437
If a report uses a `custom report handler`, he might not use the default `account.tax.report.handler`. We should instead use the `custom report handler` associated with the report. task-3757417 Forward-Port-Of: odoo/enterprise#58376
Original PR description
If a report uses a `custom report handler`, he might not use the default `account.tax.report.handler`. We should instead use the `custom report handler` associated with the report. task-3757417 Forward-Port-Of: odoo/enterprise#58376
1 change
Enhancements to existing features
Ecuador's tax authority (SRI) updated income withholding tax rates for 2024. This update modifies the existing tax percentages and adds new tax configurations in Odoo to ensure compliance with the latest regulations. Businesses in Ecuador need these changes to accurately calculate and report employee income taxes.
Original PR description
In 2024 the SRI changes income withholding taxes. We update minor data and create new taxes for the new percentages Forward-Port-Of: odoo/odoo#157226 Forward-Port-Of: odoo/odoo#156740