Tuesday, December 3, 2024
17 changes · 17.0
New functionality added to Odoo
This update incorporates new parameter values for the CP200 salary scale, specifically for the 2024 tax year. This ensures accurate payroll calculations and compliance with Belgian tax regulations within the Enterprise module.
Original PR description
This will add new rule parameter values for 2024 for the CP200 salary scales. Task: 4274766 Forward-Port-Of: odoo/enterprise#73080
Enhancements to existing features
Demo companies now receive demo products with default taxes already set, so sales and accounting examples behave more realistically. The change also keeps exceptions available for special products such as tips or combos where taxes should remain unset.
Original PR description
Right now, when a demo company is created, the demo products do not get taxes in that company. (even in the main company) It is because of https://github.com/odoo/odoo/pull/173803 It is treating however an exception case with tips that if a product does not have taxes in the initial company, we won't give it taxes in the new company. But this means that all demo data won't have taxes unless we put them explicitly at least in one company. That is why we explicitly put the taxes on demo data, but provide some hooks for exception cases like tips (and combo products). 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
This fix prevents an error when a point-of-sale order line has a quantity of zero. It helps ensure orders using manufacturing-related products can be processed without interruption in this edge case.
Original PR description
Before this commit, if the orderline quantity was zero, it would cause a division by zero error when calculating the anglo-saxon price unit. opw-4370055 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
Problem: When a BoM has a different UoM than the product, it will calculate the number of cycles needed for the work order using the product’s UoM. However, during the cycle time calculation, it uses the BoM’s UoM to calculate the number of cycles used in the previous work orders. It then uses this cycle number calculation to calculate the duration of each cycle. This can cause the expected duration for a work order to be calculated incorrectly. Purpose: Changing the cycle time’s calculation
Original PR description
Problem: When a BoM has a different UoM than the product, it will calculate the number of cycles needed for the work order using the product’s UoM. However, during the cycle time calculation, it uses…
Problem: When a BoM has a different UoM than the product, it will calculate the number of cycles needed for the work order using the product’s UoM. However, during the cycle time calculation, it uses the BoM’s UoM to calculate the number of cycles used in the previous work orders. It then uses this cycle number calculation to calculate the duration of each cycle. This can cause the expected duration for a work order to be calculated incorrectly. Purpose: Changing the cycle time’s calculation to use the product’s UoM will make it consistent with the number of cycles calculation on the work order. Steps to Reproduce on Runbot: 1. Create a new storable product. 2. Create a BoM for this product, but set the UoM to Dozens. 3. Navigate to the Operations tab and add an operation. 4. Set the Duration Computation to Compute based on tracked time. 5. Create a manufacturing order and confirm it. 6. Navigate to the Work Orders tab, set the Real Duration to 20:00, and mark it as done. 7. Create a new manufacturing order. 8. Navigate to the Work Orders tab and observe the Expected Duration is 240:00. opw-4239248 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187649
The website link suggestion feature is now properly available when editing links in mass mailing content. This fixes a mismatch where users saw a prompt to search with “/” but the search did not respond, making it easier to add the right links in marketing emails.
Original PR description
Issue: ====== url autocomplete doesn't work in mass mailing Steps to reproduce the issue: ============================= - Install website - Create a new mass mailing - Choose welcome message - Select some text and click on the link icon on the toolbar in the snippets sidebar - You will see the hint of `type / to search ....` - If you type that nothing happens Origin of the issue: ==================== The behavior of autocomplete was added only in website but the hint was added for the linkTools in general. Solution: ========= Patch linkTools to include the behavior too. opw-4318224
This update resolves a problem where email layouts for sign requests weren't correctly translated into the recipient's language. Previously, emails used the sender's language for all content, regardless of the recipient's preferences. Now, emails will consistently use the language specified in the request, ensuring accurate translations and a better user experience.
Original PR description
**Email layout is not translated to targeted sender's language with Sign mails** Impacted versions: - 16.0 - 17.0 - 18.0 Steps to reproduce: 1. Create a partner with language other than the current…
**Email layout is not translated to targeted sender's language with Sign mails** Impacted versions: - 16.0 - 17.0 - 18.0 Steps to reproduce: 1. Create a partner with language other than the current user's language. 2. Create a sign request and send the request to the created partner. 3. The strings from the email layout like Odoo's `Powered By` and `Your Document` (Your Signature Request) are not translated to the partner's language, but translated with the user's language. This differs from the language in the body. Current behavior: Before this commit, the language of the logged in user and the language given in kwargs would be used to translate the content. The email layout would translate to the user language and the body content would use the kwarg's language. This lead to translation discrepancies. Expected behavior: After this commit, only the language given in the kwargs is used and therefore fixing the translations issues. Forward-Port-Of: odoo/enterprise#73784
This update fixes an issue where branch companies couldn't select accounts from their parent company when creating assets. Now, users can choose accounts from the parent company, streamlining the asset creation process and ensuring accurate accounting across the organization. This improves efficiency and data consistency.
Original PR description
**Steps to reproduce:** - Install Accounting - Create a Branch company without COA - Switch to the Branch company - Go to "Accounting / Accounting / Management / Assets" - Create an asset - Try to select an account for "Fixed Asset Account", "Depreciation Account" or "Expense Account" **Issue:** The list is empty. The accounts from the parent company should be proposed. opw-4368887
This update fixes a bug that prevented users from editing the justification field within employee skill assessments. By adding a simple setting, the system now correctly allows editing of this field, ensuring accurate and up-to-date skill evaluations. This improves the usability of the appraisal process.
Original PR description
Added `editable="bottom"` to the tree view of `skill_ids` in the `Skills` tab of the `hr.appraisal` form. This ensures the `justification` field and other tree fields are editable when allowed. Resolves an issue where the `justification` field was rendered as read-only. Steps to reproduce: 1. Go to Appraisal 2. 3. Chose any employee and go to their skills 4. Try to edit the justification field opw-4334153
This update resolves a bug that caused a traceback when updating planning slots without recurrence settings. The fix adds a check to handle cases where recurrence information is missing, preventing errors and ensuring smooth slot updates. This improves the reliability of the planning module.
Original PR description
Currently, a traceback occurs when the user tries to update the planning slot but has no recurrence. To reproduce this issue: 1) Install planning 2) Open any existing Open Shift planning slot 3)…
Currently, a traceback occurs when the user tries to update the planning slot but has no recurrence. To reproduce this issue: 1) Install planning 2) Open any existing Open Shift planning slot 3) Enable the `repeat` and update the start and end date 4) Give the edit value as `All shifts` and make sure the resource be empty 5) Save the record. Error:- ``` IndexError: tuple index out of range ``` Here the `resource` is not required in planning slot. So, when the user tries to update an open shift with the `repeat` enabled and `resource_update` as `all`, it leads to a traceback from the below line. https://github.com/odoo/enterprise/blob/64fc38a80520cfeeb81c0bb329c6b24c3e9454e1/planning/models/planning.py#L866-L871 This is because when there is no `recurrence_slots` in the slot, we get an empty recordset for the `recurrence_slots`, which leads to the above traceback when trying to extract a value from the recurrency_slots. We can resolve this issue by adding an extra check of `recurrence_slots` which makes the code more robust. sentry-6096445646
### Context: In its current form, the HTTP route using `/rate/<string:token>/<int:rate>`, that is used in URL links generated by emails asking for customer feedback, will have a "one-click write" behavior that commits the rating encoded in `<int:rate>`. So the record is already updated with the new value. Only then renders the feedback submit Form, where the user can change their preselected rating and leave a commentary before submitting it via a POST request. Over the last years email prov
Original PR description
### Context: In its current form, the HTTP route using `/rate/<string:token>/<int:rate>`, that is used in URL links generated by emails asking for customer feedback, will have a "one-click write"…
### Context: In its current form, the HTTP route using `/rate/<string:token>/<int:rate>`, that is used in URL links generated by emails asking for customer feedback, will have a "one-click write" behavior that commits the rating encoded in `<int:rate>`. So the record is already updated with the new value. Only then renders the feedback submit Form, where the user can change their preselected rating and leave a commentary before submitting it via a POST request. Over the last years email providers and third party services will preemptively crawl URL in emails to verify if they are "dangerous" (e.g. Microsoft's Safe link and Defender fatures). By doing so, the rating for the records will be set to the last clicked URL using the above HTTP route, without any input from a human user. It will be creating a number of false positive or negative ratings that do not represent the real satisfaction of the surveyed customer. ### Proposed solution: We are removing the implicit "one-click write" behavior of the route and favoring the Form submission expecting human input. This will increase the likelihood a given rating was the result of the customer clicking on the link and taking the time to leave a feedback, versus random inputs from URL bots. ### Future outlook: With the ever-changing landscape of URL crawler bots, trying to develop counter measures to identify and flag bot behavior is possible, but would add immense overhead and maintenance cost of the code for an arguably minor feature, i.e. the customer can rate the ticket by just clicking the picture in the email. Other methods to make these routes more resilient to URL crawlers might be revisited in the future, but for the short-term this seems like a sufficient solution to the unwanted behavior. FW fixes: - updated test to match new sub test approach OPW-3411799 OPW-4292166 Task-4353243 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187373
This change improves the invoice report by making the partner type label dynamic. It ensures that the label adapts correctly, enhancing flexibility and accuracy. **Description of the issue/feature this PR addresses:** The partner type label in the invoice report was previously static, which caused inconsistencies in cases where the label needed to reflect different partner types dynamically. **Current behavior before PR:** The partner type label in the invoice report is hardcoded, which
Original PR description
This change improves the invoice report by making the partner type label dynamic. It ensures that the label adapts correctly, enhancing flexibility and accuracy. **Description of the issue/feature this PR addresses:** The partner type label in the invoice report was previously static, which caused inconsistencies in cases where the label needed to reflect different partner types dynamically. **Current behavior before PR:** The partner type label in the invoice report is hardcoded, which does not adapt to specific partner configurations or custom scenarios. **Desired behavior after PR is merged:** The partner type label in the invoice report is dynamically computed based on the partner's type, ensuring it reflects the appropriate value for each invoice context. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#188696
In odoo#130825, we prevented the import of records that are given an XMLid that belongs to an Odoo module, because such records would be unlinked when the module is updated. However, if the XMLid has noupdate set to True, then the record will not get unlinked anyway when the module is updated, so we should not block it from being creataed. This is useful because there are cases where during an import, `_load_records` is called again by the business code. For example, in 17.0+, when impo
Original PR description
In odoo#130825, we prevented the import of records that are given an XMLid that belongs to an Odoo module, because such records would be unlinked when the module is updated. However, if the XMLid has noupdate set to True, then the record will not get unlinked anyway when the module is updated, so we should not block it from being creataed. This is useful because there are cases where during an import, `_load_records` is called again by the business code. For example, in 17.0+, when importing a chart of accounts on a new company, the import of the opening balances causes a new 'Unaffected Earnings' account to be created via `_load_records`, with `noupdate=True`.[^1] [^1]: https://github.com/odoo/odoo/blob/a73e45ff9459ffdc0128327fac47962c6fe27af7/addons/account/models/company.py#L473 task-none runbot-108001 Forward-Port-Of: odoo/odoo#185030
### Steps to reproduce: - Inventory > Configuration > Warehouse Management > Warehouses - Create a second warehouse - Go to Inventory > Products > Products - In the search bar type `foo` string > Search Warehouse for `foo` - Click on any product Kandan record - Click on the Forecast smart button of the product #### > Traceback ### Cause of the issue: Thanks to the dummy `warehouse_id` field of the `product.template` model a `warehouse` context key can be set in the context from th
Original PR description
### Steps to reproduce: - Inventory > Configuration > Warehouse Management > Warehouses - Create a second warehouse - Go to Inventory > Products > Products - In the search bar type `foo` string >…
### Steps to reproduce: - Inventory > Configuration > Warehouse Management > Warehouses - Create a second warehouse - Go to Inventory > Products > Products - In the search bar type `foo` string > Search Warehouse for `foo` - Click on any product Kandan record - Click on the Forecast smart button of the product #### > Traceback ### Cause of the issue: Thanks to the dummy `warehouse_id` field of the `product.template` model a `warehouse` context key can be set in the context from the search bar: https://github.com/odoo/odoo/blob/a72763acfc4d83ae2aadad2e807547c5b1819002/addons/stock/models/product.py#L685 https://github.com/odoo/odoo/blob/a72763acfc4d83ae2aadad2e807547c5b1819002/addons/stock/views/product_views.xml#L78 This trick is notably used in order to take the warehouse into account in the computation of the various quantity fields associated to products by generating custom location domains: https://github.com/odoo/odoo/blob/a72763acfc4d83ae2aadad2e807547c5b1819002/addons/stock/models/product.py#L136-L137 https://github.com/odoo/odoo/blob/a72763acfc4d83ae2aadad2e807547c5b1819002/addons/stock/models/product.py#L250-L255 However, since that context key was added via the search bar, it type might be: a string, an integerId or a list of either/both other types. (E.g. to create a list of a string and integer type and select a string and then type a string allowing you to find a real warehouse id that you can select after clicking on the dropdown arrow). Therefore, in order to be properly used, this context key needs to be parsed to be used properly as done in the `_get_domain_locations` for instance. However, the `warehouse` context key is used at many other places in the code, each time expecting a single integer id, and since the warehouse context key is not cleaned from one action to an other you are technically able to provide a string where the code is expecting a an integer. ### Fix: The proper fix of this use case would be to change the context key name used by the search view to only match flows expecting such a context. However, this change is not stable as it requires to modify a view and hence can't be applied before master (18.1). As such, in prior versions, we add a context parser for to extract a single integer id from the `warehouse` context key where it is used but unexpected to match something else. ### Note: This patch will improve other fixes and hopefully prevent yet unoticed error raised by this issue: 903d8beeea5d332e556ef81e231a3b8b4c51cd45 and afa7c6bf25c9de5fc0c878faa29e1cc35bc11805 Enterprise: https://github.com/odoo/enterprise/pull/74188 opw-4290818 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187413
Before this commit, when an error happens on a serial device, the serial driver on the IoT box permanently sets its status to ERROR. This in turn leads to the user-facing app returning a failure status back to the user, even for sucessful subsequent operations. This is particularly problematic, for example in the special case of BlackBox BE, where some points of sales have multiple checkouts using the same POS session and the same IoT Box + BlackBox. If at any point, a cashier sent an erroneo
Original PR description
Before this commit, when an error happens on a serial device, the serial driver on the IoT box permanently sets its status to ERROR. This in turn leads to the user-facing app returning a failure…
Before this commit, when an error happens on a serial device, the serial driver on the IoT box permanently sets its status to ERROR. This in turn leads to the user-facing app returning a failure status back to the user, even for sucessful subsequent operations. This is particularly problematic, for example in the special case of BlackBox BE, where some points of sales have multiple checkouts using the same POS session and the same IoT Box + BlackBox. If at any point, a cashier sent an erroneous message to the IoT Box or to the Blackbox, all checkouts would become blocked, with the only alternative being to reload the handlers or restart the IoT Box. Furthermore, the subsequent actions appearing as refused may have executed successfully. Which means there would be a mismatch between the data stored in Odoo (multiple failed transactions) and the data sent to the SPF (one failed transaction, then many successful ones). After this commit, the driver status is reset after being sent once. That way, when a new action is sent from the client to the IoT box, it's the status of the execution of this action and not the previous one that gets sent back to the client. opw-4313538 opw-4182434 opw-4293988 Forward-Port-Of: odoo/odoo#186735
Versions -------- - 16.0+ Steps (18.0+) ------------- 1. Have the `account_tax_python` module installed; 2. define a sales tax using "Custom Formula"; 3. define a formula based on `product.standard_price`; 4. have the tax enabled for products in eCommerce; 5. as a Public User, go to the eCommerce page. Issue ----- > 403: Forbidden Cause ----- Commit de302c2 changed the way company dependent fields are handled. Instead of computing them via `_compute_company_dependent`, they
Original PR description
Versions -------- - 16.0+ Steps (18.0+) ------------- 1. Have the `account_tax_python` module installed; 2. define a sales tax using "Custom Formula"; 3. define a formula based on `product.standard_price`; 4. have the tax enabled for products in eCommerce; 5. as a Public User, go to the eCommerce page. Issue ----- > 403: Forbidden Cause ----- Commit de302c2 changed the way company dependent fields are handled. Instead of computing them via `_compute_company_dependent`, they are now stored in the database. Before this this change, any `groups` restriction added to a field wasn't actually checked. After this change, it does get checked, leading to the 403 error. Solution -------- When computing taxes, pass `product` with `sudo` to ensure access to all necessary fields. opw-4354321 Forward-Port-Of: odoo/odoo#189186
The demo failure stores the latest traceback when a failure happens. This does not always work well, for example when installing a chart template. In such cases, the only error given will be a generic parsing error pointing to the xml file triggering the call to try_loading, making it difficult to understand the exact issue. As this notification is intended for a developer in order to help investigating the error, a complete traceback would be better. This small change will instead use t
Original PR description
The demo failure stores the latest traceback when a failure happens. This does not always work well, for example when installing a chart template. In such cases, the only error given will be a generic parsing error pointing to the xml file triggering the call to try_loading, making it difficult to understand the exact issue. As this notification is intended for a developer in order to help investigating the error, a complete traceback would be better. This small change will instead use the traceback module to format the exception stored in the demo failure todo, which will give information about the exact cause of the issue. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189259
**Problem**: When invoking a callback after a hotkey press (e.g., `Alt + B`), the following code: https://github.com/odoo/odoo/blob/bafa915f85fb8fc6ca2ae7d194a4593cb2463c2e/addons/web/static/src/core/hotkeys/hotkey_service.js#L286 fails to save the record. **Solution**: Instead of focusing directly on the `el` element, `blur` the `activeElement` to be sure that any changes are saved. **Steps to reproduce**: 1. Open any sale order. 2. Edit the *Terms and Conditions* field. 3. Press `
Original PR description
**Problem**: When invoking a callback after a hotkey press (e.g., `Alt + B`), the following code: https://github.com/odoo/odoo/blob/bafa915f85fb8fc6ca2ae7d194a4593cb2463c2e/addons/web/static/src/core/hotkeys/hotkey_service.js#L286 fails to save the record. **Solution**: Instead of focusing directly on the `el` element, `blur` the `activeElement` to be sure that any changes are saved. **Steps to reproduce**: 1. Open any sale order. 2. Edit the *Terms and Conditions* field. 3. Press `Alt + B` while the input is focused. 4. Observe that the changes are not saved. opw-4219357 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#185960