Wednesday, July 9, 2025
30 changes · saas-18.4
Enhancements to existing features
Users can now adjust the exchange rate used on invoices and quickly apply the rate from a chosen date. The change helps accounting teams handle currency differences more accurately and refresh rates when they do not match the expected value.
Original PR description
- Make `invoice_currency_rate` editable. - Add a date picker widget that let the user apply the rate of a certain date. - Add a refresh button when the rate is not the expected one. To that end, the computed field `expected_currency_rate` is added. task-4378994 Forward-Port-Of: odoo/odoo#214308
Point of Sale now requires the scale reading to change before another weighed product can be added, even if regular items are added in between. This helps meet LNE certification requirements and reduces the risk of accidentally reusing an old weight for a different product.
Original PR description
In order to satisfy certification requirements from the LNE, we implement the following: - A product is weighed at e.g. 200g and added to the order - Another product is weighed. The weight must change from 200g before the user is allowed to add the item. - This should also happen even if another non-weighed product is added in-between. task-4859589 Enterprise PR: https://github.com/odoo/enterprise/pull/87296 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#215084 Forward-Port-Of: odoo/odoo#213537
Printer status information is now aligned with the IoT HTTP service so Odoo can better understand and display real printer conditions. Automatic confirmation of printer actions was removed to allow more accurate follow-up statuses, such as low paper or printer not ready.
Original PR description
Renamed `print_status` to `status` to conform to the status readable by `iot_http` service. We also removed the automatic event confirmation for actions on printers, as we later send the actual status of the printer (low on paper, not ready, ...). Enterprise PR: odoo/enterprise#89638 Task: 4922613
Updates Belgian accounting setup data with corrected account details, clearer labels, improved translations, and tax assignments on selected accounts. This helps Belgian companies start from more accurate accounting templates and reduces manual cleanup during configuration.
Original PR description
Misc data modifications and corrections for l10n_be. * Updated the CoA (accounts, descriptions, translations) * Added taxes on some accounts, notably 21%D35 and 21%IG ND * Renamed fields to be more correct See task-4791757 for more details. Related : https://github.com/odoo/enterprise/pull/87067 Forward-Port-Of: odoo/odoo#210755
This update helps prevent the same scale reading from being processed twice in Point of Sale when using IoT-connected scales. It makes weighing more reliable for store operations and reduces the risk of incorrect quantities or pricing at checkout.
Original PR description
The main changes are in the community PR odoo/odoo#213537. This commit simply adds a call in the `scale_service.js` override to ensure the new behaviour is also enabled in Enterprise. task-4859589 Forward-Port-Of: odoo/enterprise#88089 Forward-Port-Of: odoo/enterprise#87296
The printer test button now uses the same connection approach as regular receipt and report printing, making test prints behave more consistently. If the usual connection method fails, the system automatically falls back to an alternative so users are less likely to experience failed printer tests.
Original PR description
The "test" button on printer devices should behave exactly as printing a receipt/report in other apps. We now use the IoT http service to handle longpolling call then websocket if longpolling fails. We also updated all other calls to use this service instead of simple longpolling service. Community PR: odoo/odoo#217932 Task: 4922613
Belgian accounting data has been updated with corrected chart of accounts details, translations, and disallowed expense rules. The change also adds default asset model handling for Belgium, helping companies apply Belgian accounting setup more consistently and reducing manual configuration.
Original PR description
1) Misc data modifications and corrections for l10n_be. * Updated the CoA (accounts, descriptions, translations) * Fixed and updated disallowed_expenses 2) Added default asset models module for l10n_be See task-4791757 for more details. Related :https://github.com/odoo/odoo/pull/210755 Forward-Port-Of: odoo/enterprise#87067
Resolved issues and error corrections
Updates to analytic items now automatically keep the linked journal item’s analytic distribution in sync. This prevents accounting records from showing outdated analytic allocation information after an analytic item is changed or deleted.
Original PR description
overrode the write and unlink functions related to the analytic_line so that it synchronize the analytic distribution in the move_line every time a change happen before this commit whenever an analytic line is edited it is not reflected to its linked journal line's analytic distribution. so an update function is created so that the analytic distribution is updated whenever an analytic line is edited or deleted. task-4378407 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#218030 Forward-Port-Of: odoo/odoo#199020
Fixes an issue where pasting preformatted text into an eCommerce product description could cause an error when saving. Product editors can now paste richer formatted content more reliably without breaking the product page editor.
Original PR description
Currently, an error occurs when a pre-formatted text is directly pasted into the product description using the website editor. **Steps to reproduce:** 1. Install the eCommerce app. 2. Open the web…
Currently, an error occurs when a pre-formatted text is directly pasted into the product description using the website editor. **Steps to reproduce:** 1. Install the eCommerce app. 2. Open the web editor on any product's detail page. 3. Add product description by copy-pasting preformatted text like; **Amazing Features** stability, durability, consistency 5. Save the changes. **Error:** KeyError - None **Cause:** The issue is caused by an invalid HTML structure. When preformatted/nested block elements are pasted, they get wrapped inside `<p>` block, which is not valid HTML. This leads to missing `data-oe-model` attributes on sub-elements, resulting in an error. Before saas-18.4, the text block used a `<div>` tag to wrap content. After [this](https://github.com/odoo/odoo/commit/bbb2d98d9ab97ce729d59b9858b63daccf5434e2) commit, the wrapper was changed to a `<p>` tag. **Fix:** This commit replaces the wrapper tag with a `<div>` to ensure that preformatted and block-level content can be added and saved. sentry-6731261789
The online shop now checks category values in web addresses before using them. This prevents customer-facing errors when a category link is manually changed or contains unexpected text, keeping shopping pages available instead of crashing.
Original PR description
The system will crash when we get the `category` as `str` and we try to evaluate `int(category)` in `_validate_and_get_category` method. **Root Cause:-** - At [1] and [2], we are passing an object in…
The system will crash when we get the `category` as `str` and we try to evaluate `int(category)` in `_validate_and_get_category` method. **Root Cause:-** - At [1] and [2], we are passing an object in the arguments for the category. If we manually provide a category, it may result in a `not found` error instead of a regular error. - However, at point [3], Since the `category` is received from a `query parameter`, it can be easily tampered with, so it should be properly validated before use. - This controller makes the `older controller` (used before V14) `compatible` with the new one. [1] https://github.com/odoo/odoo/blob/1df0feb3dc1b0ac34227683337eca4d95fa986b5/addons/website_sale/controllers/main.py#L470 [2] https://github.com/odoo/odoo/blob/1df0feb3dc1b0ac34227683337eca4d95fa986b5/addons/website_sale/controllers/main.py#L247 [3] https://github.com/odoo/odoo/blob/1df0feb3dc1b0ac34227683337eca4d95fa986b5/addons/website_sale/controllers/main.py#L546 **Error:-** `ValueError: invalid literal for int() with base 10: 'duffle-bags'` **Solution:-** - We added a `validation` to ensure the category parameter is a `valid integer` before using it. - This prevents crashes when users manually input 'invalid` or `tampered category` values in the URL. **Sentry - 6658317828** I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#216791
This fix prevents small rounding differences from causing purchase-related stock costs to become overstated. It improves inventory valuation accuracy when receiving purchase orders in parts, especially when landed costs or currency conversions are involved.
Original PR description
## Before this commit: When calculating the `price_unit` for stock moves from purchase order lines, the `remaining_qty` and `remaining_value` could be imprecise. Standard float comparisons for these…
## Before this commit: When calculating the `price_unit` for stock moves from purchase order lines, the `remaining_qty` and `remaining_value` could be imprecise. Standard float comparisons for these remaining amounts could lead to incorrect `price_unit` calculations if, for example, `remaining_qty` was a small float near zero. This could result in inaccurate stock valuations, particularly when currency conversions were involved or when landed costs were applied. For example, 70.00000003 is rounded **up** to 70.00001 (with 5 digits), resulting in a quantity difference of 0.00001, which incorrectly inflates the unit cost. ## After this commit: Change the rounding method to 'HALF-UP' instead of the default 'UP' to improve precise result for quantities. ## Steps to reproduce: 1. Configure a product with AVCO real time. Set decimal precision for price and UoM to 5 digits. 2. Create a Purchase Order (e.g., 190 units @ $110/unit). 3. Receive 70 units and create a backorder 4. Create and post a bill for the initially received quantity. 5. Apply a landed cost to the picking of the first 70 units. 6. Create a draft bill for the remaining quantity on the PO. 7. Receive the remaining 120 units from the backorder. 8. The product's cost explodes opw-4705224 Forward-Port-Of: odoo/odoo#217691 Forward-Port-Of: odoo/odoo#208815
This fixes Spanish TicketBAI electronic invoicing so the XML includes the reference to the previous document when required. This helps maintain the proper invoice chain for compliance reporting and avoids missing links in submitted data.
Original PR description
Before, the previous document chaining was not sent in the XML because with the t-if, if the variable name is unknown, it will not complain and just see it as False. (like for the first invoice that has no previous) Now, passing the correct variable name, the previous document will be included opw-4814241 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#217685
This fixes a website navigation issue where mega menus could close too early when using the rounded box menu style with hover-based submenus. Visitors can now move from the menu item into the mega menu content without it disappearing, improving usability for affected website layouts.
Original PR description
Scenario: - edit navigation bar to "Rounded box menu" (header_boxed_opt) - select option "Sub Menus" to "On Hover" - add a mega menu - outside of editor, hover the mega menu item and move mouse over…
Scenario: - edit navigation bar to "Rounded box menu" (header_boxed_opt) - select option "Sub Menus" to "On Hover" - add a mega menu - outside of editor, hover the mega menu item and move mouse over it Result: the mega menu content closes before we get to it. History: In saas-18.1 and saas-18.2, these menus with the show on hover have been broken and fixed through different changes: (A) normal popup menu (B) all mega menu (C) mega menu with header_boxed_opt menu bar Here is the list of commit and what was broken after them: - 671515811436a01ea8931d4aa92b62608f8aec90 (nov 2024): C - b9b3a605e0f4c5da3a258c980107d6162da7f44f (jan 2025): A+C - ddf071267bd8aca341cb9b7481f3153a254212e7 (apr 2025): B+C - e65d4cf16a2e973482497c3d9d405b566007e705 (apr 2025): C And hopefully this commit will fix C that happen since in 671515811436a01ea8931d4aa92b62608f8aec90 where we added a !important margin-top to the mega menu in case of header_boxed_opt header that is causing issue C. We do not the the change for a menu inside .o_mega_menu_is_offcanvas because in this case "header_sidebar_opt" doesn't need the fix and needs to have a margin-top because: - it is in the margin-top space that the go back button is - the height is computed taking into account the margin-top, so if we removed it the height of the megamenu+margin-top would not be 100% and there would be a gap at the bottom opw-4876149 Forward-Port-Of: odoo/odoo#217408 Forward-Port-Of: odoo/odoo#214740
Creating a new replenishment rule no longer fails when no product has been selected yet. This keeps the Inventory replenishment workflow usable and avoids blocking users with an unexpected error screen.
Original PR description
Bug introduced in: https://github.com/odoo/odoo/pull/213154/commits/ea480703b64d88ac572c3e37da3d9fb3327b4445 Steps to reproduce the bug: - Go to "Inventory" → "Operations" menu → "Replenishment" - Click "New" to create a new replenishment rule Problem: Traceback is triggered: ``` in _float_check_precision assert precision_rounding > 0,\ ^^^^^^^^^^^^^^^^^^^^^^ AssertionError: precision_rounding must be positive, got 0.0 ``` As the product is not set, the `product_uom` is not set either, which leads to a `product_uom.rounding` of 0.0. Opw-4925719 Opw-4928957 Opw-4926504 Opw-4925919 Opw-4928684 Opw-4925080 Opw-4928788 Opw-4926719 Opw-4927440 opw-4928540 Forward-Port-Of: odoo/odoo#217889
Fixed an issue where the refund reason prompt could fail to appear in Point of Sale when Spanish TicketBAI and Peruvian electronic invoicing features were both installed. This helps staff complete refunds with the required information and avoids interruptions in compliant sales workflows.
Original PR description
When both l10n_es_pos_tbai and l10n_pe_edi_pos are installed, the refund reason popup was not showing up because we were not awaiting the super method call in the l10n_pe_edi_pos override. runbot-227630 Forward-Port-Of: odoo/odoo#217358 Forward-Port-Of: odoo/odoo#216379
This fix prevents errors when editing donation blocks on a website, especially when changing display, pre-filled amount, or description options. It keeps the existing behavior intact while making the donation editor more reliable and adding tests to reduce future regressions.
Original PR description
Since [1], the conversion of actions to classes led to improper function repartition, causing tracebacks when using several `DonationOption` options. This commit resolves these tracebacks by moving the code to its correct location without altering its behavior. Additionally, tests have been added to ensure more robustness. Steps to reproduce: - Drop `s_donation` snippet - Click on it - Use any of the following options: "Display Options", "Pre-filled Options", "Descriptions" - Traceback: "this.rebuildPrefilledOptions is not a function" [1]: https://github.com/odoo/odoo/pull/212138/commits/4f7c91cdf0e6b574ef1939be926a2cfea6cfa15b Related to task-4367641
Invoices created from sales now use the delivery date when choosing exchange rates, rather than defaulting to the invoice date. This prevents incorrect currency amounts for Hungarian companies and other localizations where tax or accounting rules depend on the delivery date.
Original PR description
### Steps to reproduce: - Install l10n_hu_edi and witch to Hungarian company - Have two different rates for EUR<->HUF - Create a pricelist in EUR - Create a quotation with the pricelist and confirm -…
### Steps to reproduce: - Install l10n_hu_edi and witch to Hungarian company - Have two different rates for EUR<->HUF - Create a pricelist in EUR - Create a quotation with the pricelist and confirm - Validate the delivery on another date (which has a different rate from today) - In the sale order click "Create Invoice" - The generated invoice has lines using the rate for today ### Cause: The field `delivery_date` was `precompute=True` but on creation of the invoice, at the time of the precompute, `line_ids` is still `False`. So the invoice is first computed without the delivery date so the currency rate used is the one of the invoice date. When the delivery date is written on the invoice, the line balance is not recomputed because it is "protected". ### Solution: As the field `delivery_date` was implemented in `account_move` for localizations including l10n_hu, there are no reason to contain the fix only to l10n_hu. So we add the value of `delivery_date` in the dictionnary used to create a new invoice from sale with the method `_create_invoices`. This way the delivery date is there on creation of the invoice and is used for the currency rate. opw-4756568 Forward-Port-Of: odoo/odoo#209095
Tax reports now avoid overstating the net taxable amount when invoice lines share the same tax but use different analytic distributions. This improves financial reporting accuracy for businesses using analytic accounting, while keeping the tax amount calculation unchanged.
Original PR description
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales…
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales (eg 10%) - Make sure the option "Analytic Accounting" is ticked in the settings - Create an invoice with two lines (eg both at $100), add the tax on both - Change the analytic distribution on both lines to different values - Confirm the invoice - Go to the tax report - Select the report "Group By: Account > Tax" - On the report the "Net" amount is doubled ($400), the tax amount is correct ($20) ### Cause: On the invoice we can see in "Journal Items" that two tax lines are created instead of one (one for each analytic distribution). The "Group By" reports are generated by [this query](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L92). At the [creation of the second subtable](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L164-L198) the move lines are linked together based among other things on the tax id. The [filter on analytic distribution](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L187-L191) does not apply here as `tax.analytic = False`. The result is that each tax line is linked with both base lines. The second subtable have 4 lines in this case, with each base line doubled. The result of the query have the base amount doubled. ### Solution: We cannot fix the query as there is no link to find the tax line origin among the base lines. The method `_read_generic_tax_report_amounts` in `account_reports` is made to fix the base values in report in case of duplicate. Until now, it did not include the duplication caused by analytic distribution but duplication because of repartition lines for example. The fix is to use this method also for analytic distribution. So we add `tdr.analytic_distribution` in the `GROUP BY`. This value must be returned by the query in `account` so we add it. opw-4753676 Forward-Port-Of: odoo/odoo#217569 Forward-Port-Of: odoo/odoo#213751
This fixes an issue where inventory valuation for FIFO products could use the wrong company settings in multi-company setups. It helps ensure the expected accounting journal entries are created when stock moves are processed across companies with different valuation methods.
Original PR description
**Steps to reproduce:** - Install Accounting + Inventory + Sales apps - Enable Automatic Accounting in Settings - Ensure two companies are available - Set one product category (same for both…
**Steps to reproduce:**
- Install Accounting + Inventory + Sales apps
- Enable Automatic Accounting in Settings
- Ensure two companies are available
- Set one product category (same for both companies)
- For company 1 (current) -> FIFO + automatic valuation (`'real_time'`)
- For company 2 -> FIFO + manual valuation (`'manual_periodic'`)
- Create a storable product for this category
- From company 1:
- Buy 10 products at 10$ each and receive them (Purchase + Delivery)
- Sell 15 products at 10$ each and deliver them (Sale + Delivery)
- Buy 10 products at 10$ (Purchase)
- Switch to company 2 (keep company 1 checked)
- From company 2:
- Validate the third delivery order (WH/IN)
- Go to Inventory/Reporting/Valuation
- One journal entry is missing for the last move
**Issue:**
During the processing of the SVL in `_run_fifo_vacuum`, the product used its current env context company instead of the one provided explicitly in the parameters. This caused inconsistencies in valuation logic when the method used differed between the given companies, which results in a missing `account_move_id`.
**Fix:**
Ensure that the product is evaluated in the correct company context by using `product.with_company(company.id)` before the valuation logic.
opw-4732067
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#214966
Forward-Port-Of: odoo/odoo#208644Fixed an issue that could prevent shoppers from opening product pages when the product had sales tags assigned. The shop now uses the correct tag visibility setting, avoiding checkout disruption and improving storefront reliability.
Original PR description
Currently, an error occurs when opening the product in the shop. Steps to Reproduce: - Install the `website_sale` module. - Go to `Products`, open any product, navigate to the `Sales` tab, and add at…
Currently, an error occurs when opening the product in the shop. Steps to Reproduce: - Install the `website_sale` module. - Go to `Products`, open any product, navigate to the `Sales` tab, and add at least one `tag`. - Go to `Website` > `Shop`, and open the same product. `AttributeError: 'product.tag' object has no attribute 'visible_on_ecommerce'` This error occurs when opening a product in the shop. In this commit https://github.com/odoo/odoo/pull/206084/commits/6d0d8d96b603d222de5c099ca090919573d4c761, it was mentioned that the field visible_on_ecommerce has been renamed to visible_to_customers. The error started occurring after this commit https://github.com/odoo/odoo/pull/201019/commits/eac892a4ad7373d18f954afbbcd2f1213ac5f281, where the visible_on_ecommerce attribute is used as a tag attribute [1], which causes the error. [1]- https://github.com/odoo/odoo/blob/850e575b71b04597d31140cec53a596456370325/addons/website_sale/views/templates.xml#L2333 This commit ensures that visible_to_customers is used in place of visible_on_ecommerce. sentry-6731935669 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Long company addresses now wrap correctly in document layouts instead of overlapping the logo or being cut off in PDFs. This keeps previews, sales orders, invoices, and other printed documents looking clean and professional when company details are lengthy.
Original PR description
<b>Steps to Reproduce:</b> 1. Go to Settings > Companies > Configure Document Layout. 2. Choose layout Boxed or any layout that horizontally places the company logo and address. 3. Edit the address…
<b>Steps to Reproduce:</b> 1. Go to Settings > Companies > Configure Document Layout. 2. Choose layout Boxed or any layout that horizontally places the company logo and address. 3. Edit the address block choose long string. 4. Save the layout and click Preview Document or print SO or invoice. <b>Issue:</b> - Observe in PDF output the long text overlaps into logo or extend outside the layout bound(differ in layouts) — even though enough space is visually available <b>Cause:</b> - A previous change in [PR #201198](https://github.com/odoo/odoo/pull/201198) added the text-nowrap class to address blocks to fix a minor wrapping issue. However, this unintentionally caused layout overflow issues with long lines. <b>Solution:</b> - Added width to the address block to ensure balanced layout structure. - Removed text-nowrap from all layouts, as the original issue is now resolved by applying proper width sizing. - Removed float-end from Boxed layout, as it was contributing to misalignment. <b>Additional Notes:</b> All behaviors addressed by [PR #201198](https://github.com/odoo/odoo/pull/201198) were re-tested to ensure this fix does not reintroduce previous issues. <b>opw-4764975</b> <br> <b>[PR #201198](https://github.com/odoo/odoo/pull/201198) ISSUE : </b>  <br> <b>ISSUE after [PR #201198](https://github.com/odoo/odoo/pull/201198) FIX:</b> Folder -  Boxed -  <br> <b>After this PR FIX : </b>     Forward-Port-Of: odoo/odoo#216876
Bookkeepers can now open return forms from the dashboard even when no opening date has been set. Closing or resetting a tax return also works without access errors when the system updates lock dates, reducing interruptions in tax return workflows.
Original PR description
- Trying to open the returns form the dashboard failed for bookkeepers when no opening date was set, since the wizard used to set them is restricted to administrators only. - When closing a tax return, an access error was triggered when trying to set the lock date. - When resetting a tax return, an access error was triggered when trying to set the lock date. Forward-Port-Of: odoo/enterprise#89610
The Belgian point of sale fiscal device now starts listening for replies before sending a request. This prevents rare timing issues where a fast device response could be missed, leaving the checkout process waiting indefinitely.
Original PR description
Before this commit, the listener to the longpolling or the websocket was added (subscribe for websocket and addListener for longpolling) after the action was sent to the IoT. The answer could be sent before we even listen to it so the answer was never received. This could cause infinite waiting. Forward-Port-Of: odoo/enterprise#89753
Field Service users can now open and generate task report details from the customer portal without hitting an error when only the core Field Service app is installed. The report filename logic was moved into the main Field Service module so the portal flow works reliably without requiring the optional reporting add-on.
Original PR description
An error occurs when a user attempts to generate a report from the portal because the `industry_fsm_report` module is not installed. **Steps to reproduce:** * Install `industry_fsm` * Field Service>New Task>log time sheet using `start` button * open portal view( `/my/tasks` )> Your created task> `View details` `AttributeError: 'project.task' object has no attribute '_get_report_base_filename'` **Solution:** * Define `_get_report_base_filename` inside `industry_fsm` instead of `industry_fsm_report`. **Sentry-6685756279** Forward-Port-Of: odoo/enterprise#89615 Forward-Port-Of: odoo/enterprise#87949
This fixes WhatsApp functionality so it loads correctly in all relevant Odoo pages, including public discussion pages, live chat, portal chatter, and back-end screens. It helps ensure WhatsApp messages and related features behave reliably no matter where users receive or view them.
Original PR description
`common` folder should be included in all bundles. This is especially necessary when broadcasting messages on the bus, because these messages will be received in all tabs, including those potentially not in the back-end, such the discuss public page, any page where a live chat is opened, or a portal page with a chatter. This is also necessary just to have all features properly working in all context, there is no reason that a whatsapp viewed in the public page should not have its features working as intended. runbot-223082
The UAE Corporate Tax Report now prevents tax amounts from appearing as negative when taxable profit is below the exemption threshold. This avoids misleading report totals and correctly shows zero tax due in these cases.
Original PR description
The Corporate Tax Report was incorrectly showing a negative"Corporate TAX Amount" when the taxable profit fell below the exemption threshold (e.g 375,000 AED). This issue happened because the formula used to compute the Corporate TAX Amount was: `AE_CORP_TAXABLE.balance * (AE_CORP_TAX_PERC.balance / 100)` This formula applies the tax rate even when `AE_CORP_TAXABLE.balance` is negative, which results in an incorrect negative tax amount in the report. Since the report engine doesn't support conditional logic like `max(...)` or `> 0` in XML formulas, we couldn't fix this in the formula definition directly. To solve the issue, we added a check in the Python report handler `_custom_line_postprocessor` to override the value of the Corporate TAX Amount and cap it at zero when it would otherwise be negative. Steps to reproduce: In run bot or any db go to Corporate tax report OPW-4739052 Forward-Port-Of: odoo/enterprise#86087
Brazilian electronic invoices now choose the correct invoice purpose in more common business cases instead of always using the standard purpose. This helps invoices, credit notes, and debit notes pass EDI validation when product, vendor, customer, or operation details require a different purpose.
Original PR description
We hardcoded the standard purpose (finNFe) and goal for invoices, credit notes and debit notes. In certain cases however, the purpose is must be different for EDI to succeed (based on the combination of sold product types, vendor and customer). In master we will likely add some fields on the operation type so the user can choose, but in stable we can already determine some other common cases based on the operation type. Using XML ids was considered but since users can create and edit operation types [1] it's better to use the technical names. [1] Since odoo/enterprise#73198 opw-4832447
The map view now opens Google Maps using the contact's full address instead of relying on saved latitude and longitude coordinates. This avoids incorrect Google Maps results when another geolocation provider, such as OpenStreetMap, produced less precise coordinates.
Original PR description
**Steps to reproduce:** - Install Contact app - Create a contact with a specific address - Go to the Map View of the Contact app - Filter to view the new contact - Position in the map might be…
**Steps to reproduce:** - Install Contact app - Create a contact with a specific address - Go to the Map View of the Contact app - Filter to view the new contact - Position in the map might be slightly different from given one (when using OpenStreeMap) - Click on the position marker > `Navigate To` the address is recomputed correctly - Click on `View in Google Maps` the address given is often wrong **Issue:** Previous solution was trying to build the url used by the `View in Google Maps` button by using `partner_latitude` and `partner_longitude`. These were previously computed using the default geolocalization method. If it was set on OpenStreetMap, the coordinates were not precise enough and impacted the Google Maps results. As described in the documentation : `OpenStreetMap might not always be accurate.` But this shouldn't impact Google Place API results. **Fix:** Adapted the computation of `googleMapUrl()` to use `contact_address_complete` to ensure the addresses are recomputed properly when sent to Google Maps. opw-4649910 Forward-Port-Of: odoo/enterprise#87430
Tax reports now show the correct net base amount when invoice lines share the same tax but use different analytic distributions. This prevents overstated tax report figures while keeping the calculated tax amount unchanged.
Original PR description
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales…
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales (eg 10%) - Make sure the option "Analytic Accounting" is ticked in the settings - Create an invoice with two lines (eg both at $100), add the tax on both - Change the analytic distribution on both lines to different values - Confirm the invoice - Go to the tax report - Select the report "Group By: Account > Tax" - On the report the "Net" amount is doubled ($400), the tax amount is correct ($20) ### Cause: On the invoice we can see in "Journal Items" that two tax lines are created instead of one (one for each analytic distribution). The "Group By" reports are generated by [this query](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L92). At the [creation of the second subtable](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L164-L198) the move lines are linked together based among other things on the tax id. The [filter on analytic distribution](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L187-L191) does not apply here as `tax.analytic = False`. The result is that each tax line is linked with both base lines. The second subtable have 4 lines in this case, with each base line doubled. The result of the query have the base amount doubled. ### Solution: We cannot fix the query as there is no link to find the tax line origin amongst the base lines. The method `_read_generic_tax_report_amounts` in `account_reports` is made to fix the base values in report in case of duplicate. Until now it did not include the duplication caused by analytic distribution but duplication because of repartition lines for example. The fix is to use this method also for analytic distribution. So we add `tdr.analytic_distribution` in the `GROUP BY`. This value must be returned by the query in `account` so we add it. opw-4753676 Forward-Port-Of: odoo/enterprise#89569 Forward-Port-Of: odoo/enterprise#87404
Customer follow-up reports now ignore accounting entries that do not have a due date or payment terms. This prevents customers from being incorrectly marked for follow-up and avoids misleading statements showing action needed when the balance is actually zero.
Original PR description
### Issue: It is possible to break the followup reports by directly creating entries in the past. ### Steps to reproduce: - Example on Belgian loca - Accounting Dashboard > Misc > new Entry with -…
### Issue: It is possible to break the followup reports by directly creating entries in the past. ### Steps to reproduce: - Example on Belgian loca - Accounting Dashboard > Misc > new Entry with - Date far in the past (ie 2024-01-01) - Account: "400000 Customers", Partner: "test partner", Debit: 500.0 - Account: "499000 Suspense Accounts", Credit: 500.0 - Post - In Customers > Follow-up reports, the partner is marked as "In need of action" even if no due date was specified - Accounting Dashboard > Bank > new with Amount: 500.0 - "Save & Close" then click on it - In the page "Manual Operations" change the partner to the one from the MISC entry - Change the Account to "400000 Customers" - Validate - The follow-up report is no longer "In need of action" - Create an invoice with a due date in the future - The follow-up report is back to "In need of action" with the amount of the invoice - When sending the follow-up, the Customer statement reads "your account shows an outstanding balance of 0.00€" ### Cause: The origin of this issue is that the MISC entry and the Bank payment are not reconciled. The MISC entry is used to calculate the state of the followup making it to "In need of action" but the bank entry is balancing the amount to 0.00€. The MISC entry should not be used to compute the followup state as it has no due date specified (it makes no sense, it is never linked to any invoice). But in the code when there are no `line.date_maturity` we fallback on `line.date`. ### Solution: The lines without due date or payment term should not be used to compute the state of the followup or calculate the total due. So we remove the fallbacks on `line.date` when `line.date_maturity` is False. Some tests needed to be adjusted as they were not using any payment terms or due date. They were working because of the fallback on `line.date`. opw-4784250 Forward-Port-Of: odoo/enterprise#89627 Forward-Port-Of: odoo/enterprise#87873