Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
The Question has been closedby
I need to write my own validation on default save button of openerp 7.0 in partners where I check validation for certain fields.
For that you need to override two methods in
create: Which is called when new record is created.
write: Which is when existing record is updated.
def create(self, cr, uid, vals, context=None): #Your code goes here res = super(your_class_name, self).create(cr, uid, vals, context=context) #Your code goes here return res
def write(self, cr, uid, ids, vals, context=None): #Your code goes here res = super(your_class_name, self).write(cr, uid, ids, vals, context=context) #Your code goes here return res
You can use
_constraints also to validate your fields.
def _my_check_method(self, cr, uid, ids, context=None): #Your code goes here return True or False _constraints = [(_my_check_method, 'Your Message', ['your_field']),]
True if your validation condition satisfy,
False otherwise from your method of constraints.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/17/13, 1:32 PM|
|Seen: 3550 times|
|Last updated: 4/10/15, 7:18 AM|