Daily updates from Odoo
Tuesday, August 6, 2024
26 changes · saas-17.2
Resolved issues and error corrections
This fix ensures self-ordering always has the required default user set when the feature is enabled. It prevents customers or staff from seeing access errors when opening kiosk or menu ordering pages after the setting was removed.
Original PR description
When self ordering is enabled, default user should always be set. If it is not the case, self ordering pages would return access error Steps to reproduce: ------------------- * Enable self order (kiosk/menu/menu+ordering) * Remove default user from pos config * Try to open the self order page > Observation: you get an access error opw-4076798 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Incoming emails in very long conversations now check only the most recent message references when deciding which thread they belong to. This avoids inefficient database searches on large systems while preserving normal behavior for typical email threads.
Original PR description
We previously took into account all possible Message-IDs found in the References header of incoming messages. We also don't try to match the `In-Reply-To` header separately, since it is supposed to…
We previously took into account all possible Message-IDs found in the References header of incoming messages. We also don't try to match the `In-Reply-To` header separately, since it is supposed to be appended to the `References` header, when present. This is all specified in RFC5322, section 3.6.4: https://datatracker.ietf.org/doc/html/rfc5322#section-3.6.4 However, for very long threads, the `References` field can contain dozens or even hundreds of previous Message-IDs, even though we generally care only about the last one. This can be an issue for databases with a large number of messages, as the query planner could mistakenly choose a suboptimal plan (e.g. a Seq Scan or filtered Index Scan), rather than looping on the `message_id` index, which is the best plan. Here we truncate the list of References to only include the last 32 ones. For most threads this will make no difference, as they have less than 32 referencs. For very long threads it should still pick up the last known Message-ID without trouble. And if the last 32 messages aren't known by the system, it's unlikely that the message should still be considered part of earlier threads - it's been sidetracked elsewhere. PS: also simplify the `order` clause, as no secondary sort criterion is going to work after `ORDER BY id`.
Fixes an issue in Point of Sale where failed kitchen/change printing could leave old content behind and cause it to appear on the customer's receipt. Receipts now print only the intended order information, reducing confusion for restaurant staff and customers.
Original PR description
If you print changes in a restaurant, then print the receipt of the same order. The receipt would contain the changes. Steps to reproduce: ------------------- * Setup a printer to print changes and give it the IP 0.0.0.0 so that it fails * Open a PoS restaurant * Add some product to the order, and send it in preparation * You will have an error * Pay for the order, and print the receipt with web print > Observation: The changes of the order appears on top of the receipt Why the fix: ------------ This was happening because the content of `render-container` was not emptied. So when trying to print the receipt, the content of the receipt was added to the changes already in the `render-container` opw-4027722 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
- Added Taxes for TDS sale type - Add the withholding control account - Added wizard for creating withholding(TDS) entries for invoice/bill and customer/vendor payment. - Also while creating a withholding(TDS) entry for an invoice/bill it will reconcile the withholding entry. Task - 3326777 Forward-Port-Of: odoo/odoo#168005
Original PR description
- Added Taxes for TDS sale type - Add the withholding control account - Added wizard for creating withholding(TDS) entries for invoice/bill and customer/vendor payment. - Also while creating a withholding(TDS) entry for an invoice/bill it will reconcile the withholding entry. Task - 3326777 Forward-Port-Of: odoo/odoo#168005
Prevent the activity button from overlapping the "See results" button in the ungrouped kanban mode on small screen sizes. Prevent the stats text (registered, completed, passed) from overlapping the separator and the other stats text on medium and larger screen sizes. Task-4061131 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#173639
Original PR description
Prevent the activity button from overlapping the "See results" button in the ungrouped kanban mode on small screen sizes. Prevent the stats text (registered, completed, passed) from overlapping the separator and the other stats text on medium and larger screen sizes. Task-4061131 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#173639
When User opens an appointment with resource that does not have Opening Hours, a traceback will appear. Steps to reproduce the error: - Go to 'Appointments' > Configuration > Resources > Create a new Resource without opening hours (ex. court) > Save - Create new Appointment > Availability on: resources > Resource: court > Save - Click on Go to website or Preview Traceback: ``` AttributeError: 'bool' object has no attribute 'upper' File "odoo/http.py", line 2232, in __call__
Original PR description
When User opens an appointment with resource that does not have Opening Hours, a traceback will appear. Steps to reproduce the error: - Go to 'Appointments' > Configuration > Resources > Create a new…
When User opens an appointment with resource that does not have Opening Hours,
a traceback will appear.
Steps to reproduce the error:
- Go to 'Appointments' > Configuration > Resources >
Create a new Resource without opening hours (ex. court) > Save
- Create new Appointment > Availability on: resources > Resource: court > Save
- Click on Go to website or Preview
Traceback:
```
AttributeError: 'bool' object has no attribute 'upper'
File "odoo/http.py", line 2232, in __call__
response = request._serve_db()
File "odoo/http.py", line 1807, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1827, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1805, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1812, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1950, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 220, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 740, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "home/odoo/src/enterprise/saas-17.2/appointment/controllers/appointment.py", line 210, in appointment_type_page
return self._get_appointment_type_page_view(appointment_type, page_values, state, **kwargs)
File "home/odoo/src/enterprise/saas-17.2/website_appointment/controllers/appointment.py", line 108, in _get_appointment_type_page_view
return super()._get_appointment_type_page_view(appointment_type, page_values, state, **kwargs)
File "home/odoo/src/enterprise/saas-17.2/appointment/controllers/appointment.py", line 228, in _get_appointment_type_page_view
slots = appointment_type._get_appointment_slots(
File "home/odoo/src/enterprise/saas-17.2/appointment/models/appointment_type.py", line 798, in _get_appointment_slots
self._slots_fill_resources_availability(
File "home/odoo/src/enterprise/saas-17.2/appointment/models/appointment_type.py", line 1183, in _slots_fill_resources_availability
availability_values = self._slot_availability_prepare_resources_values(
File "home/odoo/src/enterprise/saas-17.2/appointment/models/appointment_type.py", line 1369, in _slot_availability_prepare_resources_values
resources_values.update(self._slot_availability_prepare_resources_leave_values(resources, start_dt_utc, end_dt_utc))
File "home/odoo/src/enterprise/saas-17.2/appointment/models/appointment_type.py", line 1422, in _slot_availability_prepare_resources_leave_values
unavailabilities = appointment_resources.sudo().resource_id._get_unavailable_intervals(start_dt_utc, end_dt_utc)
File "addons/resource/models/resource_resource.py", line 152, in _get_unavailable_intervals
resources_unavailable_intervals = calendar._unavailable_intervals_batch(start_datetime, end_datetime, resources, tz=timezone(calendar.tz))
File "odoo/tools/_monkeypatches_pytz.py", line 129, in timezone
return original_pytz_timezone(name)
File "__init__.py", line 183, in timezone
if zone.upper() == 'UTC':
```
https://github.com/odoo/odoo/blob/6cb52b4a02a7b3236c20863b177bfaadf474651d/addons/resource/models/resource_resource.py#L147 Here, when the user does not select Opening Hours in resource,
"calendar.tz" will be False.
So, it will lead to the above traceback.
sentry-5475389977
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#169038Steps to reproduce: - My user > Preferences - Set notifications to 'Handle in Odoo' - Lunch > Configuration > Alerts - Add all locations to any alert - Debug mode > Scheduled Action - Manually run your alert An error occurs when trying to access the message thread because none was given. It is expected for messages of type user_notification not to have a thread, but this is never checked on the js side of things. This is because we assume information on the origin should be passed wh
Original PR description
Steps to reproduce: - My user > Preferences - Set notifications to 'Handle in Odoo' - Lunch > Configuration > Alerts - Add all locations to any alert - Debug mode > Scheduled Action - Manually run your alert An error occurs when trying to access the message thread because none was given. It is expected for messages of type user_notification not to have a thread, but this is never checked on the js side of things. This is because we assume information on the origin should be passed when sending the notification, which in this case we did not provide. opw-4057887 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#174394
Prior to this commit, when adding a balancing line, it was incorrectly checked with the session currency instead of the company currency. opw-3985175 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#170359
Original PR description
Prior to this commit, when adding a balancing line, it was incorrectly checked with the session currency instead of the company currency. opw-3985175 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#170359
Versions -------- - 15.0+ Steps ----- 1. Have an employee on a 40 hour/week work schedule; 2. for a past week, create a sick leave for monday & tuesday; 3. create 8 hour timesheets for the remaining weekdays; 4. switch the employee's work schedule to 35 hour/weeks; 4. navigate to the week with the leaves in Timesheets. Issue ----- The hours displayed next to the employee name shows -11:00, ignoring the the timesheets created by the leaves. Cause ----- `resource.calendar.leav
Original PR description
Versions -------- - 15.0+ Steps ----- 1. Have an employee on a 40 hour/week work schedule; 2. for a past week, create a sick leave for monday & tuesday; 3. create 8 hour timesheets for the remaining…
Versions -------- - 15.0+ Steps ----- 1. Have an employee on a 40 hour/week work schedule; 2. for a past week, create a sick leave for monday & tuesday; 3. create 8 hour timesheets for the remaining weekdays; 4. switch the employee's work schedule to 35 hour/weeks; 4. navigate to the week with the leaves in Timesheets. Issue ----- The hours displayed next to the employee name shows -11:00, ignoring the the timesheets created by the leaves. Cause ----- `resource.calendar.leave` records have a `calendar_id` field which is inialized to the resource's calendar, and updates if the resource changes, but not when the resource's calendar changes. As a consequence, the `_work_intervals_batch` method used for this calculation gets called on the employee's new calendar, which is no longer related to the calendar associated with their leaves. Solution -------- Replace the `onchange_resource` method with a compute method which updates the leave's field if the employee's calendar changes. opw-3693131 Forward-Port-Of: odoo/odoo#172346 Forward-Port-Of: odoo/odoo#169291
__Current behavior before commit:__ If `crm` is installed `test_import_multiple_invoices` will fail because the crm demo data are changing the email of the partner `base.res_partner_12` (i.e. Azure Interior)(see [crm_lead_demo.xml][1]). `partner` will therefore be `False`. __Description of the fix:__ Getting `partner` from the `base.res_partner_12` external id so this test does not depend on modifications from other modules. __Steps to reproduce the issue:__ Run: ```sh ./odoo/odoo-bin
Original PR description
__Current behavior before commit:__ If `crm` is installed `test_import_multiple_invoices` will fail because the crm demo data are changing the email of the partner `base.res_partner_12` (i.e. Azure…
__Current behavior before commit:__
If `crm` is installed `test_import_multiple_invoices` will fail because the crm demo data are changing the email of the partner `base.res_partner_12` (i.e. Azure Interior)(see [crm_lead_demo.xml][1]). `partner` will therefore be `False`.
__Description of the fix:__
Getting `partner` from the `base.res_partner_12` external id so this test does not depend on modifications from other modules.
__Steps to reproduce the issue:__
Run:
```sh
./odoo/odoo-bin -d test-17 -i crm,l10n_es --test-tags .test_import_multiple_invoices --addons-path=./enterprise,./odoo/addons
```
You will get:
```log
odoo.addons.l10n_es_edi_facturae.tests.test_edi_xml: FAIL: TestEdiFacturaeXmls.test_import_multiple_invoices
Traceback (most recent call last):
File "/home/odoo/src/odoo/addons/l10n_es_edi_facturae/tests/test_edi_xml.py", line 283, in test_import_multiple_invoices
self.assertRecordValues(moves, [
File "/home/odoo/src/odoo/odoo/tests/common.py", line 659, in assertRecordValues
self.fail('\n'.join(errors))
AssertionError: The records and expected_values do not match.
==== Differences at index 0 ====
---
+++
@@ -1 +1 @@
-partner_id:14
+partner_id:False
==== Differences at index 1 ====
---
+++
@@ -1 +1 @@
-partner_id:14
+partner_id:False
```
opw-4009379
[1]: https://github.com/odoo/odoo/blob/1c8e2555366fe6e6b0d74d6db71a29d09bd5f06a/addons/crm/data/crm_lead_demo.xml#L606
Forward-Port-Of: odoo/odoo#175601
Forward-Port-Of: odoo/odoo#173863Versions -------- - 17.0+ Steps ----- 1. Go to Website / Shop; 2. click on a product; 3. click on the phone icon to get mobile view; 4. open the editor; 5. click on the product image; 6. set Layout / Image Zoom to Both; 7. save. Issue ----- Clicking on the product image doesn't zoom it. Cause ----- Commit 75cb82490200 improved zoom features. In the `_startZoom` function it added a comment to an early return, explaining zoom-on-hover should be ignored on mobile: https://
Original PR description
Versions -------- - 17.0+ Steps ----- 1. Go to Website / Shop; 2. click on a product; 3. click on the phone icon to get mobile view; 4. open the editor; 5. click on the product image; 6. set Layout /…
Versions -------- - 17.0+ Steps ----- 1. Go to Website / Shop; 2. click on a product; 3. click on the phone icon to get mobile view; 4. open the editor; 5. click on the product image; 6. set Layout / Image Zoom to Both; 7. save. Issue ----- Clicking on the product image doesn't zoom it. Cause ----- Commit 75cb82490200 improved zoom features. In the `_startZoom` function it added a comment to an early return, explaining zoom-on-hover should be ignored on mobile: https://github.com/odoo/odoo/blob/75cb824902000b2c05716c8992ec486cf7102cea/addons/website_sale/static/src/js/website_sale.js#L490-L495 The issue is that this function also handles zoom-on-click, which gets skipped as well with the early return. This early return didn't fire in the editor before commit 55f182291164, because it checked the value of `config.device.mobile`, which was `undefined`. After this commit, it checks `uiUtils.isSmall()` instead, which does return true in the editor, fully disabling the ability to zoom-on-click: https://github.com/odoo/odoo/blob/55f1822911641a63309078dbc6dadf0c9fdc0796/addons/website_sale/static/src/js/website_sale.js#L341-L343 Solution -------- Move the check on `uiUtils.isSmall()` from the early return to the `salePage.dataset.ecomZoomAuto` check, so that only zoom-on-hover gets skipped on mobile. opw-3880081 Forward-Port-Of: odoo/odoo#170747
### Steps to reproduce * Switch to a Branch Company * Create a new expense * Try changing the account on the expense You should see that you cannot select accounts from the parent company. ### Cause This occurs because we limit the domain to taxes of the current company, without considering the parent opw-4013699 Forward-Port-Of: odoo/odoo#172391
Original PR description
### Steps to reproduce * Switch to a Branch Company * Create a new expense * Try changing the account on the expense You should see that you cannot select accounts from the parent company. ### Cause This occurs because we limit the domain to taxes of the current company, without considering the parent opw-4013699 Forward-Port-Of: odoo/odoo#172391
Since [1] cover images are implicitly converted to webp. An issue was fixed in [2] because the converted image attachments were not public. This commit fixes another issue: if the cover's record name contains a slash inside its name, the name of the attachment also contains that slash. `_compute_image_src` then puts that slash inside `image_src` which is used to reference the converted image from the website page. But the route does not support delivering such paths. Steps to reproduce: -
Original PR description
Since [1] cover images are implicitly converted to webp. An issue was fixed in [2] because the converted image attachments were not public. This commit fixes another issue: if the cover's record name contains a slash inside its name, the name of the attachment also contains that slash. `_compute_image_src` then puts that slash inside `image_src` which is used to reference the converted image from the website page. But the route does not support delivering such paths. Steps to reproduce: - Create a new blog post. - Name it "A/B Testing". - Upload a JPG image as cover. - Save. => The image was not displayed anymore. [1]: https://github.com/odoo/odoo/commit/068dcc27e417d52b51d274c44497f4388fed780a [2]: https://github.com/odoo/odoo/commit/715eb84a35d27fdbb378fd9937d7439f8619f99c opw-4042913 opw-4047244 opw-4086947 Forward-Port-Of: odoo/odoo#175678 Forward-Port-Of: odoo/odoo#175630
## Description It's really slow to archive a published course with many participants ## Analysis In `_recompute_completion`, we are recomputing the set of resume lines to check against to see if we should add a new resume line upon completion of a course for *each* employee associated with the course. Also the creation of resume lines is not batched. There is also *no* indexes of any sort on the `hr.resume.line` model. ## Solution - Refactor to remove the `search` inside the `for` - B
Original PR description
## Description It's really slow to archive a published course with many participants ## Analysis In `_recompute_completion`, we are recomputing the set of resume lines to check against to see if we…
## Description It's really slow to archive a published course with many participants ## Analysis In `_recompute_completion`, we are recomputing the set of resume lines to check against to see if we should add a new resume line upon completion of a course for *each* employee associated with the course. Also the creation of resume lines is not batched. There is also *no* indexes of any sort on the `hr.resume.line` model. ## Solution - Refactor to remove the `search` inside the `for` - Batch the create - Add missing indexes ## Benchmark Archiving a published course with ~30k participants, with a over 100k resume lines in the database. | No indexes | Before | After | Speed up | |------------|--------|-------|----------| | Timings | 1m39s | 17s | 5.8x | | With indexes | Before | After | Speed up | |--------------|--------|-------|----------| | Timings | 1m39s | 4.14s | 23.9x | ## Reference task-4043098 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#173857
Issue: The `_get_weight` method is called for each location to compute the weight and it sums up all the incoming and outgoing lines for forecasted weight. Using filtered for each record is compute intensive and gets slower over time. While returning a delivery with 30 stock moves the _create_return took 7:41 minutes most of which were on `_get_weight`. Here filtered alone was taking over 6 minutes. 
Original PR description
Issue: The `_get_weight` method is called for each location to compute the weight and it sums up all the incoming and outgoing lines for forecasted weight. Using filtered for each record is compute…
Issue: The `_get_weight` method is called for each location to compute the weight and it sums up all the incoming and outgoing lines for forecasted weight. Using filtered for each record is compute intensive and gets slower over time. While returning a delivery with 30 stock moves the _create_return took 7:41 minutes most of which were on `_get_weight`. Here filtered alone was taking over 6 minutes.  For a single run, || Before| | --------- | ------------- | |Quants| 5474 | |Outgoing Move Lines| 38020 | |Incoming Move Lines| 150935 | |Time| 246.05s | Solution: Optimized the `_get_weight` method to use `read_group` to get the sum of incoming and outgoing lines. This reduces the number of reads. Total time for the same return reduced to 28s.  For a single run: || After| | --------- | ------------- | |Quants| 5474 | |Outgoing Move Lines| 38020 | |Incoming Move Lines| 150935 | |Time| 0.4s | --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#174660 Forward-Port-Of: odoo/odoo#170675
### Version: 15, 16, 17, master ### Description of the issue/feature this PR addresses: Argentinean localization: if a customer invoice with partner with "IVA Responsable Inscripto" AFIP Responsibility is confirmed, then reset to draft and changed the partner to one with "Consumidor Final" AFIP Responsibility, then "Document Type" field is changed and this is not the desired behavior because that field is readonly when the invoice was posted. Compute method should not overried the docume
Original PR description
### Version: 15, 16, 17, master ### Description of the issue/feature this PR addresses: Argentinean localization: if a customer invoice with partner with "IVA Responsable Inscripto" AFIP…
### Version: 15, 16, 17, master ### Description of the issue/feature this PR addresses: Argentinean localization: if a customer invoice with partner with "IVA Responsable Inscripto" AFIP Responsibility is confirmed, then reset to draft and changed the partner to one with "Consumidor Final" AFIP Responsibility, then "Document Type" field is changed and this is not the desired behavior because that field is readonly when the invoice was posted. Compute method should not overried the document type if the invoice was posted before. If it does then an incosistency will occurr because the name, document type and sequence will not match. A new sequence non-real will be used. Also the user it is not aware is happening because the field is readonly. [Video](https://drive.google.com/file/d/1D4uqNnXMkguS813NiLl9td4_f_TJ35Xf/view) showing how to replicate the bug: ### Steps to reproduce: 1. Log in with admin on runbot odoo enterprise 16 instance and install l10n_ar_edi (Argentinean Electronic Invoicing) module. 2. Take position on company "Responsable Inscripto" 3. Go to "Accounting / Customers / Invoices" and create a new customer invoice with customer "ADHOC SA" (this partner has "IVA Responsable Inscripto" AFIP Responsibility), with a sale journal "Pre-printed Invoice" AFIP POS System (i.e Ventas Preimpreso), add an invoice line and confirm it.  4. Reset to draft the invoice mentioned in step 3 (now journal and document type are readonly fields), change customer to "Consumidor Final Anónimo" (this partner has "Consumidor Final" AFIP Responsibility) and save. Check that the document type has changed from "(1) FACTURAS A" to "(6) FACTURAS B" and this is not the desired behavior because is a readonly field now because the invoice was posted before.  ### Current behavior before PR: When a customer invoice with customer with "IVA Responsable Inscripto" AFIP Responsibility is confirmed, then reset to draft and changed the customer to one with "Consumidor Final" AFIP Responsibility, then "Document Type" field is changed and this is not the desired behavior because that field is readonly when the invoice was posted. ### Desired behavior after PR is merged: When a customer invoice with customer with "IVA Responsable Inscripto" AFIP Responsibility is confirmed, then reset to draft and changed the customer to one with "Consumidor Final" AFIP Responsibility, then "Document Type" field is not changed. Ticket Adhoc side: 77058 Task latam: 1235 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#172003
Current behaviour: --- When sending an email through Email Marketing, the icon is right in the preview, but wrong in the received email. Steps to reproduce: --- 1. Install mass_mailing 2. Create a new mailing 3. Select a template with a twitter icon 4. The icon is the new one 5. Click on Test 6. Open the email 7. Wrong icon Cause of the issue: --- Twitter icons have been overriden in fontawesome_overridden.scss However this css is not loaded when writing the src in fontToImg
Original PR description
Current behaviour: --- When sending an email through Email Marketing, the icon is right in the preview, but wrong in the received email. Steps to reproduce: --- 1. Install mass_mailing 2. Create a new mailing 3. Select a template with a twitter icon 4. The icon is the new one 5. Click on Test 6. Open the email 7. Wrong icon Cause of the issue: --- Twitter icons have been overriden in fontawesome_overridden.scss However this css is not loaded when writing the src in fontToImg in convert_inline.js Fix: --- Same fix as for tiktok, forcing a custom font and changing the icon code to match the font (ie: one icon is F099 in FA but E800 in the custom font) opw-3963437 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#173900 Forward-Port-Of: odoo/odoo#170942
Add some logs to log relevant information in various websocket scenarios. Like odoo logs for HTTP request, the completion of the operation is logged in INFO level with the execution time. e.g: `2024-08-02 09:32:20,542 1821 INFO ? odoo.addons.hw_drivers.websocket_client: device 'Virtual_Braille_BRF_Printer' action finished - 0.077` Detailed logs of the websocket message were set in DEBUG Replace the PR: https://github.com/odoo/odoo/pull/169525 to only keep the log part Forward-Port-Of: o
Original PR description
Add some logs to log relevant information in various websocket scenarios. Like odoo logs for HTTP request, the completion of the operation is logged in INFO level with the execution time. e.g: `2024-08-02 09:32:20,542 1821 INFO ? odoo.addons.hw_drivers.websocket_client: device 'Virtual_Braille_BRF_Printer' action finished - 0.077` Detailed logs of the websocket message were set in DEBUG Replace the PR: https://github.com/odoo/odoo/pull/169525 to only keep the log part Forward-Port-Of: odoo/odoo#175577 Forward-Port-Of: odoo/odoo#175497
Issue ---- The german translation for some tax lines for Luxembourg have the wrong format. This makes the line get ignored when generating a XML report. Steps ---- - Install `l10n_lu`. - Change the fiscal country to Luxembourg. - Go to Accounting -> Tax Report. - Choose Tax Report (LU) from the Report button above. - Generate a XML report. - The XML report doesn't have the `767` & `768` codes. Cause ---- Corresponding tax lines are mis-formated. opw-4053595 Forwa
Original PR description
Issue ---- The german translation for some tax lines for Luxembourg have the wrong format. This makes the line get ignored when generating a XML report. Steps ---- - Install `l10n_lu`. - Change the fiscal country to Luxembourg. - Go to Accounting -> Tax Report. - Choose Tax Report (LU) from the Report button above. - Generate a XML report. - The XML report doesn't have the `767` & `768` codes. Cause ---- Corresponding tax lines are mis-formated. opw-4053595 Forward-Port-Of: odoo/odoo#175128 Forward-Port-Of: odoo/odoo#174223
### [FIX] hr_holidays: search for leaves in user's tz For the sake of simplicity we'd assume 3 days: Mon, Tue, Wed. Let's also assume that the everything happens in GMT+10 Now if we have a valid leave allocation for Mon and Tue, we should NOT be able to able to take it on Wed. However, because of the way Timestamps are casted to dates it is possible. It happens as follow: user "asking" server for leave on Wed, defines requested day by passing by the datetimes in the context ranging fr
Original PR description
### [FIX] hr_holidays: search for leaves in user's tz For the sake of simplicity we'd assume 3 days: Mon, Tue, Wed. Let's also assume that the everything happens in GMT+10 Now if we have a valid…
### [FIX] hr_holidays: search for leaves in user's tz
For the sake of simplicity we'd assume 3 days: Mon, Tue, Wed.
Let's also assume that the everything happens in GMT+10
Now if we have a valid leave allocation for Mon and Tue, we should
NOT be able to able to take it on Wed. However, because of the way
Timestamps are casted to dates it is possible. It happens as follow:
user "asking" server for leave on Wed, defines requested day by passing by
the datetimes in the context ranging from Tue 21:00 to Wed 09:00
Why such datetime range? Firstly because we have hardcoded devault values
for events that range from 07:00 to 19:00 in local time (ref.1).
Secondly because we're in GMT+10 so this range gets shifted:
07:00 on Wed becomes 21:00 on Tue
19:00 on Wed becomes 09:00 also on Wed
Then because allocations ranges are defined by dates not datetimes,
implicit casting is performed that causes cut-off of the time from the datetime
and in the end instead of checking if leave is allowed on Wed we check if
it is allowed on Tue and Wed.
### [FIX]
Shifting back into the user's timezone before casting.
### [Reproduction of the original issue]
- install hr_holidays
- create employee E
- create & validate new Allocation A (in TimeOff/Allocations):
- of type T (creating new type will help identify the issue)
- for employee E
- valid from Mon to Tue
- Open E's time off (Employee E -> Time Off)
- Switch your browser TZ that is +10
- Attempt to book time off for E on Wed
- BUG: you are allowed to do so
opw-3850159
(ref.1)
calendarEventToRecord from calendar_model
https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/legacy/js/views/calendar/calendar_model.js#L74-L75

Forward-Port-Of: odoo/odoo#175567
Forward-Port-Of: odoo/odoo#172748Backport of https://github.com/odoo/odoo/pull/169051 opw-3901878 Forward-Port-Of: odoo/odoo#166277
Original PR description
Backport of https://github.com/odoo/odoo/pull/169051 opw-3901878 Forward-Port-Of: odoo/odoo#166277
Before this commit, if an order failed to synchronize due to a concurrent update error, the order would be captured in one process and saved as an attachment in another process. This fix ensures that the attachment is removed when capturing an order that already exists in the database, thereby eliminating unnecessary POS order attachments. opw-4091844 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175668 Forward-Port-Of
Original PR description
Before this commit, if an order failed to synchronize due to a concurrent update error, the order would be captured in one process and saved as an attachment in another process. This fix ensures that the attachment is removed when capturing an order that already exists in the database, thereby eliminating unnecessary POS order attachments. opw-4091844 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175668 Forward-Port-Of: odoo/odoo#175551
When refreshing the PoS when logged in with a cashier would disconnect the cashier. Steps to reproduce: ------------------- * Install pos_hr * Log in as any cashier * Refresh the page > Observation: You are not logged in anymore Why the fix: ------------ We save the current cashier_id in the session storage. This way when we refresh the page we can get it back. We use the session storage instead of local storage because it's specific to one tab. opw-4005556 --- I confirm I ha
Original PR description
When refreshing the PoS when logged in with a cashier would disconnect the cashier. Steps to reproduce: ------------------- * Install pos_hr * Log in as any cashier * Refresh the page > Observation: You are not logged in anymore Why the fix: ------------ We save the current cashier_id in the session storage. This way when we refresh the page we can get it back. We use the session storage instead of local storage because it's specific to one tab. opw-4005556 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175431 Forward-Port-Of: odoo/odoo#174322
## Description On large MOs with many lines, the `onchange` triggered when setting the `lot_producing_id` can be really slow. ## Analysis In `_set_quantity_done`, the `__set__` on `move_line_ids` triggers the computation of fields that depends on it. This necessitates the creation of a trigger tree, to know what fields on what model with what records needs to be recomputed. In this context, because some of the frequent dependencies, `raw_material_production_id` and `production_id` on `stoc
Original PR description
## Description On large MOs with many lines, the `onchange` triggered when setting the `lot_producing_id` can be really slow. ## Analysis In `_set_quantity_done`, the `__set__` on `move_line_ids`…
## Description On large MOs with many lines, the `onchange` triggered when setting the `lot_producing_id` can be really slow. ## Analysis In `_set_quantity_done`, the `__set__` on `move_line_ids` triggers the computation of fields that depends on it. This necessitates the creation of a trigger tree, to know what fields on what model with what records needs to be recomputed. In this context, because some of the frequent dependencies, `raw_material_production_id` and `production_id` on `stock.move` don't have a respective inverse *without* a domain on it, in `_modified_triggers`, we fall back on a generic lookup of cache entries + filtering, which can be costly, as it's `O(n)` in complexity, and `n` can be large, in this case it's over 18k records of `stock.move`, that's done 4 times (the tree has 2 instances for each of the above-mentionned `Many2one`) The process of resolution of the dependencies tree is repeated for each line of the MO, accentuating the bottleneck. ## Solution Adding two `One2many` fields to be the generic inverse of `raw_material_production_id` and `production_id` on `mrp.production`, so the ORM can use those to fall into the fast-path when resolving these dependencies. There are already two `One2many` on this model that are inverse of these `Many2one` (`move_raw_ids` and `move_finished_ids`), but they each have a domain, therefor the ORM cannot use them as an inverse during creation of the trigger tree. ## Benchmarks | | Before | After | |---------|--------|-------| | Timings | 91.8s | 14.1s | ## Reference opw-4003495 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#170881
Following odoo/odoo@ce41d1db9753, we should apply the same `invisible` logic for the new `<div class="o_col">` as the inner field, otherwise that element will still be rendered (even if empty) and will induce a shift - producing misalignment between label and its field. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175670
Original PR description
Following odoo/odoo@ce41d1db9753, we should apply the same `invisible` logic for the new `<div class="o_col">` as the inner field, otherwise that element will still be rendered (even if empty) and will induce a shift - producing misalignment between label and its field. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175670
- Updated the PAN field to be readonly in cases where a parent contact is present. - This ensures consistency and prevents accidental modification of inherited PAN information. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175833
Original PR description
- Updated the PAN field to be readonly in cases where a parent contact is present. - This ensures consistency and prevents accidental modification of inherited PAN information. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175833