Daily updates from Odoo
Monday, January 13, 2025
13 changes · 18.0
Enhancements to existing features
Searching email templates by category has been optimized so it no longer slows down when there are many templates. This improves responsiveness for databases with large numbers of email templates, reducing searches from several seconds to near-instant in benchmark testing.
Original PR description
When we have thousands of mail.templates, the search was taking seconds. The previous code was searching on every template, computing the `template_category` and then filtering those records to make the domain. Benchmarks done _au-doigt-mouillé_ : with 60k templates, the test was running in 4 seconds and is now running in 0.02 on a reliable test server (aka “my laptop”)
Automation rules now keep their existing filters when trigger fields are edited, reducing the risk of unexpected automation behavior. When a filter is changed, the related trigger fields are updated automatically, making automation setup more reliable for save and UI-change triggers.
Original PR description
Backport of 105e313775a6853d8dcd8ea89af7f710f4e1e2a1 **Purpose** Currently, editing any trigger field of an automation erases the domain, which may lead to unexpected behavior as some "light" automations (i.e. in CRM) hide their domains (for user friendliness). After this commit, any change in the trigger fields won't erase the domain. Also, any change in the domain will update the trigger fields. This is true for: `On save` and `On UI change` triggers. opw-4367901
Documents users can now create server actions and automation rules directly from the cog menu, making it faster to configure document workflows for selected folders. Menu labels and controls were also clarified so business users can more easily find and manage available actions.
Original PR description
Server Actions =========== - Rename Action menu to "Actions on select" - Add an Actions creation in Actions menu (cog wheel) - Redirect to Server Actions Automations ========== - Add an Automations menu in Documents Cog Menu, below Actions on select - If base_automations is not installed -> propose to upgrade to Studio - If base_automations is installed -> redirect to Automations rules lighten as in CRM In the context of providing a partially pre-filled automation rule form for the target folder, we change the `folder_id` label from "Parent folder" to "Folder". task-4334749
Resolved issues and error corrections
Applying certain discount-code coupons in Point of Sale no longer causes an error. Users now see a clear warning when that coupon type is not supported, helping cashiers continue checkout without interruption.
Original PR description
Steps: - Create a discount program with `Discount Code` as the program type. - Add a coupon for the program using the stat button. - Open the POS UI and add products to the cart. - Apply the coupon to the cart. Issue: - A traceback error occurs when applying that coupon. Fix: - added a validation warning when a user attempts to apply a coupon code from a discount code program type (similar to sales) Task - 4422507
This fix helps point of sale setup work correctly for branch companies by reusing the existing default cash account when creating cash payment methods. It also prevents Belgian restaurant POS setup from creating duplicate taxes in subsidiary companies, reducing configuration errors during onboarding.
Original PR description
- `point_of_sale`: when creating cash payment methods, we now use the default cash account if it exists. - `l10n_be_pos_restaurant`: filter taxes to create to avoid recreating same tax in sub company Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix prevents reverse charge tax calculations from counting the same base amount twice during global rounding. It helps avoid small incorrect tax adjustment amounts on accounting and purchase documents, improving the accuracy of reported totals.
Original PR description
Before, the rounding was made by counting twice the same base amount that was leading to an extra "delta_base_amount_currency". See the test in the commit. opw-4425380 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix prevents an error when users refresh a payment link after changing the amount on a customer invoice. It improves reliability of the payment link workflow in Accounting so users can continue without unexpected interruptions.
Original PR description
Currently, a traceback occurs when the user tries to generate a payment link and tries to refresh it. To reproduce this issue: 1) Install `Accounting` 2) Create a confirmed Customer Invoice 3)…
Currently, a traceback occurs when the user tries to generate a payment link and tries to refresh it. To reproduce this issue: 1) Install `Accounting` 2) Create a confirmed Customer Invoice 3) Generate a Payment link from `Actions` 4) Change the `Amount` and refresh the tab 5) You can see the error in the terminal Error:- ``` KeyError: 'installment_state' ``` This traceback occurs because when the user refreshes the tab, it executes the `default_get` method, with self as `payment.link.wizard`. https://github.com/odoo/odoo/blob/be6b327c17435947fc3f10d30fc8c4730c182aed/odoo/models.py#L1897-L1899 In that `payment.link.wizard`, we have overridden the `default_get` and updated the values from the `_get_default_payment_link_values` method with the model as `account.move`. https://github.com/odoo/odoo/blob/4787c91c434c7e22ca030bc7a62588482c24b2ab/addons/payment/wizards/payment_link_wizard.py#L21-L23 The method mentioned above will return a dict containing the `installment_state` key-value pair. https://github.com/odoo/odoo/blob/be6b327c17435947fc3f10d30fc8c4730c182aed/addons/account_payment/models/account_move.py#L128-L132 But `installment_state` is not a field. It is just a variable that gets its value from the `_get_invoice_next_payment_values`. https://github.com/odoo/odoo/blob/be6b327c17435947fc3f10d30fc8c4730c182aed/addons/account_payment/models/account_move.py#L104 So eventually it leads to the above traceback from the below line. https://github.com/odoo/odoo/blob/be6b327c17435947fc3f10d30fc8c4730c182aed/odoo/models.py#L1897-L1899 sentry-6058398917
The Attendance app now correctly calculates worked time before automatically checking employees out. This prevents employees from being clocked out shortly after checking in, improving accuracy for attendance records and payroll-related tracking.
Original PR description
When "Automatic Check-Out" was enabled for the Attendance app, a scheduled action will run every given interval to clock out employees who are still clocked-in after their defined work hours for a…
When "Automatic Check-Out" was enabled for the Attendance app, a scheduled action will run every given interval to clock out employees who are still clocked-in after their defined work hours for a day (typically 8 hours.) The issue is that this action was clocking every employee out every time it ran because the condition was comparing a value in seconds to a value in hours, where the former would dominate every time. This change fixes this by normalizing the units to hours in all calculations. This can be tested on Runbot by following these steps: 1) In Attendances > Configuration, check the "Automatic Check-Out" box and set the tolerance to 0. The tolerance won't make much of a difference here because it is measured in hours and we'll find later that we are calculating time in seconds, but this is the tolerance that the customer has set.) 2) In Attendances > Overview, create a new attendance record for any given employee by clicking "New." Set the check-in date and time to be the current time to simulate a small interval of working time. Delete the check-out date entirely so that we functionally have a "checked-in" employee. (You could also clock this employee in using other methods like the kiosk, but I think this way is clear and easy too.) 3) Now that there is a short interval of time for this employee, navigate to Settings > Scheduled Actions > "Attendance: Automatically check-out employees" and run it manually to simulate what would happen when it should run 4 hours later. 4) Observe that the employee has not been clocked out because they have not gone over their allotted work hours for the day: BUG SQUASHED. 💥🐛 opw-4383268
Payslip documents are now shared with the contact linked to the employee's user account when available, instead of always using the employee's work contact. This ensures employees can access their own payslips even when their work contact differs from their user contact.
Original PR description
How to reproduce: - Install documents_hr_payroll - Go to Marc Demo employee file - Activate debug and click on View:form item of the debug menu - Move the field "work_contact_id" in the sheet tag and…
How to reproduce: - Install documents_hr_payroll - Go to Marc Demo employee file - Activate debug and click on View:form item of the debug menu - Move the field "work_contact_id" in the sheet tag and make it visible - Return on the Marc Demo employee file - Set a new work contact for Marc Demo (using the field): newContact - Go to the payslip and confirm one of the payslip of Marc - Open HR Payroll directory in the Document App - The payslip of Marc is present, select it and click on "Share" The payslip is shared with "Mitchell Admin" and "newContact" so Marc Demo won't be able to see it because it is not shared with the partner of his user. The problem was that the employee work_contact_id partner was used to give access to the payslip (and as contact of the payslip document) while for some employee, the work contact is different than the partner associated with their user. In that case, the payslip is shared with a partner different than the employee user partner and the employee cannot see the payslip. We solve the problem by always sharing the payslip with the partner of the employee user if it exists and we fallback only to the work contact if there is no user associated with the employee. Task-4404015
Reduced quantities in restaurant POS orders now update the matching kitchen preparation line instead of the oldest similar line. This prevents prepared or ready items from being incorrectly changed or canceled during payment, improving order accuracy for kitchen staff.
Original PR description
[FIX] pos_preparation_display: Prevent Cancel When Payment This commit is a forward port of https://github.com/odoo/enterprise/commit/5108b400d1f7c4b7239fbc3f5651cf9b835d385c. In a POS restaurant…
[FIX] pos_preparation_display: Prevent Cancel When Payment This commit is a forward port of https://github.com/odoo/enterprise/commit/5108b400d1f7c4b7239fbc3f5651cf9b835d385c. In a POS restaurant order, when reducing the product quantity of an order line, the reduced display line in the preparation display was always the first one created, regardless of which order line was changed. 1. In the POS restaurant, add a product with a quantity of 2 and an internal note. Confirm the order. 2. Add another order with the same product and internal note but with a quantity of 5. 3. In the kitchen display, change the stage of the first display line (quantity 2) from "To Cook" to "Ready." 4. In the POS, reduce the quantity of the second order line (quantity 5) to 4. Reducing the quantity of the second order line inadvertently reduces the quantity of the first display line (the one in the "Ready" stage). In `_process_preparation_changes` of `pos_order.py` in the `pos_preparation_display` module, display lines are filtered and sorted based on their creation order. Commit `55f2b24870b664815fe7b926835d07259608ae09` added the `uuid` field, which allows the correct display line to be adjusted when reducing the quantity in the POS order line. Added a tour to test the following use case fixed by this commit (only in version 18.0 and above): 1. In the POS restaurant, add a product with a quantity of 1 and an internal note. Confirm the order. 2. Add another order with the same product and the same internal note but with a quantity of 2. Reduce the quantity of the second order line from 2 to 1. 3. Proceed to payment. In the preparation display module, the original display orders are canceled, and new ones are created instead. opw-4354093
Shared spreadsheets in Documents now open correctly for invited portal users. This prevents access errors when external users try to view spreadsheets they have been explicitly allowed to access, improving collaboration through the portal.
Original PR description
Steps to reproduce: - Create a spreadsheet - click on the the Share button - add a portal user (Joel Willis) to the allowed users - connect as the portal user and open his portal - go to the Documents section and try opening the spreadsheet => You are not allowed to access 'Spreadsheet Contributor' (spreadsheet.contributor) records. Task: 4453298
Canceling a payment terminal transaction now returns the payment method button to its normal state, preventing staff from seeing a stuck in-progress status. The payment status message is also easier to see on mobile screens, improving checkout clarity for smaller devices.
Original PR description
Steps to reproduce: -------------------------- - Install the point_of_sale module. - Set up any payment terminal. - Attempt payment using the terminal. - Cancel the transaction request. Issue: -------- - Payment method button remains in progress mode after canceling the transaction. - In mobile view, the payment status message lacks a visible background. Cause: --------- - Transaction progress state is not reset after a successful cancellation. - Missing responsive classes for mobile view. Fix: ---- - Reset the payment method progress state after a successful cancellation. - Add appropriate classes to ensure the payment status background is visible across all views. Task: 4427387
This fixes Czech accounting behavior so bank and cash transactions created for a past date are no longer overwritten with the current date when no taxable supply date is entered. It helps businesses issue backdated documents correctly while staying aligned with Czech VAT date rules.
Original PR description
Current behavior before PR: Actual change in Odoo 18.0 breaks logic for documents without taxable supply date on form. This cause issues with issuing documents to the past for example bank or cash.…
Current behavior before PR: Actual change in Odoo 18.0 breaks logic for documents without taxable supply date on form. This cause issues with issuing documents to the past for example bank or cash. If you are trying issue document to past it's overwritten to actual date. Desired behavior after PR is merged: I can create bank or cash transaction in the past. Description of the issue/feature this PR addresses: According to the Czech VAT Act (Act No. 235/2004 Coll., on VAT), the difference between the date of issuance of an invoice (date) and the date of taxable supply (taxable_supply_date) is regulated as follows: Taxable Supply Date (taxable_supply_date): This is the day on which the taxable supply (delivery of goods or provision of services) actually took place, unless specified otherwise. Date of Issuance of the Invoice (date): The invoice must be issued no later than 15 calendar days from the taxable_supply_date. This means that the gap between the taxable_supply_date and the date cannot exceed 15 calendar days. Example: Taxable_supply_date: January 1, 2025 Date: Must be no later than January 16, 2025 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr