Thursday, November 30, 2023
71 changes · 17.0
Enhancements to existing features
Odoo now checks which member details can be set when a new Discuss channel is created. This helps prevent unexpected or unintended member information from being accepted, making channel creation more reliable.
Original PR description
The goal is to prevent users to set unexpected fields for Discuss channel members when creating a new channel.
Attachments for expenses and resumes now get searchable index content, similar to invoices. This makes these documents easier to find and process, improving document management across more workflows.
Original PR description
Previously, the index content of the attachment was only set for invoices, but it can be useful for expenses and resumes as well.
The system now automatically uses xe.com as the default currency rate provider for companies operating in India. This improvement streamlines the setup process for Indian businesses by eliminating the need for manual configuration of currency exchange rate services.
Original PR description
In this PR ======================= Currency rate provider service is set as xe.com as default for the companies in India. task - 3614513
The UPS delivery module's test data has been reorganized by extracting hardcoded XML content and embedded files from the Python code into separate files on disk. This improves code readability and prevents search tools from incorrectly matching test data strings, while maintaining the same test functionality through efficient file loading.
Original PR description
The UPS http server is mocked to always returns mocked XML content. That mocked content was hardcoded inside the python code, which resulted in multiple huge unreadable strings. Because of their…
The UPS http server is mocked to always returns mocked XML content. That mocked content was hardcoded inside the python code, which resulted in multiple huge unreadable strings. Because of their inclusion in python file, global regexp search inside the enterprise repository could match inside those string even if the search excluded non python file. This is the actual motivation of this work, to extract the XML hardcoded document inside XML files on disk so that global text search don't wrongly match those lines. Inside the second XML document entitled "shipment_request.xml" were three assets inlined as very long base64 strings. Those assets have been extracted, base64 decoded and stored on disk in dedicated files. This ease understanding both the content of the XML files and to make it possible to open the assets. The original document (with inlined base64 assets) is reconstructed at runtime. Using `functools.lru_cache` to lazily open and read the files upon first usage, this prevent loading the files in case the test is actually not run, this also loads the files only once for all test cases. Forward-Port-Of: odoo/enterprise#51480
Resolved issues and error corrections
This fix stops the mail thread from accidentally loading more messages than the user requested when returning to a previous scroll position. It improves responsiveness and avoids unnecessary data loading in message conversations.
Original PR description
The IntersectionObserver was sometimes started and called its callback before the scroll was restored, in which case the load more button was always visible, leading to loading more messages than intended. To fix, delay the starting of the visible until the scroll is restored. runbot-35533
Code cleanup and technical improvements
The IoT connection startup flow was simplified by folding an unused helper step into the main process. This reduces internal complexity without changing how users interact with IoT devices.
Original PR description
Previously, there was a function called 'start_client' that was invoked by the 'run' function. As 'start_client' was solely invoked within 'run' and served no additional purpose, its functionality has been incorporated directly into the 'run' function.
Miscellaneous changes
Steps to reproduce: - create a bill - add a product line - add a payment reference - save it - change the payment ref - confirm - register a payment Issue: The memo is not the updated payment reference Cause: The memo is computed by taking in priority the `line.name` https://github.com/odoo/odoo/blob/a39050e15195eb095b3480899cedb5cb458fa6cc/addons/account/wizard/account_payment_register.py#L139-L145 And whenever we change the payment reference, the line.name is not recomputed
Original PR description
Steps to reproduce: - create a bill - add a product line - add a payment reference - save it - change the payment ref - confirm - register a payment Issue: The memo is not the updated payment reference Cause: The memo is computed by taking in priority the `line.name` https://github.com/odoo/odoo/blob/a39050e15195eb095b3480899cedb5cb458fa6cc/addons/account/wizard/account_payment_register.py#L139-L145 And whenever we change the payment reference, the line.name is not recomputed if it has already been set opw-3476835 Forward-Port-Of: odoo/odoo#135923
The project profitability section is now shown only when the required accounting conditions are enabled. This prevents users from seeing financial information areas that are not relevant to their current configuration.
Original PR description
Steps: - Install project & accounting - Open project - Open project.update - There is profitability section - Go to accounting module configuration,settings - Analytic accounting field true or false Issue: - Analytic accounting feature true or false the profitability section always visible in project.update Cause: - There is no condition for profitability section visibility Fix: - Added required conditions for profitability section visibility Task-3484413
Demo documents in Accounting and Recruitment will no longer be sent for OCR processing just because they are opened. This prevents unintended digitization of sample records and keeps OCR use manual for demo data.
Original PR description
Previously, the demo documents were automatically sent to the OCR when opened in form view. It's not what we want, those demo documents should only be sent manually. This happened because, in the demo data, the main attachment isn't set. When reading the document, the attachment previewer would select an attachment as main attachment and, as the OCR relies on the `register_as_main_attachment` hook, it would be sent for digitization. Now, the main attachment is explicitly set in the demo data definition.
Text resized through the website editor now adjusts properly on different devices and screen widths. This helps keep edited website content readable and visually consistent for visitors on phones, tablets, and desktops.
Original PR description
Since [this other commit], we use classes to change the font size of text. Unfortunately, we forgot to make them responsive. This commit fixes that. [this other commit]: https://github.com/odoo/odoo/commit/194f73a9bbad8c3c3fb5c378e7bdfa704aaacdc0 task-3615976
This update adds automated checks for several ways users create links in the web editor, including keyboard shortcuts, typed URLs, toolbar actions, and the command menu. These tests help reduce the risk of future changes breaking link creation workflows.
Original PR description
Current behavior before PR: No test cases were there for dialog box based link creation. Desired behavior after PR is merged: Added Qunit test cases for various scenarios Cases Covered: * Making links with hotkeys. * Typing valid url + space should make link. * Making link with powerbox. * Selecting text and link button on the toolbar. task-3087957
The IoT connection URL is now built using safer JSON formatting instead of manual text assembly. This helps prevent malformed connection data and improves reliability for IoT device communication.
Original PR description
Before, the url was built with string comprehension. Now json.dumps is use to ensure that the JSON sent is valid
This update improves automated checks around creating links in the website editor, including links made from typed URLs, the command menu, and the toolbar dialog. It helps ensure common link creation flows keep working reliably for users while removing reliance on obsolete test coverage.
Original PR description
Specification: -The tests are not testing the actual OdooEditor behavior, but the `editorCommands.createLink()` function (which is not used anywhere). -CreateLink method was a dead code. -No test cases were there for dialog box based link creation. Cases Covered: -typing url + space -powerbox -selecting text and link button on the toolbar task-3087957
Updates Mexican localization tax group records to fix incorrect names and add missing translations. This helps users see clearer, properly localized tax labels in accounting screens and reports.
Original PR description
These changes intend to update current tax group records to fix naming issues and add missing translations.
The course sharing feature now correctly copies the share link to the clipboard. This fixes a small but user-visible issue where learners or visitors could not copy links from the website slides sharing tools.
Original PR description
With this commit 963842381e2449ee59e5cffd1bae8656f5477e7a ClipboardJS was removed to use the native clipboard api. But here the innerText was checked instead of the value so there was nothing to copy in the clipboard. This commit fix this. Task-3607299 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix makes a translation-related test produce consistent results instead of failing randomly. It helps maintain development reliability without changing customer-facing functionality.
Original PR description
The test added in 09a4762b will fail randomly, because of the nondeterministic os.walk access. This commit allows this nondeterminism in the test. 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
A bug prevented accounting dashboard totals for journal entries marked for review from appearing. The fix makes those review counts and amounts display correctly, helping finance teams spot entries that need attention.
Original PR description
This commit fixes the consistency issue missed in https://github.com/odoo/odoo/commit/a9dd388a1128ac406b6a5cec58b3833aadb04c62. Currently, to_check_vals dictionary has journal records as keys. Later, the total amount and count of account moves marked with `to_check` are retrieved by journal.id, which don't exist in the `to_check_vals` dictionary, so `to_check` value is never displayed on the dashboard. That dictionary should contain the actual ids instead. task-3611262 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixes an issue where loading demo data after installing CRM without demo data could fail because the demo user lacked the right sales access. This makes demo data setup behave consistently whether it is loaded during installation or afterward.
Original PR description
How to reproduce: - install a new DB without demo data and crm: -i crm --without-demo=1 - go to settings and click on "Load demo data" at the end of the page - the demo data will not be installed and…
How to reproduce: - install a new DB without demo data and crm: -i crm --without-demo=1 - go to settings and click on "Load demo data" at the end of the page - the demo data will not be installed and the following error will appear in the logs "Assigned user Marc Demo has no access to the document and is not able to handle this activity." - and "Marc Demo" has no access to the CRM app If the "crm" module is installed with the demo data at the module installation, it works and "Marc Demo" has access to the CRM app. The cause of the problem is that in the first case "Marc Demo" doesn't belong to group_sale_salesman while in the second case well. By reverting partially the change that remove the group_sale_salesman by removing group_sale_salesman_all_leads (see odoo/odoo#139731), the problem is solved. Technical note: the load of the demo data as a second step fails when creating an activity on a record for which "Marc Demo" has no access to because in the create method of mail_activity, we check that the user has access to the underlying record (_check_access_assignation). It works when installing the demo data while installing the module because in that case "Marc Demo" belongs to "group_sale_salesman" which give him the read access to the record. The solution here is to just re-add that group where it is removed indirectly by removing the group group_sale_salesman_all_leads from "Marc Demo". Another solution would have been to remove this check (_check_access_assignation) as we don't need it anymore (see odoo/odoo#139917 where we display activities for which the user has no access to the underlying record from the menu in the systray). But it won't solve the consistency between installing the demo data while installing the module vs installing the demo data afterward. That's why this solution has been chosen, but we plan also to remove the check (_check_access_assignation) as it is no longer needed. Note that planning activities from the interface even if the assigned user has no access to the underlying record works because the flag "automated" is set to true in that case (that flag will probably also be removed). Task-3600535
The recruitment kanban card footer now displays its items with consistent vertical alignment. This minor visual fix makes applicant and job cards look cleaner and easier to scan.
Original PR description
The kanban's footer elements were misaligned vertically, specifically the status icon. task-3473010 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Posted demo invoices will no longer be automatically sent for OCR digitization. This keeps the digitization process focused on draft invoices only, avoiding unnecessary processing of invoices that are already finalized.
Original PR description
When checking if an invoice needs to be automatically sent to the OCR, we weren't checking the state of the invoice. Only draft invoices should be sent. In practice, it wasn't much of an issue as new invoices are created in the `draft` state, but for demo invoices, some of them are already in the `posted` state. Those shouldn't be sent for digitization.
This update optimizes the mail enterprise tests by loading data and messages more efficiently. The change reduces redundant loading operations in the attachment preview tests, making the test suite run faster and more reliably.
Original PR description
Test of fix in community commit. https://github.com/odoo/odoo/pull/143867
This update reorganizes imports in the IoT websocket client to follow Odoo coding guidelines. It does not change user-facing behavior, but helps keep the codebase consistent and easier to maintain.
Original PR description
The order of the imports have been changed in websocket_client.py to follow odoo guidelines
Steps to reproduce: ------------------- - go to ecommerce; - click on "Product A"; We see the breadcrumb: All Products / Product A - go to shop page; - go to the category of "Product A"; - click on "Product A"; We see the breadcrumb: All Products / Product A instead of: All Products / Category / Product A Cause: ------ The template used for the breadcrumb is cached. Solution: --------- Use the `t-nocache` attribute to re-evaluate this part of the template each time
Original PR description
Steps to reproduce:
-------------------
- go to ecommerce;
- click on "Product A";
We see the breadcrumb: All Products / Product A
- go to shop page;
- go to the category of "Product A";
- click on "Product A";
We see the breadcrumb: All Products / Product A
instead of: All Products / Category / Product A
Cause:
------
The template used for the breadcrumb is cached.
Solution:
---------
Use the `t-nocache` attribute to re-evaluate this part of the template each time it is rendered.
opw-3582971
Forward-Port-Of: odoo/odoo#1437801) Create + Confirm two MO's for product 2) Merge Confirmed MO's together 3) Mark MO as Done 4) Press Apply on Immediate Production 4a) Stops consumption due to no Components being declared 4b) Would expect the Consumption Warning Wizard to be triggered here to allow use of "Validate & Set Quantities" button It happens due to #85301 the purpose was to avoid the rules from stock.move. However for other functionalities of MO like manual consumption. We would like to keep the standard behavi
Original PR description
1) Create + Confirm two MO's for product 2) Merge Confirmed MO's together 3) Mark MO as Done 4) Press Apply on Immediate Production 4a) Stops consumption due to no Components being declared 4b) Would expect the Consumption Warning Wizard to be triggered here to allow use of "Validate & Set Quantities" button It happens due to #85301 the purpose was to avoid the rules from stock.move. However for other functionalities of MO like manual consumption. We would like to keep the standard behavior. Call the classic action_confirm but after manualy updated the stock.move opw-3577267 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#143369
Prevent error: "[BR-S-10]-A VAT breakdown (BG-23) with VAT Category code (BT-118) "Standard rate" shall not have a VAT exemption reason code (BT-121) or VAT exemption reason text (BT-120)." We should not provide a tax exemption reason for standard rates when the customer is Norvegian. It is not allowed in UBL Peppol Bis 3. no task/no ticket (noticed the error in the IAP logs). Forward-Port-Of: odoo/odoo#144205
Original PR description
Prevent error: "[BR-S-10]-A VAT breakdown (BG-23) with VAT Category code (BT-118) "Standard rate" shall not have a VAT exemption reason code (BT-121) or VAT exemption reason text (BT-120)." We should not provide a tax exemption reason for standard rates when the customer is Norvegian. It is not allowed in UBL Peppol Bis 3. no task/no ticket (noticed the error in the IAP logs). Forward-Port-Of: odoo/odoo#144205
**Steps:** - Open Timesheet - Configuration > Time Encoding > Change Encoding Unit to Days - Now select Reporting > By Employee - When you select Measures, you can see Billable Days and Non-Billable Days - Now select Reporting > By Project / By Task - When you select Measures, you can see Billable Hours and Non-Billable Hours **Issue:** - Even after changing the Encoding Unit from Hours to Days, still we are able to have Measures in Hours instead of Days **Cause:** - Records are
Original PR description
**Steps:** - Open Timesheet - Configuration > Time Encoding > Change Encoding Unit to Days - Now select Reporting > By Employee - When you select Measures, you can see Billable Days and Non-Billable…
**Steps:** - Open Timesheet - Configuration > Time Encoding > Change Encoding Unit to Days - Now select Reporting > By Employee - When you select Measures, you can see Billable Days and Non-Billable Days - Now select Reporting > By Project / By Task - When you select Measures, you can see Billable Hours and Non-Billable Hours **Issue:** - Even after changing the Encoding Unit from Hours to Days, still we are able to have Measures in Hours instead of Days **Cause:** - Records are not made for project and task which changes on the change of encoding unit. **Fix:** - adding records in 'timesheet_analysis_views' for project and task for graph and pivot views so that it updates when changed the encoding unit. Technical Explanation: 'timesheet_uom' is used to define the unit of measure for time entries in a timesheet. It represents the measurement unit that is used to record and track time spent on specific tasks or activities. For example, it could be set to 'hours' or 'days' depending on the organisation's requirements. 'float_time' is used for representing time duration or intervals. It allows users to input and display time values in a decimal format, such as hours and minutes. The float_time widget provides a convenient way to handle time calculations and representations. These two concepts serve different purposes but can be related in the context of tracking time-related data. The timesheet_uom field determines the unit of measure for time entries, while the float_time widget allows for inputting and displaying time values in a convenient decimal format. If we use 'timesheet_uom', the data on the server side will always be displayed in hours or days, which could be confusing for the user. Another issue arises when the work hours for a day are not 8 hours but rather 7.5 hours. The conversion is not accurate since it assumes 8 hours per day in all cases. Hence, by using 'float_time', the process of exporting the data can be streamlined. Task-3387850 Forward-Port-Of: odoo/odoo#127030
When a nav list is open if there is a new props provided, an error could be thrown. Reproduce: 1. write "@auser #ge" in the composer 2. click on the @auser => traceback The problem is that when NavigableList is open, the `props.optionTemplate` will change before `state.options`, leading to a mismatch between the template and the record. This commit solves the issue by removing syncing props.options and state.options altogether. This felt needed to enrich options with id, but this is unne
Original PR description
When a nav list is open if there is a new props provided, an error could be thrown. Reproduce: 1. write "@auser #ge" in the composer 2. click on the @auser => traceback The problem is that when NavigableList is open, the `props.optionTemplate` will change before `state.options`, leading to a mismatch between the template and the record. This commit solves the issue by removing syncing props.options and state.options altogether. This felt needed to enrich options with id, but this is unnecessary because the forged id was simply the index of option in the list. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144071 Forward-Port-Of: odoo/odoo#143375
**Current behavior before PR:** Copy pasting table in firefox gives us traceback because the firefox does not support :has() selector. **Desired behavior after PR is merged:** Now it will not give any traceback. task-3591148 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#141737
Original PR description
**Current behavior before PR:** Copy pasting table in firefox gives us traceback because the firefox does not support :has() selector. **Desired behavior after PR is merged:** Now it will not give any traceback. task-3591148 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#141737
Steps: -------------- - Open field service - Go to Calendar view - Click on any data, so that the popover opens. - Click on the SMS button to send a message. Issue: ------------------- - When we try to send the message, the traceback comes with the message 'Component is destroyed'. Cause: ------------- - When we try to send the message using 'Send SMS', before that the popover opened gets destroyed. The popover and wizard are different 2 components and hence we aren't able to co
Original PR description
Steps: -------------- - Open field service - Go to Calendar view - Click on any data, so that the popover opens. - Click on the SMS button to send a message. Issue: ------------------- - When we try to send the message, the traceback comes with the message 'Component is destroyed'. Cause: ------------- - When we try to send the message using 'Send SMS', before that the popover opened gets destroyed. The popover and wizard are different 2 components and hence we aren't able to control them. Fix: ---------- - We are performing load and notify methods only if the status of component is mounted and not destroyed. task-3386925 Forward-Port-Of: odoo/odoo#127100
Comparison feature has been lost in the OWL refactoring. steps to reproduce: - go to sale report, set a filter to current month - enable comparison to previous period - save to dashboard - open "my dashboard" before this commit: - dashboard did not use the comparison filter after this commit: - dashboard uses the comparison filter opw-3584559 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144145 Forward-P
Original PR description
Comparison feature has been lost in the OWL refactoring. steps to reproduce: - go to sale report, set a filter to current month - enable comparison to previous period - save to dashboard - open "my dashboard" before this commit: - dashboard did not use the comparison filter after this commit: - dashboard uses the comparison filter opw-3584559 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144145 Forward-Port-Of: odoo/odoo#143603
### Summary Taxcloud taxes are always 0 on payment page. ### Steps to reproduce * install `website_sale_loyalty` and `website_sale_account_taxcloud` * configure taxcloud * enable 'Detect Automatically' on the 'Automatic Tax Mapping (TaxCloud)' fiscal position * go to ecommerce, and add a product to cart * go to cart * proceed to checkout You should see that the taxes are still 0 on the payment page ### Cause The issue comes from the `shop_payment()` override in `website_sale_loy
Original PR description
### Summary Taxcloud taxes are always 0 on payment page. ### Steps to reproduce * install `website_sale_loyalty` and `website_sale_account_taxcloud` * configure taxcloud * enable 'Detect Automatically' on the 'Automatic Tax Mapping (TaxCloud)' fiscal position * go to ecommerce, and add a product to cart * go to cart * proceed to checkout You should see that the taxes are still 0 on the payment page ### Cause The issue comes from the `shop_payment()` override in `website_sale_loyalty`. The taxcloud taxes are computed with `res = super(WebsiteSale, self).shop_payment(**post)`, but they are immediately cleared with `order._update_programs_and_rewards()` opw-3539027 Forward-Port-Of: odoo/odoo#142664
Currently, increasing the rounding factor for a currency is not allowed if accounting entries have already been generated in that currency. However, the restriction currently only applies to the current company. And since currency records are shared between multiple companies, a user can create a new company with no accounting entries and then change the currency's rounding factor, affecting all companies. This commit checks for the restriction on all companies, and fixes a few tests th
Original PR description
Currently, increasing the rounding factor for a currency is not allowed if accounting entries have already been generated in that currency. However, the restriction currently only applies to the current company. And since currency records are shared between multiple companies, a user can create a new company with no accounting entries and then change the currency's rounding factor, affecting all companies. This commit checks for the restriction on all companies, and fixes a few tests that were broken by this change. opw-3586785 Forward-Port-Of: odoo/odoo#142729
Issue: - Before this PR when we see helpdesk team form view some of the features names are not aligned with checkbox Cause: - Issue was caused because of the icon size is large and so it features names were not aligned FIX: - we have reduced the size of the icon so that text get aligned with the checkbox task-3463622 Forward-Port-Of: odoo/odoo#132830
Original PR description
Issue: - Before this PR when we see helpdesk team form view some of the features names are not aligned with checkbox Cause: - Issue was caused because of the icon size is large and so it features names were not aligned FIX: - we have reduced the size of the icon so that text get aligned with the checkbox task-3463622 Forward-Port-Of: odoo/odoo#132830
Steps to reproduce (V 17.0): - Create a new blanket order with agreement type "Call for bids": - Select only one RFQ - Use line of agreement - use quantities of agreement - Add a product and confirm - Create a New quotation - Traceback! Bug: typo in the onchange makes it so instead of setting payment_term_id to false it's a False, which is actually a tupple (False,) meaning payment terms will be a record set containg one value with Id False instead of an empty record set (it's wrong but
Original PR description
Steps to reproduce (V 17.0): - Create a new blanket order with agreement type "Call for bids": - Select only one RFQ - Use line of agreement - use quantities of agreement - Add a product and confirm - Create a New quotation - Traceback! Bug: typo in the onchange makes it so instead of setting payment_term_id to false it's a False, which is actually a tupple (False,) meaning payment terms will be a record set containg one value with Id False instead of an empty record set (it's wrong but it doesn't really make a difference in this case) until commit[1] in web_read clean up is used to get the Id from origin Id for inherited fields ´not vals['id']´ is expected to be true if the value has an origin Id but in this case it is true because Id is false (co_records wasn't expected to contains values with Id False if Id is False it should be empty) commit[1]:https://github.com/odoo/odoo/pull/128878 Forward-Port-Of: odoo/odoo#143878
This commit fixes the behavior hiding the select element when scrolling has happened. Instead of the 'scroll' event, 'mousewheel' was used, which isn't triggered when scrolling on a touch device. Now, the correct event is used, and the listener is given to the actual document element, instead of being globally listening on window (in case of iframes). This fix is part of a bug happening in the report editor of Studio, since the select element wouldn't be reset when scrolling, but kept visi
Original PR description
This commit fixes the behavior hiding the select element when scrolling has happened. Instead of the 'scroll' event, 'mousewheel' was used, which isn't triggered when scrolling on a touch device. Now, the correct event is used, and the listener is given to the actual document element, instead of being globally listening on window (in case of iframes). This fix is part of a bug happening in the report editor of Studio, since the select element wouldn't be reset when scrolling, but kept visible at the same outdated position. ticket-3496665 Forward-Port-Of: odoo/odoo#143313
Currently, the error occurs while updating a work contract without selecting any employee. Steps to reproduce: - Install a 'hr_work_entry_contract' module. - Go to Employees> Employees> Contracts, And create a new contract without selecting any employee and also the 'Contract Start Date ' and 'Contract End Date' fields should be after or before the current date. - Then save it . - Then change 'Working Schedule' field of the created contract and save it. - The error is generated
Original PR description
Currently, the error occurs while updating a work contract without selecting any employee. Steps to reproduce: - Install a 'hr_work_entry_contract' module. - Go to Employees> Employees> Contracts,…
Currently, the error occurs while updating a work contract without selecting any employee.
Steps to reproduce:
- Install a 'hr_work_entry_contract' module.
- Go to Employees> Employees> Contracts, And create a new contract without
selecting any employee and also the 'Contract Start Date ' and
'Contract End Date' fields should be after or before the current date.
- Then save it .
- Then change 'Working Schedule' field of the created contract and save it.
- The error is generated.
Traceback on sentry:
```
DatatypeMismatch: column "hr_employee_id" is of type integer but expression is of type boolean
LINE 1: ...neration_wizard_id", "hr_employee_id") VALUES (1, false) ON ...
^
HINT: You will need to rewrite or cast the expression.
File "odoo/http.py", line 2157, in __call__
response = request._serve_db()
File "odoo/http.py", line 1732, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1759, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1960, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 207, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 722, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 24, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 20, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 466, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "addons/web/models/models.py", line 71, in web_save
self.write(vals)
File "home/odoo/src/enterprise/17.0/hr_payroll/models/hr_contract.py", line 416, in write
res = super().write(vals)
File "addons/hr_work_entry_holidays/models/hr_contract.py", line 89, in write
return super().write(vals)
File "addons/hr_work_entry_contract/models/hr_contract.py", line 443, in write
contract._recompute_work_entries(date_from, date_to)
File "home/odoo/src/enterprise/17.0/hr_payroll/models/hr_contract.py", line 427, in _recompute_work_entries
super()._recompute_work_entries(date_from, date_to)
File "addons/hr_work_entry_contract/models/hr_contract.py", line 448, in _recompute_work_entries
wizard = self.env['hr.work.entry.regeneration.wizard'].create({
File "<decorator-gen-12>", line 2, in create
File "odoo/api.py", line 414, in _model_create_multi
return create(self, [arg])
File "odoo/models.py", line 4582, in create
records = self._create(data_list)
File "odoo/models.py", line 4828, in _create
field.create([
File "odoo/fields.py", line 4310, in create
self.write_batch(record_values, True)
File "odoo/fields.py", line 4336, in write_batch
self.write_real(records_commands_list, create)
File "odoo/fields.py", line 4913, in write_real
cr.execute(SQL(
File "odoo/sql_db.py", line 332, in execute
res = self._obj.execute(query, params)
````
There's an issue while updating the contract without selecting any employee; As the system is trying to recompute work entries without employee_id [1].
This commit solves this issue by adding a condition which states that recompute the work entries; if employee_id is available.
[1]-https://github.com/odoo/odoo/blob/1b504038ce270540ddab28db4ab995d22f2ab2a7/addons/hr_work_entry_contract/models/hr_contract.py#L448-L452
sentry-4654142515
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#143322Before this commit, installing the Point of Sale module in a multi-currency environment could lead to errors. Specifically, if there were Bank or Cash journals in a currency different from the company's default, they could inadvertently be selected to create a payment method for a PoS configuration. This mismatch between the PoS configuration currency and the payment method's currency resulted in errors. This commit resolves the issue by implementing a currency filter when selecting Bank and
Original PR description
Before this commit, installing the Point of Sale module in a multi-currency environment could lead to errors. Specifically, if there were Bank or Cash journals in a currency different from the company's default, they could inadvertently be selected to create a payment method for a PoS configuration. This mismatch between the PoS configuration currency and the payment method's currency resulted in errors. This commit resolves the issue by implementing a currency filter when selecting Bank and Cash journals during the PoS setup. Now, only journals matching the company's default currency are considered for creating payment methods. opw-3606856 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#143953 Forward-Port-Of: odoo/odoo#143126
This commit addresses a layout issue introduced in https://github.com/odoo/odoo/commit/3450c29816270fa4fcccac2477538630eb937dbc in the Point of Sale module. The missing </div> tag from the previous commit caused the search bar to display at the same height as the categories when these categories had images. The addition of the missing </div> tag in this commit corrects the alignment and positioning of the search bar. opw-3607043 --- I confirm I have signed the CLA and read the PR guide
Original PR description
This commit addresses a layout issue introduced in https://github.com/odoo/odoo/commit/3450c29816270fa4fcccac2477538630eb937dbc in the Point of Sale module. The missing </div> tag from the previous commit caused the search bar to display at the same height as the categories when these categories had images. The addition of the missing </div> tag in this commit corrects the alignment and positioning of the search bar. opw-3607043 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144203 Forward-Port-Of: odoo/odoo#144132
Commit [1] moved page scrollbar to #wrapwrap, which introduced some issues. This was needed to not have a double scrollbar when the builder edition panel was moved from left to right. One of the issue if that the browser print was not working anymore. A workaround has been found with this commit to make it work again. It is just reverting the mentioned commit when inside the browser print preview, which can be achieved through css directly. Note that in the future, this PR [2] should reve
Original PR description
Commit [1] moved page scrollbar to #wrapwrap, which introduced some issues. This was needed to not have a double scrollbar when the builder edition panel was moved from left to right. One of the issue if that the browser print was not working anymore. A workaround has been found with this commit to make it work again. It is just reverting the mentioned commit when inside the browser print preview, which can be achieved through css directly. Note that in the future, this PR [2] should revert the fact that the scrollable element is the #wrapwrap. [1]: https://github.com/odoo/odoo/commit/4e7be69825163c0a0ff41c882a196fc7f3158fb3 [2]: https://github.com/odoo/odoo/pull/98429 opw-3557672 Forward-Port-Of: odoo/odoo#143790
The goal of this PR is to prevent the text animation overlay from blocking small text content selection. Remark: This behavior was already fixed on 17.0 (by [1]) for text animations and highlights and was backported here for text animation options. [1]: https://github.com/odoo/odoo/commit/f64c9f27f1a9106bc009ad2f696845f2c5c58066 Related to task-3285817 Forward-Port-Of: odoo/odoo#143897 Forward-Port-Of: odoo/odoo#142833
Original PR description
The goal of this PR is to prevent the text animation overlay from blocking small text content selection. Remark: This behavior was already fixed on 17.0 (by [1]) for text animations and highlights and was backported here for text animation options. [1]: https://github.com/odoo/odoo/commit/f64c9f27f1a9106bc009ad2f696845f2c5c58066 Related to task-3285817 Forward-Port-Of: odoo/odoo#143897 Forward-Port-Of: odoo/odoo#142833
This commit is the communitiy counter-part to allow copying a dashboard. With this commit, we can now write on 'raw' field. It allows to give a value for the field when calling 'copy'. Yet another 'copy' overrride to add the same postfix! Task: 3588237 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144030 Forward-Port-Of: odoo/odoo#141639
Original PR description
This commit is the communitiy counter-part to allow copying a dashboard. With this commit, we can now write on 'raw' field. It allows to give a value for the field when calling 'copy'. Yet another 'copy' overrride to add the same postfix! Task: 3588237 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144030 Forward-Port-Of: odoo/odoo#141639
When uploading an invoice/bill from an xml, if the partner is not found, the useful informations from the xml file should be displayed in the chatter. opw-3563769 Forward-Port-Of: odoo/odoo#144010
Original PR description
When uploading an invoice/bill from an xml, if the partner is not found, the useful informations from the xml file should be displayed in the chatter. opw-3563769 Forward-Port-Of: odoo/odoo#144010
[FIX] website: consider other media types for Social Media snippet icons When using the "Social Media" snippet, there are two situations leading to a traceback. Here are the steps: 1) First issue - In edit mode, drop the "Social Media" snippet. - Add a new social network. - Replace the icon by a real image (so not by an other icon). - Set the URL of the new social network to a "relevant" one (e.g. google, facebook). => traceback 2) Second issue - Drop "Social Media" and change the
Original PR description
[FIX] website: consider other media types for Social Media snippet icons When using the "Social Media" snippet, there are two situations leading to a traceback. Here are the steps: 1) First issue -…
[FIX] website: consider other media types for Social Media snippet icons
When using the "Social Media" snippet, there are two situations leading to a traceback. Here are the steps:
1) First issue
- In edit mode, drop the "Social Media" snippet.
- Add a new social network.
- Replace the icon by a real image (so not by an other icon).
- Set the URL of the new social network to a "relevant" one (e.g. google, facebook).
=> traceback
2) Second issue
- Drop "Social Media" and change the list in order to have the first social network with a real image as icon: either replace the first icon with an image, or add a custom one with an image an move it to the top.
- Add a new social network.
=> traceback
Both issues happen because only icons set as `<i>` elements are taken into account when modifying a social network (`querySelector('i')`) and this element may not exist if the icon had another tag (like an image or a span or even a video (as the media dialog allows to upload them)). As there is no check ensuring that the element exists before changing the different social media classes, there is a traceback when the `<i>` is not found.
For the first issue, it happens because when changing the URL, we first check if it matches with relevant ones or if an icon matching it exists. If it is the case, we then update the social media classes to set the matching icon => it can only work if the icon is a `<i>`.
The second issue happens because when adding a new social network, it actually copies the style of the first one (unless there are none, a new one is created in that case). If the first one is an image, it fails when updating the classes because it is not a `<i>`.
This commit fixes these issues by simply adding checks ensuring the icon element exists before trying to modify it. It also adds tests, ensuring these use cases work as expected.
opw-3538230
---
[FIX] website: consider `<span>` icons in Social Media snippet
In the Social Media snippet options, only icons with a `<i>` tag are
considered when updating the social media classes (when adding a new
social network by copying the first one and when replacing the icon by
another one matching the URL). However, there are cases where the icon
is a `<span>` element (with a `fa` class) and not a `<i>`.
For example:
- Replace a social network icon by a real image.
- Re-replace this image by an icon.
=> the icon element tag is `<span>` and not `<i>`.
In this case, after setting its style correctly (e.g. adding the round
shape) to make it look like the other icons, we notice that it does not
behave like the other ones:
- It is not aligned with the other icons, because the CSS rule aligning
them only targets `<i>`.
- Its icon is not replaced by a matching one when changing the URL with
a "relevant" one (e.g. google, facebook).
This commit considers `<span>` icons in the Social Media options, in
addition to `<i>` icons, in order for them to all behave the same way.
opw-3538230
Forward-Port-Of: odoo/odoo#143730
Forward-Port-Of: odoo/odoo#142280The values in the "Total" measure are all displayed in the move currency. Due to this amounts in different currencies are added together. As a workaround we introduce the possibility to group by move currency. Thus the user can choose to seperate the values by currency. The "Total" column was renamed to "Total in Currency" to avoid confusion There is a remaining problem. The totals of the individual groups are still added up to form a total. Previously it was tried to convert the va
Original PR description
The values in the "Total" measure are all displayed in the move currency. Due to this amounts in different currencies are added together. As a workaround we introduce the possibility to group by move currency. Thus the user can choose to seperate the values by currency. The "Total" column was renamed to "Total in Currency" to avoid confusion There is a remaining problem. The totals of the individual groups are still added up to form a total. Previously it was tried to convert the values from the move currency to the move company currency and then to the active company currency. The problem is that there is no efficient way to do it correctly. task-3613358 Forward-Port-Of: odoo/odoo#143981 Forward-Port-Of: odoo/odoo#143834
Steps to reproduce: ------------------- - be in UTC -5 (America/Lima for example) on the system (and so browser) and the user profile; - create an event from 4pm to 5pm the next day; - be at 2pm today; Issue: ------ We have a notification in activities for this event today, which is one day too soon. Cause: ------ To find the events that need to be notified to the user, we use a domain which, in this case, can be expressed as follows: ``` ( the `start` of the event must be afte
Original PR description
Steps to reproduce: ------------------- - be in UTC -5 (America/Lima for example) on the system (and so browser) and the user profile; - create an event from 4pm to 5pm the next day; - be at 2pm…
Steps to reproduce: ------------------- - be in UTC -5 (America/Lima for example) on the system (and so browser) and the user profile; - create an event from 4pm to 5pm the next day; - be at 2pm today; Issue: ------ We have a notification in activities for this event today, which is one day too soon. Cause: ------ To find the events that need to be notified to the user, we use a domain which, in this case, can be expressed as follows: ``` ( the `start` of the event must be after "now" (the event has not yet passed) OR the event `stop` must be after now (the event is in progress) ) AND the `start` of the event must be less than the end of the day (the event must be today) ``` The end of the day must be determined, but taking into account the user's timezone. As the domain has to work with UTC values (because the `start` and `stop` values of the event are in UTC in DB), in order to determine the end of the current day, we first need to determine which day the user is in UTC. Logic before this commit (using the example): ```py start_dt = datetime.datetime.utcnow() # 19:00 (because 14h in America/Lima -5) start_date = timezone(tz).localize(start_dt).astimezone(UTC).date() # 00:00 next day end_dt = datetime.datetime.combine(start_date, datetime.time.max) # 23:59 next day end_dt = timezone(tz).localize(end_dt).astimezone(UTC) # 4:59 second next day ``` The result (for an America/Lima timezone) is that if the event has its `start` in UTC before 4:59 two days later, the event will be notified. Solution: --------- Correct the values used to construct the domain. Logic after this commit (using the example): ```py start_dt_utc = now_utc.replace(tzinfo=UTC) # 19:00 (because 14h in America/Lima -5) start_dt = start_dt_utc.astimezone(user_tz) # 14:00 (because 14h in America/Lima -5) stop_dt = datetime.datetime.combine(start_dt.date(), datetime.time.max).replace(tzinfo=user_tz).astimezone(UTC) # 4:59 next day ``` Because 23:59 today using user timezone and then converted to UTC gives 4:59 next day. In fact, the day of a user in the America/Lima (UTC -5) timezone ends in UTC at 4:59 the next day. If this same user creates an event that starts at midnight (and therefore tomorrow), the activity must not be displayed before midnight and therefore 5:00 the next day in UTC. opw-3523558 Forward-Port-Of: odoo/odoo#143874 Forward-Port-Of: odoo/odoo#141949
This traceback arises when `write_date` is `False` in `max()` function https://github.com/odoo/odoo/blob/a5ace6fc50df06a30805e639e0e81d35e20d9f3e/addons/product/models/product_product.py#L136-L138 Error:- ``` KeyError: <NewId origin=1> File "odoo/api.py", line 965, in get cache_value = field_cache[record._ids[0]] CacheMiss: 'product.product(<NewId origin=1>,).write_date' File "odoo/fields.py", line 1160, in __get__ value = env.cache.get(record, self) File "odoo/api.
Original PR description
This traceback arises when `write_date` is `False` in `max()` function https://github.com/odoo/odoo/blob/a5ace6fc50df06a30805e639e0e81d35e20d9f3e/addons/product/models/product_product.py#L136-L138…
This traceback arises when `write_date` is `False` in `max()` function
https://github.com/odoo/odoo/blob/a5ace6fc50df06a30805e639e0e81d35e20d9f3e/addons/product/models/product_product.py#L136-L138
Error:-
```
KeyError: <NewId origin=1>
File "odoo/api.py", line 965, in get
cache_value = field_cache[record._ids[0]]
CacheMiss: 'product.product(<NewId origin=1>,).write_date'
File "odoo/fields.py", line 1160, in __get__
value = env.cache.get(record, self)
File "odoo/api.py", line 972, in get
raise CacheMiss(record, field)
TypeError: '>' not supported between instances of 'datetime.datetime' and 'bool'
File "odoo/http.py", line 2138, in __call__
response = request._serve_db()
File "odoo/http.py", line 1714, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1741, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1942, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 191, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 717, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 30, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 26, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 466, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "odoo/models.py", line 6788, in onchange
snapshot1 = Snapshot(record, nametree)
File "odoo/models.py", line 6565, in __init__
self.fetch(name)
File "odoo/models.py", line 6573, in fetch
self[name] = [Snapshot(line, tree[name]) for line in record[name]]
File "odoo/models.py", line 6573, in <listcomp>
self[name] = [Snapshot(line, tree[name]) for line in record[name]]
File "odoo/models.py", line 6565, in __init__
self.fetch(name)
File "odoo/models.py", line 6575, in fetch
self[name] = record[name]
File "odoo/models.py", line 6211, in __getitem__
return self._fields[key].__get__(self, type(self))
File "odoo/fields.py", line 1211, in __get__
self.compute_value(recs)
File "odoo/fields.py", line 1389, in compute_value
records._compute_field_value(self)
File "addons/mail/models/mail_thread.py", line 395, in _compute_field_value
return super()._compute_field_value(field)
File "odoo/models.py", line 4553, in _compute_field_value
fields.determine(field.compute, self)
File "odoo/fields.py", line 101, in determine
return needle(*args)
File "addons/product/models/product_product.py", line 143, in _compute_write_date
record.write_date = max(record.write_date, record.product_tmpl_id.write_date)
```
On the `_compute_write_date` when the `write_date` is `False` in `max()` function,
It leads to the above traceback.
After applying this commit will resolve the issue by computing with the `current date`,
when `write_date` is `False`.
sentry-4398163501
Forward-Port-Of: odoo/odoo#138177Before this commit, refunding a lot-tracked product with a quantity greater than one in the POS would reset the quantity to one. This occurred even if the user manually set a higher quantity. This commit fixes the issue by ensuring the manually set quantity for lot-tracked products is kept during refunds. This enhancement allows for accurate quantity retention, improving the POS refund functionality. opw-3568867 --- I confirm I have signed the CLA and read the PR guidelines at www.odo
Original PR description
Before this commit, refunding a lot-tracked product with a quantity greater than one in the POS would reset the quantity to one. This occurred even if the user manually set a higher quantity. This commit fixes the issue by ensuring the manually set quantity for lot-tracked products is kept during refunds. This enhancement allows for accurate quantity retention, improving the POS refund functionality. opw-3568867 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#143351 Forward-Port-Of: odoo/odoo#142678
Before this commit ================== Modifying the type of content from video to article or article to video violates the constraint. Technical ========= When we change the 'slide_type' of the slide.slide model from video to any other type, or from article to any other type, the value url or html_content is not removed and remains the same. However, when switching between video and article, the 'exclusion_html_content_and_url' constraint is violated because one of them should be null.
Original PR description
Before this commit ================== Modifying the type of content from video to article or article to video violates the constraint. Technical ========= When we change the 'slide_type' of the slide.slide model from video to any other type, or from article to any other type, the value url or html_content is not removed and remains the same. However, when switching between video and article, the 'exclusion_html_content_and_url' constraint is violated because one of them should be null. After this commit ================= When the content type is article the URL is removed, and when the content type is not article the HTML content is removed. Task-3474466 Forward-Port-Of: odoo/odoo#143833 Forward-Port-Of: odoo/odoo#140865
Before this commit, the point of sale module would attempt to load all pricelist items from the database, even if there were a high number defined. This could cause memory issues. Although the products loaded into the POS can be limited, all of the pricelist items would still be loaded, even for not loaded products. This commit improves the pricelist loading to only load pricelist items related to the products loaded into the POS. When new products are loaded, their associated pricelist it
Original PR description
Before this commit, the point of sale module would attempt to load all pricelist items from the database, even if there were a high number defined. This could cause memory issues. Although the products loaded into the POS can be limited, all of the pricelist items would still be loaded, even for not loaded products. This commit improves the pricelist loading to only load pricelist items related to the products loaded into the POS. When new products are loaded, their associated pricelist items are added. This optimization prevents unnecessary pricelist item loading and reduces memory usage in cases with large pricelists. opw-3374866 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#142394 Forward-Port-Of: odoo/odoo#135219
With [commit 1], the editor toolbar was ported to OWL. One side effect of this port is that the condition for displaying the font size dropdown was no longer based on screen size but on the OS / Browser used. This lead to iPads not having the font size dropdown. This did not create a direct error on 16.4 but in 17.0, the dropdown was changed by [commit 2] and the assumption was that it would always be displayed. This leads to a traceback when starting website edition on an iPad. This co
Original PR description
With [commit 1], the editor toolbar was ported to OWL. One side effect of this port is that the condition for displaying the font size dropdown was no longer based on screen size but on the OS / Browser used. This lead to iPads not having the font size dropdown. This did not create a direct error on 16.4 but in 17.0, the dropdown was changed by [commit 2] and the assumption was that it would always be displayed. This leads to a traceback when starting website edition on an iPad. This commit restores the original condition for displaying the font size dropdown which is based on screen size and not on browser. Steps to reproduce the bug (17.0): - Open Website on an iPad - Start edition => Traceback [commit 1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997 [commit 2]: https://github.com/odoo/odoo/commit/194f73a9bbad8c3c3fb5c378e7bdfa704aaacdc0 opw-3594634 opw-3590980 opw-3594313 opw-3594615 Forward-Port-Of: odoo/odoo#143287
This PR changes the 'cursor-like' icon visible on hovering over a dashboard in dashboard search panel to a 'pointing hand-like' icon. Task ID : 3597552 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#142700
Original PR description
This PR changes the 'cursor-like' icon visible on hovering over a dashboard in dashboard search panel to a 'pointing hand-like' icon. Task ID : 3597552 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#142700
Test was breaking during the night. Most likely due to the same issue as the one that odoo/odoo#131389 fixes, so we apply the same fix. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#143921
Original PR description
Test was breaking during the night. Most likely due to the same issue as the one that odoo/odoo#131389 fixes, so we apply the same fix. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#143921
Currently there is no margin between the top edge and the image below in the DIN5008 layout. Thus the image may be cut off when printing the page. This commit adds a 10mm margin. opw-3599133 Forward-Port-Of: odoo/odoo#143383
Original PR description
Currently there is no margin between the top edge and the image below in the DIN5008 layout. Thus the image may be cut off when printing the page. This commit adds a 10mm margin. opw-3599133 Forward-Port-Of: odoo/odoo#143383
Issue: In the Accounting dashboard, when displaying pending checks, there was a missing space between the number and the word "Check" (e.g., "1Check to print"). Steps to reproduce: 1. Go to "Accounting --> Vendors --> Payment", click NEW. 2. Choose Checks as the Payment Method, complete the form, and click CONFIRM. 3. Observe the Accounting dashboard, specifically the Bank journal section. Solution: - Ensured proper spacing between the number of checks and the text "Check" in the dash
Original PR description
Issue: In the Accounting dashboard, when displaying pending checks, there was a missing space between the number and the word "Check" (e.g., "1Check to print"). Steps to reproduce: 1. Go to "Accounting --> Vendors --> Payment", click NEW. 2. Choose Checks as the Payment Method, complete the form, and click CONFIRM. 3. Observe the Accounting dashboard, specifically the Bank journal section. Solution: - Ensured proper spacing between the number of checks and the text "Check" in the dashboard display. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Task link: https://www.odoo.com/web#model=project.task&id=3591902 opw-3591902 Forward-Port-Of: odoo/odoo#143859 Forward-Port-Of: odoo/odoo#142475
The items in the Peppol Bis 3 xml should all have a `Name` tag, otherwise a validator will raise: "[BR-25]-Each Invoice line (BG-25) shall contain the Item name (BT-153)." This `Name` is the product's name or the label in case of invoice line with no product set. task-3607354 Forward-Port-Of: odoo/odoo#143885 Forward-Port-Of: odoo/odoo#143178
Original PR description
The items in the Peppol Bis 3 xml should all have a `Name` tag, otherwise a validator will raise: "[BR-25]-Each Invoice line (BG-25) shall contain the Item name (BT-153)." This `Name` is the product's name or the label in case of invoice line with no product set. task-3607354 Forward-Port-Of: odoo/odoo#143885 Forward-Port-Of: odoo/odoo#143178
This traceback arises when the current day of the date is `31` , while the schedule action `(Generate Monthly Sales Closing)` runs. Scenarios to produce the issue: `[1]` * Imagine the `date_stop` value is `31-10-2023` * When the scheduled action `('Generate Monthly Sales Closing')` runs * The value of the `month_target` will be `9` and `year_target` remains same * The value of `interval_from` will be `31-09-2023` (an invalid date). `[2]` * Imagine the `date_stop` value is `31-03-2
Original PR description
This traceback arises when the current day of the date is `31` , while the schedule action `(Generate Monthly Sales Closing)` runs. Scenarios to produce the issue: `[1]` * Imagine the `date_stop`…
This traceback arises when the current day of the date is `31` ,
while the schedule action `(Generate Monthly Sales Closing)` runs.
Scenarios to produce the issue:
`[1]`
* Imagine the `date_stop` value is `31-10-2023`
* When the scheduled action `('Generate Monthly Sales Closing')` runs
* The value of the `month_target` will be `9` and `year_target` remains same
* The value of `interval_from` will be `31-09-2023` (an invalid date).
`[2]`
* Imagine the `date_stop` value is `31-03-2023`
* The value of `interval_from` will be `31-02-2023` (an invalid date)
It leads to the traceback
Error:
```
ValueError: day is out of range for month
File "odoo/tools/safe_eval.py", line 365, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(791,)", line 1, in <module>
File "addons/l10n_fr_pos_cert/models/account_closing.py", line 163, in _automated_closing
values = self._compute_amounts(frequency, company)
File "addons/l10n_fr_pos_cert/models/account_closing.py", line 77, in _compute_amounts
interval_dates = self._interval_dates(frequency, company)
File "addons/l10n_fr_pos_cert/models/account_closing.py", line 134, in _interval_dates
interval_from = date_stop.replace(year=year_target, month=month_target)
ValueError: <class 'ValueError'>: "day is out of range for month" while evaluating
"model._automated_closing('monthly')"
File "odoo/addons/base/models/ir_cron.py", line 373, in _callback
self.env['ir.actions.server'].browse(server_action_id).run()
File "home/odoo/src/custom/trial/saas_trial/models/sentry.py", line 33, in run
res = super().run()
File "odoo/addons/base/models/ir_actions.py", line 688, in run
res = runner(run_self, eval_context=eval_context)
File "addons/website/models/ir_actions_server.py", line 61, in _run_action_code_multi
res = super(ServerAction, self)._run_action_code_multi(eval_context)
File "odoo/addons/base/models/ir_actions.py", line 558, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "odoo/tools/safe_eval.py", line 379, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
```
See:-
https://github.com/odoo/odoo/blob/5fb9825384895fd303bd15c3e4f8dbc55d35904f/addons/l10n_fr_pos_cert/models/account_closing.py#L124-L134
After applying this commit, it will resolve the issue by calculating a valid date in all scenarios.
sentry-4589899768
Forward-Port-Of: odoo/odoo#140652An error will be generated when a user tries to import or upload a file into the invoice module and the file is attached to an image via a URL form but the image is invalid or cannot be found. step to reproduce - - install the `Accounting`. - open Accounting > Vendors Menu > Products. - import file (image url must be invalid or not found - [file](https://drive.google.com/file/d/1ZpKfawnRYjLaqOicBiQMjr8N-MzUmjp8/view?usp=sharing)) - the error will be generated. sentry traceback- `
Original PR description
An error will be generated when a user tries to import or upload a file into the invoice module and the file is attached to an image via a URL form but the image is invalid or cannot be found. step…
An error will be generated when a user tries to import or upload a file into the
invoice module and the file is attached to an image via a URL form but the
image is invalid or cannot be found.
step to reproduce -
- install the `Accounting`.
- open Accounting > Vendors Menu > Products.
- import file (image url must be invalid or not found - [file](https://drive.google.com/file/d/1ZpKfawnRYjLaqOicBiQMjr8N-MzUmjp8/view?usp=sharing))
- the error will be generated.
sentry traceback-
```
UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f54b322af20>
File "addons/base_import/models/base_import.py", line 1269, in _import_image_by_url
image = Image.open(io.BytesIO(content))
File "PIL/Image.py", line 3008, in open
raise UnidentifiedImageError(
ValueError: Không thể truy cập đường dẫn: https://cdn.lottemart.vn/media/catalog/product/cache/0x0/9/4/9415522285001.jpg.webp [image_1920: L10]: cannot identify image file <_io.BytesIO object at 0x7f54b322af20>
File "odoo/http.py", line 2139, in __call__
response = request._serve_db()
File "odoo/http.py", line 1715, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1742, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1943, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 191, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 717, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 30, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 26, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 466, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "addons/base_import/models/base_import.py", line 1319, in execute_import
input_file_data = self._parse_import_data(input_file_data, import_fields, options)
File "home/odoo/src/custom/trial/saas_base_import/models/base_import.py", line 37, in _parse_import_data
return super(Import, self)._parse_import_data(data, import_fields, options)
File "addons/base_import/models/base_import.py", line 1160, in _parse_import_data
return self._parse_import_data_recursive(self.res_model, '', data, import_fields, options)
File "addons/base_import/models/base_import.py", line 1194, in _parse_import_data_recursive
line[index] = self._import_image_by_url(line[index], session, name, num)
File "addons/base_import/models/base_import.py", line 1280, in _import_image_by_url
raise ValueError(_("Could not retrieve URL: %(url)s [%(field_name)s: L%(line_number)d]: %(error)s") % {
```
At the time of solving the conflicts of FW mistakenly changed the "ImportValidationError" to "ValueError". Due to these changes, the error is shown in the log.
FW - [link](https://github.com/odoo/odoo/pull/137596)
sentry-4538772256
Forward-Port-Of: odoo/odoo#138788Before this commit, a studio qunit test ("edit/delete menus") sometimes failed on runbot, because it tried to click on a button in a modal footer, but it found 3 of them, because another dialog which was expected to be closed at that moment, was still opened. There was no guarantee for the dialog to be closed because of the way browser.fetch was mocked. The fetching part was ok, but the function returned a Response object, whose `json` method is async (setTimeout-like async, i.e. "real" ticks
Original PR description
Before this commit, a studio qunit test ("edit/delete menus") sometimes failed on runbot, because it tried to click on a button in a modal footer, but it found 3 of them, because another dialog which…
Before this commit, a studio qunit test ("edit/delete menus") sometimes failed on runbot, because it tried to click on a button in a modal footer, but it found 3 of them, because another dialog which was expected to be closed at that moment, was still opened.
There was no guarantee for the dialog to be closed because of the way browser.fetch was mocked. The fetching part was ok, but the function returned a Response object, whose `json` method is async (setTimeout-like async, i.e. "real" ticks).
This commit mocks some functions of the returned Response instance to ensure that, by calling nextTick after a click or whatever, the fetch operation has been done, the body has been decoded, potential renderings are finished and the DOM has been patched.
Runbot error 23054
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#143813When dragging an item over a grid, `dropzoneOver` is called after `_onDragMove` which adjusts the position of the dragged item inside the hovered grid only if the grid is already hovered. The problem is that between the time at which the grid is hovered and the time at which the next `mousemove` event is emitted, the item preview is temporarily positioned in the top of the grid. This commit addresses this by calling `_onDragMove` once the dropzone is activated, using the last coordinate
Original PR description
When dragging an item over a grid, `dropzoneOver` is called after `_onDragMove` which adjusts the position of the dragged item inside the hovered grid only if the grid is already hovered. The problem is that between the time at which the grid is hovered and the time at which the next `mousemove` event is emitted, the item preview is temporarily positioned in the top of the grid. This commit addresses this by calling `_onDragMove` once the dropzone is activated, using the last coordinates that method received. Steps to reproduce: - drag a "Text - Image" block into the page - toggle it to grid mode - select the image - move the image down one row - click and hold the image's move handle to outside of the grid on the right side - slowly approach the grid => The image was positioned in the top of the grid before being put on the correct row right after. task-3554752 Forward-Port-Of: odoo/odoo#140633
Move '_create_mailing_list' as a base mass mailing tool to make it easily usable by most mail-related test addons. Improve some logs to ease debugging, notably for marketing automation. Add a tool to simulate opening a mailing at trace level in addition to existing tools to simulate a click or a bounce Task-3506681 (MA: Test cleanup) Task-2981581 (MA: Fix trace duplication and various issues) Forward-Port-Of: odoo/odoo#143040 Forward-Port-Of: odoo/odoo#141773
Original PR description
Move '_create_mailing_list' as a base mass mailing tool to make it easily usable by most mail-related test addons. Improve some logs to ease debugging, notably for marketing automation. Add a tool to simulate opening a mailing at trace level in addition to existing tools to simulate a click or a bounce Task-3506681 (MA: Test cleanup) Task-2981581 (MA: Fix trace duplication and various issues) Forward-Port-Of: odoo/odoo#143040 Forward-Port-Of: odoo/odoo#141773
This pr https://github.com/odoo/odoo/pull/143108 was breaking eCommerce. opw-3616105 Forward-Port-Of: odoo/odoo#144154
Original PR description
This pr https://github.com/odoo/odoo/pull/143108 was breaking eCommerce. opw-3616105 Forward-Port-Of: odoo/odoo#144154
Steps to reproduce: - Enable the "Cookies bar" in website configuration > Go to website (Edit mode). - Select the cookies bar > Change its layout to "Popup" > The modal container becomes visible in edit mode only. The `#website_cookies_bar` element will automatically get one line height (equivalent to its current `line-height` value) because of the `contenteditable="true"` added to it, which makes it visible in edit mode (The container has this default height in all layouts, but it's
Original PR description
Steps to reproduce: - Enable the "Cookies bar" in website configuration > Go to website (Edit mode). - Select the cookies bar > Change its layout to "Popup" > The modal container becomes visible in edit mode only. The `#website_cookies_bar` element will automatically get one line height (equivalent to its current `line-height` value) because of the `contenteditable="true"` added to it, which makes it visible in edit mode (The container has this default height in all layouts, but it's hidden by the cookies bar content in "Discrete" and "Classic" modes). The goal of this commit is to simply hide this element to prevent this behaviour. Remark: The same issue occurred on a `.s_popup` parent with an inner `.modal` element and was fixed in [1] by keeping their visibility synchronized. [1]: https://github.com/odoo/odoo/commit/cfd53b8fae3ad9f677df49a03fe6d2945dbb5da2 linked to opw-3485565 Forward-Port-Of: odoo/odoo#143618 Forward-Port-Of: odoo/odoo#143221
Recent commit [1] in Odoo 15 (which is a backport of commit [2] which was merged in Odoo 17) introduced a security layer on forms but only for forms which are inside `ir.ui.view`. The forms inside HTML fields are thus not working anymore, because those don't receive the required signature. For the record: - `ir.ui.view` = `website.page` pages, some part of the controller pages - HTML fields = the most part of the editable areas in controller pages [1]: https://github.com/odoo/odoo/commit
Original PR description
Recent commit [1] in Odoo 15 (which is a backport of commit [2] which was merged in Odoo 17) introduced a security layer on forms but only for forms which are inside `ir.ui.view`. The forms inside HTML fields are thus not working anymore, because those don't receive the required signature. For the record: - `ir.ui.view` = `website.page` pages, some part of the controller pages - HTML fields = the most part of the editable areas in controller pages [1]: https://github.com/odoo/odoo/commit/17c6f6f30bf13bd3c303b28d9a314bd76dd8f4dc [2]: https://github.com/odoo/odoo/commit/7d25e7bf9243367c87b1b2005587ae728730b49c opw-3586333 Forward-Port-Of: odoo/odoo#143748 Forward-Port-Of: odoo/odoo#143139
This is a backport of odoo/odoo#140505 Since [1] when device visibility became a visibility option, when dropping a snippet that contains device-invisible blocks, all those blocks were made visible. This commit makes that behavior limited to blocks that are not device-invisible. (E.g. when dropping a popup) Steps to reproduce: - drop a Columns snippet - hide a column on mobile - hide a column on desktop - save snippet - drop saved snippet in either desktop or mobile preview => A
Original PR description
This is a backport of odoo/odoo#140505 Since [1] when device visibility became a visibility option, when dropping a snippet that contains device-invisible blocks, all those blocks were made visible. This commit makes that behavior limited to blocks that are not device-invisible. (E.g. when dropping a popup) Steps to reproduce: - drop a Columns snippet - hide a column on mobile - hide a column on desktop - save snippet - drop saved snippet in either desktop or mobile preview => All columns were shown with the `o_snippet_override_invisible` effect on the conditional ones. [1]: https://github.com/odoo/odoo/commit/3103e0553011b5c1f4078972d7a88fa3fd4068b2 task-3538535 Forward-Port-Of: odoo/odoo#143640 Forward-Port-Of: odoo/odoo#141389
'field' is the name of a variable and shouldn't be translated Forward-Port-Of: odoo/odoo#143035 Forward-Port-Of: odoo/odoo#142809
Original PR description
'field' is the name of a variable and shouldn't be translated Forward-Port-Of: odoo/odoo#143035 Forward-Port-Of: odoo/odoo#142809
Current behavior: When you use a coupon that gives a free product combined with a promo that gives 50% discount. The reward of 50% disappears when you add the free product. Steps to reproduce: - Create 2 program with no conditions : - One that gives 50% discount on all products with a code - One that gives a free product A - Make sure product A has a tax - Open PoS - Add a product with no tax to the order - Apply the 50% discount - Add product A - The reward of 50% disappears
Original PR description
Current behavior: When you use a coupon that gives a free product combined with a promo that gives 50% discount. The reward of 50% disappears when you add the free product. Steps to reproduce: - Create 2 program with no conditions : - One that gives 50% discount on all products with a code - One that gives a free product A - Make sure product A has a tax - Open PoS - Add a product with no tax to the order - Apply the 50% discount - Add product A - The reward of 50% disappears Note: This happens because we try to apply a 50% discount on amount that is 0 wich leads to a reward with a NaN amount. Wich makes the reward for the program disappears, because here (https://github.com/odoo/odoo/blob/15.0/addons/pos_coupon/static/src/js/coupon.js#L624) `currentMaxKey` is null. opw-3529959 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#142335 Forward-Port-Of: odoo/odoo#141279
Steps: - Install timesheet. - Go to configuration->projects. - Internal project is visible. - Check the projects menu. - Internal project not visible. - Turn on project stages from the configuration. Issue: - After turning on project stages, the internal project gets visible in projects menu as well. Cause: - We have not set 'is_internal_project' to false for group stages. Fix: - Set 'is_internal_project' to false. task-3392129 Forward-Port-Of: odoo/odoo#143670 Forward-Port
Original PR description
Steps: - Install timesheet. - Go to configuration->projects. - Internal project is visible. - Check the projects menu. - Internal project not visible. - Turn on project stages from the configuration. Issue: - After turning on project stages, the internal project gets visible in projects menu as well. Cause: - We have not set 'is_internal_project' to false for group stages. Fix: - Set 'is_internal_project' to false. task-3392129 Forward-Port-Of: odoo/odoo#143670 Forward-Port-Of: odoo/odoo#127031
`psycopg2` errors sometimes happen during tests. This is caused by race conditions between several `cr.execute()`/`cr.fetch*`. This is even worse with websockets that are long lived connections that sometimes open a cursor in the middle of the test. Before websockets, longpolling was just disabled during tests. This commits disable websockets as well in order to prevent those errors as much as possible. Some live chat tours were updated in [1] after the websockets intro- duction du
Original PR description
`psycopg2` errors sometimes happen during tests. This is caused by race conditions between several `cr.execute()`/`cr.fetch*`. This is even worse with websockets that are long lived connections that sometimes open a cursor in the middle of the test. Before websockets, longpolling was just disabled during tests. This commits disable websockets as well in order to prevent those errors as much as possible. Some live chat tours were updated in [1] after the websockets intro- duction due to some race conditions. This was reverted as the fix relied on a hack on websockets that are now unavailable. fixes runbot-25357,24809 [1]: https://github.com/odoo/odoo/pull/103521 Forward-Port-Of: odoo/odoo#143562 Forward-Port-Of: odoo/odoo#141519
This commit fixes a visual issue with a label of the properties modal that has a bolder font-weight than the other. This issue comes from the fact we recently changed the behavior of our `bold` and `bolder` variants. To avoid this issue, we simply remove the label to render the text directly inside the `label`. task-3580556  Forward-Port-Of: odoo/odoo#140732
Original PR description
This commit fixes a visual issue with a label of the properties modal that has a bolder font-weight than the other. This issue comes from the fact we recently changed the behavior of our `bold` and `bolder` variants. To avoid this issue, we simply remove the label to render the text directly inside the `label`. task-3580556  Forward-Port-Of: odoo/odoo#140732
This commit fixes an issue where the quickcreate button was missing from the kanban view when it was grouped by a non many2one field and contained no record yet (so that no column is shown yet). Steps to reproduce: -Go to a kanban view on a model with no record -Group by as scalar value (eg: Description) ->The "New" button disappears OPW-3459808 Forward-Port-Of: odoo/odoo#143673 Forward-Port-Of: odoo/odoo#143355
Original PR description
This commit fixes an issue where the quickcreate button was missing from the kanban view when it was grouped by a non many2one field and contained no record yet (so that no column is shown yet). Steps to reproduce: -Go to a kanban view on a model with no record -Group by as scalar value (eg: Description) ->The "New" button disappears OPW-3459808 Forward-Port-Of: odoo/odoo#143673 Forward-Port-Of: odoo/odoo#143355
This PR prevents the editor to search for anchors when the link URL is an email. This way we prevent an error in the console. Related to runbot-18747 Forward-Port-Of: odoo/odoo#143734 Forward-Port-Of: odoo/odoo#143336
Original PR description
This PR prevents the editor to search for anchors when the link URL is an email. This way we prevent an error in the console. Related to runbot-18747 Forward-Port-Of: odoo/odoo#143734 Forward-Port-Of: odoo/odoo#143336