Prevent Negative Values in Odoo Numeric Fields
Odoo 18 • Real-Time Integer & Float Field Validation
Stop users from entering negative quantities or amounts in Integer and Float fields with real-time validation and warning notifications - no backend changes required.
Zero Backend Changes Required
Lightweight client-side OWL widget validation - no Python model overrides needed. Works seamlessly across form views, editable list views, and one2many lines.
Key Highlights
Non-Negative Integer Widget
If the user types a negative number in an Integer field, the value is automatically reset to 0 and a warning notification is shown instantly.
Non-Negative Float Widget
Same protection for Float fields - supports decimal values and numpad input. Negative entries are corrected to 0.0 without disrupting user flow.
Smart Warning Notification
Warning toast appears only once per input session (debounced to 3 seconds), avoiding notification spam.
No "Invalid Fields" Odoo Error
Widget silently returns 0 instead of throwing a parse error - keeping the form saveable while still alerting the user.
No Backend Changes Required
Pure client-side OWL widget - apply non-negative constraints on any field without Python model overrides.
Works on All Editable Views
Compatible with form views, editable tree/list views, and embedded one2many lines across all Odoo modules.
Integer Field Validation
Integer field - negative value entered
Integer field - auto-corrected to 0 with warning
Float Field Validation
Float field - negative decimal entered
Float field - auto-corrected to 0.0 with warning
Our Features
Non-Negative Integer Widget
Non-Negative Float Widget
Smart Warning Notification (Debounced)
No "Invalid Fields" Odoo Error
No Backend Override Required
Works on Form, List & One2many Views
Numpad & Decimal Input Supported
Odoo 16, 17, 18 & 19 Compatible
Compatible with Custom Modules
Frequent Questions
Is this app compatible with Odoo Enterprise as well as Community?
Yes, the app works perfectly with Odoo Enterprise (On-premise and Odoo.SH) as well as Community. Odoo Online (Cloud) does not allow installation of third-party apps.
Does this widget work on both form view and list (tree) view?
Yes. The widgets can be used in any view type that supports editable fields - including form views, editable list views, and embedded one2many lines.
What happens when a user enters a negative number?
The widget silently corrects the value to 0 and displays a warning notification. The form remains fully saveable - there is no Odoo "Invalid Fields" error shown to the user.
Need customization? Who to contact?
Please contact us on Google Chat email: evozard@gmail.com
Overview
This module prevents users from entering negative values in Integer and Float fields across all editable Odoo views. It uses lightweight OWL client-side widgets - no backend model changes required.
Why Use This Module?
This Application is Suitable For
Installation Example
Simply add the widget attribute to any Integer or Float field in your view XML:
<field name="quantity" widget="non_negative_integer"/>
<!-- For Float fields -->
<field name="price" widget="non_negative_float"/>
Installation Steps:
- Download the module and place it in your Odoo addons folder
- Verify dependencies: web
- Update App list (Settings → Apps → Update App List)
- Install Prevent Negative Values
- Add the widget attribute to desired fields in your view XML
Developer Friendly:
- Easy widget integration - single attribute on any field
- No backend override required
- Lightweight client-side validation
- Supports editable tree & one2many views
- Numpad & decimal input supported
Technical Specifications
Privacy & Security
Support & Contact
Need help? Our team is ready to assist you.
- Website: https://www.evozard.com
- Email: evozard@gmail.com
- Documentation: Included in the module
Compatible: Odoo 16 • Community & Enterprise • Odoo.sh
© 2026 EVOZARD • All Rights Reserved
Prevent Negative Values in Odoo Integer & Float Fields
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 125 |
| Technical Name |
evo_non_negative_widget |
| License | OPL-1 |
| Website | https://evozard.com/ |
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