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

Button action object not working

By
yogesh
on 3/18/15, 6:14 AM 1,089 views

Hello everyone,

I created a form with a button,then I created the function in python file.but when I click the button,nothing happens.

This is my function:

def getrecord_treeview(self, cr, uid, ids, context=None):

#print "welcome"

mod_obj = self.pool.get('ir.model.data')

res = mod_obj.get_object_reference(cr, uid, 'kegenmail','view_kmail_form')

res_id = res and res[1] or False

return{

'name':_('kegenmail'),

'res_model':'kegenmail',

'type': 'ir.actions.act_window',

'view_type': 'form',

'view_mode': 'form',

'view_id': [res_id],

'context':{},

'target':'new'

}

return true

please help me to solve these problems

3

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 3/18/15, 9:32 AM

Hi yogesh, try this code:


def getrecord_treeview(self, cr, uid, ids, context=None):  

mod_obj = self.pool.get('ir.model.data')

res = mod_obj.get_object_reference(cr, uid, 'kegenmail','view_kmail_tree')

res_id = res and res[1] or False

return{

           'name':_('kegenmail'),

           'res_model':'kegenmail',

           'type': 'ir.actions.act_window',

           'view_type': 'tree',

            'view_mode': 'tree',

            'view_id': [res_id],

            'context':{},

            'target':'new'

            }

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: 3/18/15, 6:14 AM
Seen: 1089 times
Last updated: 3/19/15, 1:21 AM