Odoo Help

2

How to return different view from a method?

By
Anirudh Lou
on 10/23/14, 4:40 AM 873 views

Hello every one, kindda lost here in this situation. I have my method, my aim is to return some view if some condition is meet. Here is the logic of what i made.

def my_method(self,cr,uid,ids,context=None):
  some_var1
  some_var2
  ...
  if some_var1 < some_var2:
        return {
                'type': 'ir.actions.act_window',
                'name': 'The Trial',
                'res_model': 'alphalist',
                'view_mode': 'tree',
                'res_id': my_record_tree1,
                'target': 'current',
                'nodestroy': False,
        }
  elif some_var1 == some_var2:
         return {
                'type': 'ir.actions.act_window',
                'name': 'The Judges',
                'res_model': 'alphalist',
                'view_mode': 'tree',
                'res_id': my_record_tree2,
                'target': 'current',
                'nodestroy': False,
        }
....

BUT, upon running nothing is bieng returned. Does any one can help/enlighten me. PLS!

















 

0
Dércio Duvane
On 10/23/14, 5:11 AM

Hi, is this the whole snap of the code? If so, there's no else in your statement, which might be the reason why your are not getting a window!

i have put else, but still no view is bieng returned.

Anirudh Lou
on 1/22/15, 2:31 AM

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

Question tools

1 follower(s)

Stats

Asked: 10/23/14, 4:40 AM
Seen: 873 times
Last updated: 3/16/15, 8:10 AM