Skip to content

[IMP] sale_zero_stock_blockage: add zero stock approval restriction o…#1306

Draft
vikvi-odoo wants to merge 3 commits into
odoo:19.0from
odoo-dev:19.0-dev-zero-stock-blockage-vikvi
Draft

[IMP] sale_zero_stock_blockage: add zero stock approval restriction o…#1306
vikvi-odoo wants to merge 3 commits into
odoo:19.0from
odoo-dev:19.0-dev-zero-stock-blockage-vikvi

Conversation

@vikvi-odoo
Copy link
Copy Markdown

This PR introduces a new Zero Stock Approval workflow to prevent out-of-stock items from being processed without managerial consent.

Changes Introduced:

Field Addition: Added a boolean field zero_stock_approval to the sale.order model.

UI Access Control: Configured the view layout to make the field readonly for regular users and editable only for sales managers.

Workflow Validation: Overrode action_confirm to validate stock availability before allowing order confirmation.

…n order confirmation

Introduce a 'Zero Stock Approval' boolean field to enforce inventory
checks during the sales order confirmation workflow.

- Add `zero_stock_approval` boolean field to the `sale.order` model.
- Restrict field edit permissions in the XML view layout: set to readonly
  for regular Sales Users (`sales_team.group_sale_manager` group excluded)
  and editable for Sales Administrators.
- Override `action_confirm` to intercept the confirmation process; block
  regular sales users from confirming orders with storable items at zero
  or negative stock unless a manager has checked the approval box.
@robodoo
Copy link
Copy Markdown

robodoo commented May 29, 2026

Pull request status dashboard

@vikvi-odoo vikvi-odoo requested a review from bit-odoo May 29, 2026 06:52
…nd fix linter strings

Fix CI linter error by wrapping user-facing ValidationError text inside the Odoo translation underscore helper function _().
…erator from translation string

Fix an issue in the zero stock validation message where the %s string formatting operator was causing runtime syntax errors.
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