Skip to content

[ADD] sale_zero_stock_approval: add zero stock approval control on sale orders#1275

Draft
aykhu-odoo wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-zero-stock-blockage-aykhu
Draft

[ADD] sale_zero_stock_approval: add zero stock approval control on sale orders#1275
aykhu-odoo wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-zero-stock-blockage-aykhu

Conversation

@aykhu-odoo
Copy link
Copy Markdown

@aykhu-odoo aykhu-odoo commented May 19, 2026

By default, sales users can confirm orders even when there is not enough available stock. While this provides flexibility, it can also lead to unintended commitments, stock inconsistencies, and reliance on manual validation.

This PR introduces a Zero Stock Approval mechanism to bring better control and accountability to such scenarios.

⚙️ Key Changes
Add a boolean field (zero_stock_approval) on sale orders
Restrict sales users from confirming orders with insufficient stock unless approval is granted
Allow sales managers to bypass this restriction
Make the field read-only for regular users and manageable by administrators
Extend confirmation logic to validate stock availability per order line

✅ Result
Controlled confirmation of zero-stock orders
Reduced risk of stock-related issues
Clear approval flow aligned with business rules
Improved reliability and traceability in sales operations

@robodoo
Copy link
Copy Markdown

robodoo commented May 19, 2026

Pull request status dashboard

@aykhu-odoo aykhu-odoo force-pushed the 19.0-zero-stock-blockage-aykhu branch from e8caa4a to c251395 Compare May 19, 2026 08:13
…le orders

In standard behavior, sales users can confirm orders even when there is
not enough available stock, which may lead to unintended commitments,
stock issues, or reliance on manual validation processes.

This change introduces a *Zero Stock Approval* mechanism to enforce
better control over such scenarios.

A boolean field is added on the sale order to explicitly allow
confirmation when stock is insufficient. For regular sales users, this
field acts as a required approval flag: they cannot confirm the order
unless it is enabled.

To maintain flexibility and align with existing access rights, sales
managers are not restricted by this rule and can confirm orders
regardless of stock availability or field value.

The field is read-only for regular users to prevent unauthorized changes,
while administrators can manage it as needed.

The confirmation logic is extended to validate stock availability per
order line and block confirmation when the conditions are not met.

This ensures that zero-stock sales are intentional, traceable, and
aligned with business approval workflows.
@aykhu-odoo aykhu-odoo force-pushed the 19.0-zero-stock-blockage-aykhu branch from c251395 to f9ee2ae Compare May 19, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants