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.
I have two group by fields - field 1 and field 2.
And two subdivisions for field 1. These subdivisions have no relation with field 2.
When i select field 1 -- subdivision 1/subdivision 2 -->it shows the corresponding result.
If i select field 2 -- subdivision 1/subdivision 2 --> I need to dispaly an alert message. How should i display an alert box in search view?
You can override read_group method to fulfill you requirments.
From there you can raise an exception.
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
if 'field1' in groupby and 'field2' in groupby:
raise osv.except_osv(_('Warning!'), _('You can not group by both fields.'))
return super(your_class_name, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy=lazy)
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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: 1/2/15, 5:27 AM|
|Seen: 911 times|
|Last updated: 3/16/15, 8:10 AM|