[IMP] sale_zero_stock_blockage: add zero stock approval restriction o…#1306
Draft
vikvi-odoo wants to merge 3 commits into
Draft
[IMP] sale_zero_stock_blockage: add zero stock approval restriction o…#1306vikvi-odoo wants to merge 3 commits into
vikvi-odoo wants to merge 3 commits into
Conversation
…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.
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.