Odoo Help

Welcome!

This community 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.

0

Alert Box in search view in openerp 7.0?

By
rosey
on 1/2/15, 5:27 AM 834 views

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?

2
Nishant Jogi
On 1/2/15, 8:06 AM

Hello Rosey,

You can override read_group method to fulfill you requirments.

From there you can raise an exception.

Example:

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)

Thanks

Thanks.

rosey
on 1/3/15, 6:46 AM

https://www.odoo.com/forum/help-1/question/i-added-a-boolean-field-in-my-search-view-as-group-by-but-when-i-grouped-the-boolean-field-its-search-name-shows-as-true-how-can-i-change-true-to-my-field-name-71958

rosey
on 1/3/15, 6:47 AM

Can you please help me to solve the issue in the above question?

rosey
on 1/3/15, 6:48 AM

Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/2/15, 5:27 AM
Seen: 834 times
Last updated: 3/16/15, 8:10 AM