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.
Is there any way to restrict the number of records to be created for a single object or table
My requirement needs me to create only 3 contacts for my company. Is there any way to do so.
Thanks & Regards, Atchuthan
You can do this by def create() like:
_name = "test" def create(self, cr, uid, vals, context=None): limit = len(self.search(cr, uid, , context=context)) if(limit >= 15): raise osv.except_osv(_("Warning!"), _("Message to display")) else: return super(test, self).create(cr, uid, vals, context=context)
Here, test should be name of your object. I have given to 15 record's creation.
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: 8/5/13, 9:43 AM|
|Seen: 1884 times|
|Last updated: 3/31/15, 5:37 PM|