Daily updates from Odoo
Friday, June 12, 2026
346 changes
5 changes
Resolved issues and error corrections
This update resolves an issue that caused UBL file imports to fail when a vendor bill contained an empty 'EndpointID' field. The fix ensures the import process is more robust and reliable, preventing errors during invoice processing. This improves the overall stability of our UBL integration.
Original PR description
**Description:** Importing a UBL file (vendor bill) fails if it contains an empty "EndpointID" node. It assumes the node always contains text content to sanitize, but if it is empty, it crashes with: AttributeError: 'NoneType' object has no attribute 'strip'. **Steps to reproduce:** 1. Import a UBL as a bill, with an empty EndpointID node of the other party. 2. The import fails with the AttributeError. opw-6246515 Forward-Port-Of: odoo/odoo#269028
This update fixes an issue where new contacts created without a parent record didn't automatically have a default language assigned. The change ensures that all contacts, regardless of their parent relationship, receive the correct language setting, improving data consistency and reporting accuracy. This resolves a previous bug impacting contact data.
Original PR description
Before this commit, when creating a new crm_lead in the form view, using the res_partner_many2one widget to "Create" or "Create and Edit" a new contact would generate a contact without a set language. This happens because _compute_lang in res_partner currently only runs when the res_partner has a parent_id. This fix allows _compute_lang to be run for res_partner records without a parent_id. This ensures that we properly assign a default language for new contacts, using the proper context or the database default. opw-6126637 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#263440
This update fixes an error in the Colombian DIAN module that incorrectly flagged invoices due to timezone differences. The change ensures invoice dates are validated accurately using Bogota local time, preventing reporting issues with DIAN. This improves compliance and data accuracy for Colombian businesses.
Original PR description
**Steps to reproduce:** * Install `l10n_co_edi` module with DEMO DIAN mode enabled. * Go to Accounting > Vendor > Bills and create a new bill. * Select any Colombian partner different from…
**Steps to reproduce:** * Install `l10n_co_edi` module with DEMO DIAN mode enabled. * Go to Accounting > Vendor > Bills and create a new bill. * Select any Colombian partner different from `Consumidor Final`. * Set the invoice date to 6 days in the past. * Select the DIAN Support Documents journal and a product with UNSPSC category. * Confirm the bill and click `Send Support Document to DIAN` after 5 PM Colombia time. **Observed behavior:** * An error is raised stating the issue date cannot be older than 6 days or more than 6 days in the future, even though the invoice date is within the allowed window in Colombia local time. **Cause:** * The date window validation in `_check_move_configuration` used `fields.Datetime.now()` which returns UTC time. Since Colombia is UTC-5, after 5 PM local time the UTC clock has already rolled over to the next calendar day, making a 6-day-old invoice appear 7 days old and failing the validation incorrectly. **Fix:** * Convert the current UTC datetime to the `America/Bogota` timezone and extract its local date before computing the allowed date window. * Compare directly against `move.invoice_date` (a `date` field) instead of using `fields.Datetime.to_datetime()`, keeping the comparison consistent as `date` vs `date`. opw-6011502 Forward-Port-Of: odoo/enterprise#120384 Forward-Port-Of: odoo/enterprise#115256
This update resolves an issue where account reassignments (moving accounts between companies) caused errors during chart of accounts reloading. The fix ensures that the system correctly identifies if an account is still associated with the target company, preventing errors and ensuring accurate account data is loaded.
Original PR description
When reloading a chart of accounts, `_pre_reload_data` resolves an account via its xmlid and then evaluates: ```py re.match(f'^{values["code"]}0*$', account.code) ``` `account.code` is a non-stored…
When reloading a chart of accounts, `_pre_reload_data` resolves an account via its xmlid and then evaluates:
```py
re.match(f'^{values["code"]}0*$', account.code)
```
`account.code` is a non-stored computed field that reads from the company-dependent field `code_store`. If the resolved account has no `code_store` entry for the target company (e.g. the account was originally set up under a different company but its xmlid was prefixed with the current company id), `_compute_code` returns False instead of a string, causing a TypeError in re.match.
```py
File "/home/odoo/src/odoo/19.0/addons/account/models/chart_template.py", line 442, in _pre_reload_data
if not account or not re.match(f'^{values["code"]}0*$', account.code):
File "/usr/lib/python3.10/re.py", line 190, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
```
```sql
apan_4342860=> SELECT
aa.id,
aa.code_store,
imd.module,
imd.name
FROM account_account aa
JOIN ir_model_data imd
ON imd.res_id = aa.id
AND imd.model = 'account.account'
WHERE aa.id = 1056;
id | code_store | module | name
------+-----------------+---------+-----------------
1056 | {"2": "510500"} | account | 1_co_puc_510500
(1 row)
```
This situation arises when a customer moves or reassigns an account between companies but the xmlid retains the original company prefix.
**Fix:**
After resolving the account via xmlid, check whether it actually belongs to the target company using filtered_domain with _check_company_domain. If it does not pass the check, unlink the stale ir.model.data entry and treat the account as not found, allowing the reload to re-establish the correct xmlid linkage via the code-based lookup that follows.
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#269696
Forward-Port-Of: odoo/odoo#269291This update simplifies invoice sending by automatically defaulting to the 'By Peppol' method only for customers in designated countries (GR, IT, PL, PO, RO). Previously, this setting was enabled by default for all customers, causing confusion and unnecessary notifications for users in these regions. This change streamlines the invoicing process and improves user experience.
Original PR description
Current behavior before PR: - If the customer has a valid Peppol endpoint, the 'By Peppol' invoice sending method is selected by default. - For countries like 'GR,' 'IT,' 'PL,' 'PO,' and 'RO,' peppol is not mandatory or not used for sending invoice. It brings noise and it bothers the users. Desired behavior after PR is merged: - The 'By Peppol' invoice sending method is set to true by default only for customers from PEPPOL_DEFAULT_COUNTRIES. Changes Implemented: - Moved the countries 'GR', 'IT, 'PL', 'PO', and 'RO' from PEPPOL_DEFAULT_COUNTRIES to PEPPOL_LIST. - Added condition to set 'By Peppol' invoice sending method to true when customer is from PEPPOL_DEFAULT_COUNTRIES. task-6072935 Forward-Port-Of: odoo/odoo#269417 Forward-Port-Of: odoo/odoo#262402
7 changes
Enhancements to existing features
This update simplifies invoice sending by automatically defaulting to the 'By Peppol' method only for customers in designated countries (GR, IT, PL, PO, RO). Previously, this setting was enabled by default for all customers, causing confusion and unnecessary steps for users in these regions. This change streamlines the invoicing process and improves user experience.
Original PR description
Current behavior before PR: - If the customer has a valid Peppol endpoint, the 'By Peppol' invoice sending method is selected by default. - For countries like 'GR,' 'IT,' 'PL,' 'PO,' and 'RO,' peppol is not mandatory or not used for sending invoice. It brings noise and it bothers the users. Desired behavior after PR is merged: - The 'By Peppol' invoice sending method is set to true by default only for customers from PEPPOL_DEFAULT_COUNTRIES. Changes Implemented: - Moved the countries 'GR', 'IT, 'PL', 'PO', and 'RO' from PEPPOL_DEFAULT_COUNTRIES to PEPPOL_LIST. - Added condition to set 'By Peppol' invoice sending method to true when customer is from PEPPOL_DEFAULT_COUNTRIES. task-6072935 Forward-Port-Of: odoo/odoo#269417 Forward-Port-Of: odoo/odoo#262402
Resolved issues and error corrections
This fix ensures that multi-line text in PoS receipt headers and footers is properly formatted, preserving line breaks as intended. A recent change inadvertently removed formatting, causing text to be displayed on a single line. This update restores the correct display, improving the appearance of printed receipts.
Original PR description
Steps to reproduce ------------------ 1. Open PoS settings, set a multi-line receipt header and footer. 2. Open PoS, pay an order and print the receipt. -> The lines of the header and footer end up on the same line, instead of keeping the line breaks. Example when setting footer to ``` ------ Footer ------ ``` It will show up on the receipt as ``` ------Footer------ ``` Why it's happening ------------------ The refactor commit aeaca097ae39 mistakenly dropped the `style="white-space:pre-line"` for the header and footer templates. The fix ------- Add back `style="white-space:pre-line"` back for both the header and the footer divs. opw-6222055
This update resolves an issue where account reloading failed when an account's XMLID still referenced its original company. The fix ensures the system correctly verifies the account belongs to the current company before reloading, preventing errors and ensuring accurate chart of accounts data. This improves stability and data integrity during company transitions.
Original PR description
When reloading a chart of accounts, `_pre_reload_data` resolves an account via its xmlid and then evaluates: ```py re.match(f'^{values["code"]}0*$', account.code) ``` `account.code` is a non-stored…
When reloading a chart of accounts, `_pre_reload_data` resolves an account via its xmlid and then evaluates:
```py
re.match(f'^{values["code"]}0*$', account.code)
```
`account.code` is a non-stored computed field that reads from the company-dependent field `code_store`. If the resolved account has no `code_store` entry for the target company (e.g. the account was originally set up under a different company but its xmlid was prefixed with the current company id), `_compute_code` returns False instead of a string, causing a TypeError in re.match.
```py
File "/home/odoo/src/odoo/19.0/addons/account/models/chart_template.py", line 442, in _pre_reload_data
if not account or not re.match(f'^{values["code"]}0*$', account.code):
File "/usr/lib/python3.10/re.py", line 190, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
```
```sql
apan_4342860=> SELECT
aa.id,
aa.code_store,
imd.module,
imd.name
FROM account_account aa
JOIN ir_model_data imd
ON imd.res_id = aa.id
AND imd.model = 'account.account'
WHERE aa.id = 1056;
id | code_store | module | name
------+-----------------+---------+-----------------
1056 | {"2": "510500"} | account | 1_co_puc_510500
(1 row)
```
This situation arises when a customer moves or reassigns an account between companies but the xmlid retains the original company prefix.
**Fix:**
After resolving the account via xmlid, check whether it actually belongs to the target company using filtered_domain with _check_company_domain. If it does not pass the check, unlink the stale ir.model.data entry and treat the account as not found, allowing the reload to re-establish the correct xmlid linkage via the code-based lookup that follows.
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#269696
Forward-Port-Of: odoo/odoo#269291This update resolves an issue where Odoo's UBL bill import process would fail if a vendor's invoice contained an empty 'EndpointID' field. The fix ensures the import process is more robust and reliable when dealing with diverse UBL file formats, preventing import failures.
Original PR description
**Description:** Importing a UBL file (vendor bill) fails if it contains an empty "EndpointID" node. It assumes the node always contains text content to sanitize, but if it is empty, it crashes with: AttributeError: 'NoneType' object has no attribute 'strip'. **Steps to reproduce:** 1. Import a UBL as a bill, with an empty EndpointID node of the other party. 2. The import fails with the AttributeError. opw-6246515 Forward-Port-Of: odoo/odoo#269028
This update fixes an issue where new contacts created without a parent record didn't automatically have a default language assigned. The change ensures that all contacts, regardless of their parent relationship, receive a properly set language, improving data consistency and reporting accuracy. This prevents potential errors when using contact information.
Original PR description
Before this commit, when creating a new crm_lead in the form view, using the res_partner_many2one widget to "Create" or "Create and Edit" a new contact would generate a contact without a set language. This happens because _compute_lang in res_partner currently only runs when the res_partner has a parent_id. This fix allows _compute_lang to be run for res_partner records without a parent_id. This ensures that we properly assign a default language for new contacts, using the proper context or the database default. opw-6126637 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#263440
This update fixes a bug preventing the 'Due' button from appearing on customer forms when balances exist at the line level of journal entries. The fix ensures all customers, regardless of how they're linked to accounting records, can see outstanding balance notifications. This improves the user experience for managing accounts.
Original PR description
Steps to Reproduce: 1. Install Accounting module (without Point of Sale). 2. Create a customer. 3. Create a journal entry with that customer set only at line level. 4. Post the journal entry. 5. Open…
Steps to Reproduce: 1. Install Accounting module (without Point of Sale). 2. Create a customer. 3. Create a journal entry with that customer set only at line level. 4. Post the journal entry. 5. Open the customer form. Issue: The Due smart button is not visible on the partner form even though an outstanding balance exists for the customer. Note: This issue does not reproduce when Point of Sale is installed, as the POS module overrides `_compute_has_moves` with its own implementation that checks the outstanding balance directly. Root Cause: The `_compute_has_moves` method queries only `account.move `for partner matching. When a partner is referenced only at the account.move.line level, the partner is never picked up by this query, resulting in `has_moves = False` and the Due button remaining hidden. Fix: Replaced the EXISTS-based implementation with a UNION-based approach as the EXISTS implementation evaluated the query per partner row, whereas UNION processes all partners in a single batch query. Additionally extended the UNION to also include account.move.line partner matching, ensuring partners referenced only at the line level, are correctly detected and has_moves is set to True. Result: The Due smart button is now correctly visible for all partners with an outstanding balance, regardless of whether the partner is set at the journal entry level or only at the line level. owp = 6243562 Forward-Port-Of: odoo/enterprise#120294 Forward-Port-Of: odoo/enterprise#119084
This update resolves an issue where report customizations made in Odoo's Studio were incorrectly applied to other reports, leading to unexpected behavior and potential rendering problems. The fix ensures that report edits are now saved within the specific report document, preventing these issues and improving Studio's reliability.
Original PR description
Report edits could be applied on shared layouts such as web.basic_layout instead of the report-specific document view. This caused Studio customization diffs to affect unrelated reports and could…
Report edits could be applied on shared layouts such as web.basic_layout instead of the report-specific document view. This caused Studio customization diffs to affect unrelated reports and could also lead to rendering errors when report-specific fields were evaluated in a different report context. The issue occurred because content was inserted directly into the shared layout article section instead of the nested report document view. Steps to reproduce: 1. Open Studio on any module and create or edit a report. 2. Select any of the External, Minimal, or Blank report types. 3. Add content to the report body and save the report. 4. Open another module and create a report using the same report type. 5. Observe that the previous customization is already present. Before this fix, the generated diff could inherit from web.basic_layout. After this fix, body edits are kept inside the report-specific document view. Related Ticket: opw-6245485 Forward-Port-Of: odoo/enterprise#120299 Forward-Port-Of: odoo/enterprise#118880
7 changes
Resolved issues and error corrections
This update ensures that stock reports automatically print when a Point of Sale order is validated. Previously, the print job wasn't triggered, but this change adds a system to retrieve and execute report actions, streamlining the reporting process for POS transactions. This improves the efficiency of stock management reporting.
Original PR description
Validating a `pos.order` creates a stock move in inventory. However, when configuring reports to automatically print on validation, the print job wasn't triggered from the pos. We added a way to retrieve report actions and execute them. Task: 5392414 Forward-Port-Of: odoo/odoo#239084
This update resolves an issue that caused UBL file imports to fail when a vendor bill contained an empty "EndpointID" field. The fix ensures the import process is more robust and reliable, preventing crashes due to unexpected data formats. This improves the overall stability of our UBL billing integration.
Original PR description
**Description:** Importing a UBL file (vendor bill) fails if it contains an empty "EndpointID" node. It assumes the node always contains text content to sanitize, but if it is empty, it crashes with: AttributeError: 'NoneType' object has no attribute 'strip'. **Steps to reproduce:** 1. Import a UBL as a bill, with an empty EndpointID node of the other party. 2. The import fails with the AttributeError. opw-6246515 Forward-Port-Of: odoo/odoo#269028
This update fixes an issue where new contacts created without a parent record didn't automatically have a default language assigned. The change ensures that all contacts, regardless of their parent relationship, receive the correct language setting, improving data consistency and reporting accuracy. This resolves a previous bug impacting contact data.
Original PR description
Before this commit, when creating a new crm_lead in the form view, using the res_partner_many2one widget to "Create" or "Create and Edit" a new contact would generate a contact without a set language. This happens because _compute_lang in res_partner currently only runs when the res_partner has a parent_id. This fix allows _compute_lang to be run for res_partner records without a parent_id. This ensures that we properly assign a default language for new contacts, using the proper context or the database default. opw-6126637 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#263440
This update optimizes how Odoo retrieves related mailings for testing, addressing a performance bottleneck that caused crashes with large campaigns. The change significantly improves the speed and stability of mass mailing operations, particularly when dealing with numerous or complex campaigns. This resolves a technical issue impacting campaign efficiency.
Original PR description
**Description of the issue/feature this PR addresses:** The method _get_ab_testing_siblings_mailings currently scans all mailings in a campaign to apply a simple filter, which becomes expensive on databases with many large mailings. **Steps to reproduce bug:** 1) Run this script to get [enough sufficiently large mailings](https://gist.github.com/brcut-odoo/bb0d6d334bfe110afe16021d17d1b443) 2) Open one of the mailings and recieve a crash from the _get_ab_testing_siblings_mailings **Current behavior before PR** https://drive.google.com/file/d/19xftvzsGSQ9DxB67LNiLkKApzsD192ax/view?usp=drive_link **Current behavior after PR** https://drive.google.com/file/d/1apTJ0rWTKaATYa67ZmmN-7bKhrw4KuTx/view?usp=drive_link opw-6245908 Forward-Port-Of: odoo/odoo#268283
This update simplifies invoice sending by automatically defaulting to the 'By Peppol' method only for customers in designated countries (GR, IT, PL, PO, RO). Previously, this setting was enabled by default for all customers, causing confusion and unnecessary steps for users in these regions. This change streamlines the process and improves the user experience.
Original PR description
Current behavior before PR: - If the customer has a valid Peppol endpoint, the 'By Peppol' invoice sending method is selected by default. - For countries like 'GR,' 'IT,' 'PL,' 'PO,' and 'RO,' peppol is not mandatory or not used for sending invoice. It brings noise and it bothers the users. Desired behavior after PR is merged: - The 'By Peppol' invoice sending method is set to true by default only for customers from PEPPOL_DEFAULT_COUNTRIES. Changes Implemented: - Moved the countries 'GR', 'IT, 'PL', 'PO', and 'RO' from PEPPOL_DEFAULT_COUNTRIES to PEPPOL_LIST. - Added condition to set 'By Peppol' invoice sending method to true when customer is from PEPPOL_DEFAULT_COUNTRIES. task-6072935 Forward-Port-Of: odoo/odoo#269417 Forward-Port-Of: odoo/odoo#262402
This update fixes a bug where the 'Due' button wasn't appearing for customers when their outstanding balance existed, specifically when the customer was only linked through a journal entry line. The fix ensures all customers with balances are correctly identified, regardless of how they're linked to accounting records.
Original PR description
Steps to Reproduce: 1. Install Accounting module (without Point of Sale). 2. Create a customer. 3. Create a journal entry with that customer set only at line level. 4. Post the journal entry. 5. Open…
Steps to Reproduce: 1. Install Accounting module (without Point of Sale). 2. Create a customer. 3. Create a journal entry with that customer set only at line level. 4. Post the journal entry. 5. Open the customer form. Issue: The Due smart button is not visible on the partner form even though an outstanding balance exists for the customer. Note: This issue does not reproduce when Point of Sale is installed, as the POS module overrides `_compute_has_moves` with its own implementation that checks the outstanding balance directly. Root Cause: The `_compute_has_moves` method queries only `account.move `for partner matching. When a partner is referenced only at the account.move.line level, the partner is never picked up by this query, resulting in `has_moves = False` and the Due button remaining hidden. Fix: Replaced the EXISTS-based implementation with a UNION-based approach as the EXISTS implementation evaluated the query per partner row, whereas UNION processes all partners in a single batch query. Additionally extended the UNION to also include account.move.line partner matching, ensuring partners referenced only at the line level, are correctly detected and has_moves is set to True. Result: The Due smart button is now correctly visible for all partners with an outstanding balance, regardless of whether the partner is set at the journal entry level or only at the line level. owp = 6243562 Forward-Port-Of: odoo/enterprise#120294 Forward-Port-Of: odoo/enterprise#119084
Code cleanup and technical improvements
This update simplifies the bank reconciliation process within Odoo Enterprise. The underlying code has been reorganized to enhance readability and maintainability, making it easier for developers to understand and update. This change focuses on internal code improvements, ensuring the continued reliability of bank reconciliation functionality.
Original PR description
Reworked the try_auto_reconcile function to make it more readable by creating helper functions and splitting the function into multiple smaller ones. task-6171727 Forward-Port-Of: odoo/enterprise#116958
1 change
Resolved issues and error corrections
This update resolves an error that occurred when calculating payroll for employees with contracts exceeding 35 years. The fix adjusts a key parameter in the payroll rules to accommodate Mexican labor law, specifically allowing for seniority beyond 35 years. This ensures accurate payroll calculations for all employees.
Original PR description
**Steps to reproduce:** 1. Install l10n_mx_hr_payroll. 2. Create an employee with a contract date over 35 years ago (e.g., 1985). 3. Create a payslip for this employee. 4. Click on "Compute Sheet".…
**Steps to reproduce:**
1. Install l10n_mx_hr_payroll.
2. Create an employee with a contract date over 35 years ago (e.g., 1985).
3. Create a payslip for this employee.
4. Click on "Compute Sheet".
```Error: KeyError(36) while evaluating```
**Cause:**
The rule parameter [rule_parameter_holiday_table](https://github.com/odoo/enterprise/blob/c02c4571bb7db7197b07539ba390d4d20fdce9fe/l10n_mx_hr_payroll/data/hr_rule_parameters_data.xml#L722-L758) defines values
only up to 35 years. Seniority exceeding this range causes a KeyError.
**Solution:**
Extended the `rule_parameter_holiday_2024` table from 35 to 60 years,
following the Mexican Federal Labor Law (LFT) reform formula
(+2 days every 5-year milestone from year 6 onwards).
**NOTE:**(Alternative approach)
```python
@staticmethod
def _get_mx_holiday_days(years_worked):
if years_worked <= 0:
return 0
if years_worked <= 5:
return 12 + (years_worked - 1) * 2
five_year_periods = (years_worked - 6) // 5
return 22 + five_year_periods * 2
```
This approach removes the need for XML data maintenance and handles
all future seniority values mathematically without any cap issues.
opw-6090590
Forward-Port-Of: odoo/enterprise#1135361 change
Resolved issues and error corrections
This update fixes an issue where taxes were not being saved correctly when editing POS orders in the backend (like during returns). The change ensures that tax information is consistently saved during order modifications, preventing data loss and maintaining accurate financial reporting. This improves the reliability of POS order processing.
Original PR description
The `tax_ids` field on `pos.order.line` is defined with `readonly=True`. When editing a POS order from the backend (e.g. during a return/exchange flow), the `_onchange_product_id` method correctly…
The `tax_ids` field on `pos.order.line` is defined with `readonly=True`. When editing a POS order from the backend (e.g. during a return/exchange flow), the `_onchange_product_id` method correctly sets `tax_ids` from the product, and the computed `tax_ids_after_fiscal_position` displays the mapped taxes in the UI. However, because `tax_ids` is readonly, the web client does not include it in the save payload. As a result, the taxes are silently dropped on save and `tax_ids_after_fiscal_position` recomputes to empty. Steps to reproduce: 1. Create and pay a POS order with a product that has taxes 2. Go to the backend (Point of Sale > Orders) and open that order 3. Initiate a return for the order 4. In the return order, add a new product (exchange scenario) 5. Observe that taxes are correctly shown on the new line 6. Click Save 7. The taxes disappear from the order line The fix adds `force_save="1"` to the `tax_ids` field in both the list and form views of `pos.order.line`, consistent with how `price_subtotal` and `price_subtotal_incl` are already handled in the same views. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261103 Forward-Port-Of: odoo/odoo#253680
1 change
Resolved issues and error corrections
This update resolves an error that occurred when generating payslips for employees with contracts exceeding 35 years. The fix adjusts a key parameter in the payroll rules to correctly calculate holiday accrual for employees aged 60 and older, aligning with Mexican labor law. This ensures accurate payslip generation and avoids calculation errors.
Original PR description
**Steps to reproduce:** 1. Install l10n_mx_hr_payroll. 2. Create an employee with a contract date over 35 years ago (e.g., 1985). 3. Create a payslip for this employee. 4. Click on "Compute Sheet".…
**Steps to reproduce:**
1. Install l10n_mx_hr_payroll.
2. Create an employee with a contract date over 35 years ago (e.g., 1985).
3. Create a payslip for this employee.
4. Click on "Compute Sheet".
```Error: KeyError(36) while evaluating```
**Cause:**
The rule parameter [rule_parameter_holiday_table](https://github.com/odoo/enterprise/blob/c02c4571bb7db7197b07539ba390d4d20fdce9fe/l10n_mx_hr_payroll/data/hr_rule_parameters_data.xml#L722-L758) defines values
only up to 35 years. Seniority exceeding this range causes a KeyError.
**Solution:**
Extended the `rule_parameter_holiday_2024` table from 35 to 60 years,
following the Mexican Federal Labor Law (LFT) reform formula
(+2 days every 5-year milestone from year 6 onwards).
**NOTE:**(Alternative approach)
```python
@staticmethod
def _get_mx_holiday_days(years_worked):
if years_worked <= 0:
return 0
if years_worked <= 5:
return 12 + (years_worked - 1) * 2
five_year_periods = (years_worked - 6) // 5
return 22 + five_year_periods * 2
```
This approach removes the need for XML data maintenance and handles
all future seniority values mathematically without any cap issues.
opw-6090590
Forward-Port-Of: odoo/enterprise#11353618 changes
Resolved issues and error corrections
This update significantly speeds up the process of adding and removing participants from marketing campaigns, particularly for large campaigns. By optimizing the underlying code, the sync time has been reduced from over 51 seconds to just 0.65 seconds. This improves campaign management efficiency and responsiveness.
Original PR description
Replace search_read with search_fetch to avoid unnecessary _read_format call in backend context. Use OrderedSet instead of a custom _uniquify_list helper to get O(1) membership tests when computing records to add or remove from campaigns. Benchmark on a campaign with 115k participants: | Before PR | After PR | |:---------:|:--------:| | 51.71s | 0.652s | opw-6055334 Forward-Port-Of: odoo/enterprise#119589 Forward-Port-Of: odoo/enterprise#117656
This update resolves an issue where uploading fillable PDFs with no data caused a system error. The fix prevents a crash when a PDF has no filled-in fields, ensuring PDFs are generated correctly. This improves the reliability of PDF generation within the system.
Original PR description
Version: 19.0 Issue: - Uploading a fillable PDF with no filled-in values caused an error. Cause: - When all form fields are empty, nothing is drawn on the ReportLab overlay canvas, producing a 0-page PDF. - Calling getPage(0) on an empty page list raised an IndexError. Fix: - Skip the page merge when the overlay has no pages to avoid the IndexError on empty fillable forms. Forward-Port-Of: odoo/enterprise#119903 Forward-Port-Of: odoo/enterprise#119677
This update resolves an issue where marking workorders as done would generate a traceback when no workorders were open. The fix ensures the system handles empty recordsets gracefully, preventing errors and maintaining stable operation. This improves the reliability of the MRP workorder process.
Original PR description
When calling on a empty recordset action_mark_as_done, it creates a traceback. **Observation** When calling action_mark_as_done, the method first loops over each workorder to perform various safety…
When calling on a empty recordset action_mark_as_done, it creates a traceback. **Observation** When calling action_mark_as_done, the method first loops over each workorder to perform various safety checks, and then calls button_finish to close all workorders: https://github.com/odoo/enterprise/blob/24008b550c5e7cf04cde2028c40f8a32d5b0e504/mrp_workorder/models/mrp_workorder.py#L881-L888 Inside button_finish, it retrieves all open workorders and marks them as done: - Retrieve open workorders: https://github.com/odoo/odoo/blob/36a1c6300f52f408b6af3f769e26686e07810e5a/addons/mrp/models/mrp_workorder.py#L659 - mark them as done: https://github.com/odoo/odoo/blob/36a1c6300f52f408b6af3f769e26686e07810e5a/addons/mrp/models/mrp_workorder.py#L675-L678 Returning to action_mark_as_done, it attempts to set the state to 'done' on the last workorder outside of the loop, referencing the loop variable: https://github.com/odoo/enterprise/blob/24008b550c5e7cf04cde2028c40f8a32d5b0e504/mrp_workorder/models/mrp_workorder.py#L894 -> If self is empty, the loop never executes. This leaves the loop variable empty, which ultimately triggers a traceback. opw-6239910 Forward-Port-Of: odoo/enterprise#118718 Forward-Port-Of: odoo/enterprise#118403
A minor typo in the displayed name of the Sendcloud website delivery module has been fixed. This ensures accurate identification and avoids confusion for users. No other changes were required as all other references to the module were correct.
Original PR description
The displayed name contained a typo ("Sendcould" instead of "Sendcloud") All other references already use the correct spelling, so no further changes were necessary.
opw-6239003
Forward-Port-Of: odoo/enterprise#118416
Forward-Port-Of: odoo/enterprise#118223This update fixes a bug in the account reports module that caused the growth comparison percentage to incorrectly change when users switched the period order. The fix ensures the calculation remains consistent regardless of the selected period sequence, providing more reliable reporting.
Original PR description
The feature had originally been implemnted at a time where the period_order couldn't be modified, and always corresponded to what we call 'descending' now. Because of that, we assumed the column at index 0 was always the most recent period ; which caused the growth comparison percentage to change when switching period order. Forward-Port-Of: odoo/enterprise#119782 Forward-Port-Of: odoo/enterprise#118835
This update corrects a technical issue that was preventing the correct generation of French VAT reports. Specifically, a formatting error in the XML data caused a failure when the 'street' field was short and 'street 2' was not used. This ensures accurate report output for French businesses.
Original PR description
When the street field is shorter than 30 char and street 2 is false, we end up with " False" in the xml, which will return an error in aspone. no task id Forward-Port-Of: odoo/enterprise#119718
This update resolves a frustrating error users without accounting access were experiencing in the command palette. Previously, an 'Access Error' would appear when attempting to use accounting report commands. Now, the system checks user permissions and returns an empty list if access isn't granted, preventing the disruptive error message.
Original PR description
…n-accounting users Before this commit, users without accounting access rights would encounter an "Access Error" when typing in the command palette. This occurred because the 'account_report_variants' command provider was registered in the global namespace and unconditionally executed an RPC call to (get_available_variants) as soon as the user typed two or more characters. The backend ACLs correctly blocked this request, but resulted in a disruptive error dialog for the user. This commit fixes the issue by verifying that the user has access to the accounting reports or the acounting app, if they don't it would return an empty list. Steps to reproduce the bug: 1. Log in as admin 2. Go to the Users view 3. Set ESG to 'No' 4. Set Accounting to 'No' 5. Refresh the page 6. Open and use the command palette -> Access Error: You are not allowed to access 'Accounting Report' records. task: 6246337 m Forward-Port-Of: odoo/enterprise#119879
This update fixes a bug that occurred when users tried to add recurring products to confirmed sales orders without a linked subscription plan. The change prevents this action, avoiding errors and ensuring data integrity by validating the subscription plan before processing recurring product additions.
Original PR description
Steps to reproduce: - Go to Sales → Products. - Create a Service product and enable the Recurring option. - Open an already confirmed Sales Order that does not contain any recurring products. - Add the newly created recurring product to the confirmed order. - Click Save. - Observe that a traceback occurs. Cause: - When adding a recurring product without a subscription plan to a confirmed Sale Order, _timesheet_create_task() attempts to compute a start date using order.next_invoice_date, which is not set. - This leads to a TypeError when `order.next_invoice_date` receives `False`. Solution: - Add a validation to prevent adding recurring products without a subscription plan and raise a proper `UserError` instead of allowing the code to reach task generation logic. task-5932700 Forward-Port-Of: odoo/enterprise#119955 Forward-Port-Of: odoo/enterprise#107691
This update fixes a bug that prevented worked day lines from being generated for employees using attendance-based work schedules. The change ensures that payroll calculations accurately reflect employee hours, regardless of their flexible working arrangements. This improves payroll accuracy and reporting for all employees.
Original PR description
### **Steps to reproduce:** - Install Payroll and Attendance apps. - Create an employee with a flexible working schedule and work entry source as attendance. - Create an attendance record for this…
### **Steps to reproduce:** - Install Payroll and Attendance apps. - Create an employee with a flexible working schedule and work entry source as attendance. - Create an attendance record for this employee. - Create and compute a payslip for this employee. ### **Observed Behavior:** Worked Day lines are not generated, and Basic Wage is calculated as 0. ### **Expected Behavior:** Worked Day lines should be populated based on attendance records. ### **Root Cause:** During payslip computation, [_compute_worked_days_line_ids](https://github.com/odoo/enterprise/blob/4339010eb1e1633a67573d08e032f3922b0bec49/hr_payroll/models/hr_payslip.py#L1846) only generated work entries for versions having a `resource_calendar_id` at [1]. As a result, fully flexible employees without a working schedule were excluded from work entry generation, preventing worked day lines from being computed. [1]- https://github.com/odoo/enterprise/blob/4339010eb1e1633a67573d08e032f3922b0bec49/hr_payroll/models/hr_payslip.py#L1890-L1898 ### **Fix:** Remove the `resource_calendar_id` filter when calling `generate_work_entries` in `_compute_worked_days_line_ids` so work entries are also generated for fully flexible employees using attendance-based work entries. **opw-6146452** Forward-Port-Of: odoo/enterprise#119673 Forward-Port-Of: odoo/enterprise#117409
This update corrects a bug where order filters on the Ticket Screen in Point of Sale weren't updating correctly when a different provider state was selected. The fix ensures that the Ticket Screen reloads with the correct filters, allowing users to accurately view and manage orders from UrbanPiper. This improves the reliability of order management within the POS system.
Original PR description
Steps to Reproduce ------------------------- - Install Point of Sale and configure UrbanPiper. - Open a POS session and select a provider state from the notification popup to review orders. - While on the Ticket Screen, select a different provider state to review other orders. Issue ------- - Orders are not updated according to the newly selected state. - Previously applied filters remain unchanged. Cause -------- - Since the user is already on the Ticket Screen, changing only the provider state does not trigger a re-render. - The page was already rendered with the old filters. Fix ---- - The Ticket Screen is first switched away and then re-rendered. - This forces the screen to reload with the updated state and filters. Task: 6079663 Forward-Port-Of: odoo/enterprise#119906 Forward-Port-Of: odoo/enterprise#104546
This update resolves an issue where the default journal selection was unreliable when using CODA. The system now manages two journals, prioritizing the one with the correct currency, ensuring accurate financial reporting. This change improves data integrity and aligns with CODA currency requirements.
Original PR description
The journals[0] is not ideal if the user has one journal with no currency and one with currency that fits the CODA's currency. We'll have two journals and we take the first one at random. Thus if it has a lower id, the journal with no currency will be selected instead of the one whose currency is correct. The latter should take precedence over the former. task-6226835 Forward-Port-Of: odoo/enterprise#118381
This update corrects a technical issue preventing the accurate generation of BIR 2306/2307 tax certificates for businesses using FWVAT group taxes. The change expanded the tax lookup to include 'group tax children' which were previously excluded, ensuring correct tax identification. This resolves a reporting discrepancy impacting tax compliance.
Original PR description
The `_get_l10n_ph_tax_ids` method only searched for taxes with type_tax_use='purchase', excluding group tax children which use type_tax_use='none'. This broke BIR 2306/2307 certificate generation for FWVAT group taxes. The ATC code and description matching already ensure the correct tax is found. task-6146238
This update resolves an issue where sign requests scheduled for the future were immediately visible on the portal to the signer. The fix correctly filters out scheduled requests, ensuring that requests only appear when they are ready to be signed.
Original PR description
## Issue When scheduling a sign request, the request appears immediately on the portal for the requested signer. ## Steps to reproduce 1. Install *Sign* (`sign`) 2. Create and send a sign request -…
## Issue
When scheduling a sign request, the request appears immediately on the portal for the requested signer.
## Steps to reproduce
1. Install *Sign* (`sign`)
2. Create and send a sign request
- Signer 1: Any portal user (e.g., Joel Willis)
- Use the clock icon to schedule the signature request to a future date
3. Log in as the portal user used in step 2
4. Navigate to Signature Requests
5. **The signature request already appears in the list, even though it was scheduled for a future date.**
## Cause
The portal filters the sign requests shown based on the `is_mail_sent` field, which does not properly reflect when the signature request is shared to the user.
https://github.com/odoo/enterprise/blob/9898272f17809decf6c5bb4600aca46f9ffae6f0/sign/controllers/portal.py#L40
In fact, when scheduling a signature request, the `is_mail_sent` field is unconditionally set to `True`, even if the signature request will only be sent later.
https://github.com/odoo/enterprise/blob/9898272f17809decf6c5bb4600aca46f9ffae6f0/sign/models/sign_request_item.py#L289
## Fix
Since the `"scheduled"` `sign_request_item.state` option introduced by https://github.com/odoo/enterprise/commit/ed8d5a653e01b1378f0020e2f7a7c2d39fadf3e9 in 19.1, we can easily filter out the sign request items that are scheduled. That state is automatically updated by the `_cron_update_state`, introduced by the same commit as the `"scheduled"` option.
https://github.com/odoo/enterprise/blob/9898272f17809decf6c5bb4600aca46f9ffae6f0/sign/models/sign_request.py#L493-L503
opw-6227472
Forward-Port-Of: odoo/enterprise#119007
Forward-Port-Of: odoo/enterprise#118491This update fixes a bug that allowed internal transfer validations to proceed without scanning the destination location. Previously, deleting a line would cause validation to succeed even if the location hadn't been scanned. The fix ensures validation only occurs after a destination location has been properly scanned, improving data accuracy and preventing incorrect transfer approvals.
Original PR description
Currently, when a user deletes a line and validates internal movement in the barcode system, the system allows validation even though specifying the destination location after each scan is required.…
Currently, when a user deletes a line and validates internal movement in the barcode system, the system allows validation even though specifying the destination location after each scan is required. ## Steps to produce: - Install the Inventory module - Go to Settings and enable Storage Locations. - Inventory > Configuration > Operation Types > Internal Transfers > Barcode App - Configure the Destination Location to require scanning after each product. - Create an Internal Transfer for Pedal Bin, demand 1. - Mark the transfer as To Do and open it in the Barcode app. - Add quantity using +1, then scan the barcode for the Pedal Bin(Barcode: 6016478556493). - Delete the newly added line and attempt to Validate. ## Observed Behavior: The system should prevent transfer validation when the destination location has not been scanned and display a notification to the user, similar to the behavior before user deleted the newly added line. ## Root cause: This issue occurs because when the delete button is pressed, the deleteLine function [1] removes the line, but the deleted line becomes the selected line due to [2] being triggered before the UI updates. As a result, the selected line is now undefined. Since the selected line is undefined, it fails to meet the condition at [3] during validation. This prevents notifications from being triggered and allows the transfer to be validated before the destination location has been scanned. [1]: https://github.com/odoo/enterprise/blob/3476d15bf8e75eb6530658dd623861b60963ab40/stock_barcode/static/src/models/barcode_model.js#L826-L836 [2] : https://github.com/odoo/enterprise/blob/327d4478128f33fb2e0c477533bd4983178abf17/stock_barcode/static/src/components/line.js#L129-L133 [3]: https://github.com/odoo/enterprise/blob/6ff158ca3a6d2d2b3d285a7f8317622844811688/stock_barcode/static/src/models/barcode_picking_model.js#L945-L948 ## Solution: We can prevent users from validating if any line has an unscanned destination location when destination-location scanning is mandatory after scanning each product. To enforce this behavior, we can track whether a line has been modified and whether a destination location has been scanned and applied to that line. This allows us to identify which lines still require destination location scanning before validation can proceed. However, line state information is currently discarded and recreated on every save. As a result, information about lines that were updated and already had their destination location scanned is lost. This may incorrectly require users to rescan the destination location, even though it was previously scanned. To address this, we preserve the destination-scanned and modified state by carrying it forward from existing lines to their corresponding newly created versions using a loop. This ensures that destination location scan status is retained and users are not asked to rescan unnecessarily. opw-6069614 Forward-Port-Of: odoo/enterprise#119870 Forward-Port-Of: odoo/enterprise#113618
This update corrects a bug in the accrual reports (like 'Bill To Receive') that was causing group totals to display as zero. The fix ensures that the aggregated amounts are calculated accurately, which is essential for accountants to perform period-end financial analysis. This improves the reliability of these key reports.
Original PR description
### Issue before this commit: In accrual reports (e.g., "Bill To Receive", "Billed Not Received", "Invoices To Be Issued", and "Invoices Not Delivered"), when grouping the list view by fields such as…
### Issue before this commit: In accrual reports (e.g., "Bill To Receive", "Billed Not Received", "Invoices To Be Issued", and "Invoices Not Delivered"), when grouping the list view by fields such as Vendor, the group header totals for the "Received", "Billed", and "Amount" columns display 0.00 even if the interanl lines of the group are not 0.00. ### Steps to reproduce the issue: 1. Download Purchase Accounting and Sale Accounting 2. Go to one of this pages: Billed Not Received, Bill To Receive, Invoices To Be Issued, and Invoices Not Delivered 3. Ensure the view is in its default grouping (grouped by Vendor or Customer) 4. Observe the group header rows for the Received (or Delivered), Billed (or Invoiced), and Amount columns. They all display 0.00 5. Expand a group that contains records with values greater than zero 6. Observe that the individual records populate correctly, but the aggregated group header row continues to display 0.00. ### Cause of the issue: The commit ddc1b681656ea8c70f3231cda20b5a58b9ff7dd6 adapted the code to retrieve the new accrual reports but attempted to fetch grouped records using group[0].id as the dictionary key, while the grouped() method actually used the recordset object as the key. This mismatch caused the dictionary lookup to fail, resulting in 0.00 sums. https://github.com/odoo/enterprise/blob/c8535a7a0e2eae811048a34a0bae187a1fa45311/account_accountant/models/analytic_mixin.py#L40-L48 ### Reason to introduce the fix: This fix restores the core analytical utility of the accrual reports, which are crucial for accountants during period-end closings to evaluate totals at a glance. opw-6232273 Forward-Port-Of: odoo/enterprise#118399
This update prevents managers from overriding expense approvals on card expenses. Previously, setting a manager after creation would be cleared upon approval. Now, the field is read-only, allowing users to manage card expenses directly, streamlining the approval process and reducing potential errors.
Original PR description
**Issue** If a manager was manually set on a card expense after it was created, it would be cleared when the expense was approved. **Change** Make the field readonly for card expenses, the idea is that the manager shouldn't need to approve card expenses since they are able to control them via the card itself. opw-6045587 Forward-Port-Of: odoo/enterprise#112593
This update ensures that shift workloads remain consistent after undoing the automatic planning process. Previously, undoing auto-plan would reset the allocated hours, leading to inaccurate workload tracking. The fix preserves the original workload value while allowing the percentage to adjust, improving the reliability of shift scheduling.
Original PR description
Steps to Reproduce --- 1. Open the Planning module 2. Create an open shift with allocated_hours 3. Click Auto Plan 4. Click Undo on the auto-plan notification Issue --- Undoing an auto-plan operation…
Steps to Reproduce --- 1. Open the Planning module 2. Create an open shift with allocated_hours 3. Click Auto Plan 4. Click Undo on the auto-plan notification Issue --- Undoing an auto-plan operation triggers recomputation of allocated_hours, causing the shift to lose its original workload value. Current Behaviour --- When resource_id is set to False during undo: - _compute_allocated_hours is triggered (depends on resource_id) - _compute_allocated_percentage is triggered (depends on allocated_hours) - Both fields are recalculated, potentially changing allocated_hours from its pre-assignment value Expected Behaviour --- Undoing auto-plan should preserve allocated_hours at its pre-assignment value while allowing allocated_percentage to adapt to the new context (open slot vs assigned resource). Fix --- Use protecting context manager in action_rollback_auto_plan_ids to prevent allocated_hours from being recomputed when resource_id is removed. This allows allocated_percentage to recalculate naturally based on slot duration while keeping allocated_hours stable. task - 4952149 Forward-Port-Of: odoo/enterprise#119941 Forward-Port-Of: odoo/enterprise#102864
This update fixes an issue where planned dates were lost when converting projects to project templates. The change ensures that the original planned dates are retained when creating a template, improving project tracking accuracy. This resolves a previous bug impacting project scheduling workflows.
Original PR description
Steps to reproduce: -------- - Open a project with a planned date set. - Create Template of that project. - Observe the created project template. Issue: ---------- The planned dates of the project are lost when converting the project into a template. Cause: ----- When we create a project template from a project, the project gets archived.Because a new project template record is created, and the start and expiration fields have copy=False, those dates are not being copied. Fix: ------- Explicitly pass the planned date when copying the project, so the project template keeps the original planned date. task-5872500 Forward-Port-Of: odoo/enterprise#119997 Forward-Port-Of: odoo/enterprise#115035
3 changes
New functionality added to Odoo
This update introduces a new rule for calculating superannuation guarantee payments in Australia, aligning with Australian Taxation Office (ATO) requirements. Specifically, it incorporates 'Qualifying Earnings' (QE) as the primary source for superannuation contributions, replacing previous calculations from Ordinary Time Earnings (OTE) starting July 1st, 2026. This ensures accurate and compliant superannuation reporting.
Original PR description
Added new salary rule for Qualifying earnings. Super Streams now per payrun. task-6012509
Enhancements to existing features
This update enhances the tracking of Lazada orders by automatically logging the reasons for skipped synchronization. Previously, users had to manually investigate order details to determine the cause. Now, clear logging provides better visibility and simplifies troubleshooting for synchronization issues.
Original PR description
Before this commit, the only way to know why an order was not synchronized was to inspect the order details and infer the reason from the code. This commit now logs those reasons.
Resolved issues and error corrections
This update fixes a potential issue where negative order quantities could be entered within certified point-of-sale configurations. The change prevents this from happening both in the backend system and on the user interface, ensuring accurate order tracking and reporting. This improves data integrity and reliability for our POS partners.
Original PR description
Certified pos configs should not allow to set negative quantities on order lines. We now prevent it from both backend and frontend. see odoo/odoo#269487 task-5942777
3 changes
Resolved issues and error corrections
This update resolves an issue where demo leave allocations wouldn't properly validate during an upgrade from Odoo 17.0 to 18.0. The fix ensures that the approval process is executed correctly, preventing data inconsistencies and allowing for smooth upgrades of the Indian Payroll module. This improves the reliability of the demo data and upgrade process.
Original PR description
Steps: - Install an Odoo 17.0 database with the Indian Payroll module and demo data. - Upgrade the database to 18.0. Issue: - The Indian payroll demo data creates leave allocations and approves them…
Steps: - Install an Odoo 17.0 database with the Indian Payroll module and demo data. - Upgrade the database to 18.0. Issue: - The Indian payroll demo data creates leave allocations and approves them through an XML function call. - During a fresh installation, demo files are loaded in 'init' mode, so the approval function is executed and the allocations move from 'confirm' to 'validate'. - However, during a 17.0 >>> 18.0 upgrade, demo files are loaded in 'update' mode. Odoo automatically loads demo files with 'noupdate=True' from the load_demo() >> load_data() function: - This value is passed to the XML importer and becomes the default noupdate state for the file. Since the demo XML file does not explicitly override this value, the function tag uses 'noupdate=True'. - When the XML parser reaches the approval function, _tag_function() skips its execution because of noupdate = 'True' and mode = 'update' condition. - As a result, the approval function is not executed during the upgrade and the leave allocations remain in 'confirm' state. Subsequent demo payroll data expects validated allocations and fails during loading. Fix: - Explicitly set 'noupdate=0' on the demo XML file. This overrides the default 'noupdate=True' value applied to demo files, making the parser evaluate the section with 'noupdate=False'. - As a result, '_tag_function()' executes the approval method during upgrades, the demo leave allocations are validated in both fresh/new db installations and 17.0 >>> 18.0 upgrade scenarios. runbot error-https://runbot.odoo.com/odoo/error/230430 task-6268381
This update fixes an issue where the unit price on purchase orders was incorrectly reset to zero when using reordering rules. The fix ensures that the product's original cost or a valid fallback price is used, preventing inaccurate purchase order pricing. This improves the reliability of purchase order generation.
Original PR description
Version: ---------- - 18.0+ Steps to reproduce: ----------------------- 1 - Install the `purchase` and `stock` modules. 2 - Create a storable product with tracking enabled. Set the Cost (standard…
Version: ---------- - 18.0+ Steps to reproduce: ----------------------- 1 - Install the `purchase` and `stock` modules. 2 - Create a storable product with tracking enabled. Set the Cost (standard price) to 50. 3 - Open the product form and go to the Purchase tab. * Add a vendor with: * Quantity: 2 * Price: 10 4 - Create a Reordering Rule for this product: * Route: Buy * Trigger: Manual * To Order Quantity: 2 5 - Click on the Order button to generate a purchase order. 6 - Open the generated Purchase Order and verify the Unit Price on the purchase order line. 7 - Open the same product and go to the Purchase tab. In the existing vendor line, add an End Date lower than today so the vendor pricelist becomes expired. 8 - Reopen the same reordering rule. Change To Order Quantity to 1. 9 - Click on the Order button again Issue: ----- The generated purchase order line gets a Unit Price of 0 instead of keeping the product cost or a valid fallback price. Root Cause: -------------- - When clicking on `Order`, it triggers `action_replenish`, which calls the procurement flow: `_procure_orderpoint_confirm` → `run` → `run` → `_run_buy`. - Inside `_run_buy`, the system checks whether a `purchase.order.line` already exists. In this case, the PO line exists, so it calls `_update_purchase_order_line`. https://github.com/odoo/odoo/blob/47ef8b75d0c90001b9989a95f09b962c5b286c53/addons/purchase_stock/models/stock_rule.py#L137 - In `_update_purchase_order_line`, the system tries to fetch a seller using `_select_seller`, - which internally calls `_get_filtered_sellers`. https://github.com/odoo/odoo/blob/47ef8b75d0c90001b9989a95f09b962c5b286c53/addons/product/models/product_product.py#L759 - However, if the seller's `end_date` is less than `today`, `_get_filtered_sellers` skips that seller and returns no valid seller. https://github.com/odoo/odoo/blob/47ef8b75d0c90001b9989a95f09b962c5b286c53/addons/product/models/product_product.py#L731-L733 - As a result, `_update_purchase_order_line` does not find any seller and falls back to setting `price_unit` to `0`, causing the purchase order line price to be updated incorrectly. https://github.com/odoo/odoo/blob/47ef8b75d0c90001b9989a95f09b962c5b286c53/addons/purchase_stock/models/stock_rule.py#L259 --- opw-6117461 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update significantly speeds up the calculation of future timesheet holidays, particularly when many holidays are defined. The change optimizes how timezone conversions are handled, preventing long processing times and ensuring timesheet creation completes efficiently. This improves user experience and system performance.
Original PR description
**Problem:** When creating a new employee, the future timesheets due to public holidays are computed. If the number of public holidays is large (i.e. if the user creates them for each year, several years in the future), then it takes excessively long and the action may not complete. **Cause:** The pytz method `localize` and comparing times with non-static timezones is done repeatedly and unnecessarily which becomes costly with more records. **Solution:** Only localize the time when absolutely necessary (determining the date of the leave in the calendar timezone). **Performance Stats:** |Record count|Time before|Queries before|Time after|Queries after| |------------|-----------|--------------|----------|-------------| |100 |3.1s |393 |0.8s |117 | |1,000 |22.3s |2,090 |1.5s |183 | |10,000 |Timeout |N/A |6.7s |541 | opw-6087422 Forward-Port-Of: odoo/odoo#263953