Form Alerts and Guards
Show a coloured alert at the top of any form when the record matches a condition, and stop chosen buttons such as Confirm until it no longer does.
| Odoo | 16.0, 17.0, 18.0, 19.0, 20.0 |
| Editions | Community, Enterprise |
| Works with | Base and Web only (works on any app's forms) |
| Licence | OPL-1, 31 EUR |
| Tests | 9 automated, run on every version |
| Module | form_ |
The situation
Quotation S00002 for Ready Mat is worth $2,947.50. Your rule says anything above 1,000 needs a finance check first, and Ready Mat only takes deliveries before noon. Both facts live in an email from last year. The salesperson opens the quotation, sees neither, and clicks Confirm.
With this module you write those facts once, as rules. S00002 opens with a red alert that reads the real total and customer from the record, and a blue delivery note under it. Confirm is guarded: while the quotation is above 1,000 the click does nothing except show the alert again, and the attempt goes to Blocked Attempts. Members of the group you name in Allowed to Bypass can still confirm.
What it adds
Getting started
Open Apps, clear the Apps filter, search for Form Alerts and Guards and click Activate. It only needs Base and Web, so it works on the forms of every installed app.
Apps › form_alert_guard › Activate
Go to Settings › Form Alerts › Alert Rules and click New. Give the alert a title, choose the model and the style, build the condition and write the message. On the Button Guard tab add the buttons to block, if any, and the groups that may still click them. Only Settings administrators can create or edit rules.
Settings › Form Alerts › Alert Rules
Users do nothing new: they open records as usual and read the alerts that apply to them. When a guarded button is refused they see a red notice with the alert text and the record names. Administrators check Settings › Form Alerts › Blocked Attempts to see how often a rule stops someone, and archive or adjust the rule when it is no longer needed.
Fine print
Log
Want a rule that blocks saving, or an alert inside the list view?
Send us the model, the condition and your Odoo version.
Email odoo.expert.111@gmail.com
Also by Awins
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module