Skip to content

Conversation

@lef-adhoc
Copy link
Contributor

atchuthan and others added 30 commits October 14, 2025 16:50
Rule should only count available stock from selected warehouse from sale order.
Without warehouse in context, it currently sums all stock available in all warehouses.
The previous parent menu has an action attached, and with these modules,
it can't be clicked.
* [FIX] sale_exception confirm wizard
* [FIX] add test of test_all_draft_orders & flake8 & readme.rst
* [FIX] improve codecov test
* [FIX] delete odl translation
* [FIX] add Camptocamp to author
* [FIX] readme.rst
Raise SingletonError when you have a recordset with multiple sale order.
This restore the capability to write on multiple sale.order
Currently, it's located at the root menu because. It's a migration bug because the old menu was removed from 11.0.
The method called by 'sale_check_exception' has a side effect, it writes
on 'exception.rule' + on the Many2many relation between it and
sale.order(.line). When decorated by @api.constrains, any error during
the method will be caught and re-raised as "ValidationError".
This part of code is very prone to concurrent updates as 2 sales having
the same exception will both write on the same 'exception.rule'.
A concurrent update (OperationalError) is re-raised as ValidationError,
and then is not retried properly.

Calling the same method in create/write has the same effect than
@api.constrains without shadowing the exception type.

Full explanation:
OCA/server-tools#1642
* [IMP] sale_exception: show menu only to Exception Rule Managers
* [IMP] Reindent lines to 4 spaces
* [IMP] Improve information messages that display exceptions
* [REM] Remove exception_ids fields from the sale order view, because it's no longer necessary and it allowed users to accidentaly deactivate a Sale Exception Rule using the active widget.
* [IMP] Rename exception_ids_formatted to exceptions_summary
Disable for now as the solution is not obvious.

Partially fixes OCA#972
Other ways it provokes linter fail
TestSaleOrder was useless and making sale order tests run twice.
mymage and others added 20 commits October 14, 2025 16:50
Currently translated at 100.0% (43 of 43 strings)

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_exception
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_exception/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_exception
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_exception/
Currently translated at 100.0% (42 of 42 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_exception
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_exception/it/
Currently translated at 11.9% (5 of 42 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_exception
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_exception/nl/
Currently translated at 100.0% (42 of 42 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_exception
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_exception/nl/
…xceptions

When there are exceptions blocking the confirmation of an order, the user
normally finds out when clicking on the "Confirm" button.

At that time, the wizard is popup and the user -if he has enough permissions-
can ignore the exceptions and click confirm.

Before this commit, the wizard would only flag the order to ignore the
exceptions, but the order would not be confirmed. The user would have to click
again on the "Confirm" button to do so.

This is counter-intuitive since the user intention was clearly to confirm the
order in the first place, and it just forces the user to click again.

After this commit, the order is confirmed directly.

Additionally, the wizard will now hide the "Confirm" button if the exceptions
haven't been ignored.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_exception
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_exception/
Currently translated at 100.0% (46 of 46 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_exception
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_exception/it/
@lef-adhoc lef-adhoc mentioned this pull request Oct 14, 2025
93 tasks
@rousseldenis
Copy link
Contributor

/ocabot migration sale_exception

Copy link
Contributor

@matiasperalta1 matiasperalta1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.