It is currently Wed May 23, 2012 2:51 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: find view id in function
PostPosted: Fri Jul 29, 2011 11:56 am 
Offline

Joined: Tue Jun 14, 2011 6:23 pm
Posts: 12
Hi,

is somebody know how to find the id (as an integer) of a view or an action in a python function?

something like
Code:
def get_view_id(cr, uid, ids, context):
    view_id = myobject.the_veiw_id_as_it_was_define
    return view_id

where view_id is an integer and
where the theveiwidasitwasdefine is :
Code:
<record model="ir.ui.view" id="the_veiw_id_as_it_was_define">
...
</record>


thanks


Top
 Profile  
 
 Post subject: Re: find view id in function
PostPosted: Sat Aug 06, 2011 7:07 am 
Offline

Joined: Mon Jan 10, 2011 11:08 am
Posts: 78
Hi...

Check out this below code... In this u need to pass the Module name and View Id, which will fetch you the integer id of View...

Code:
models_data = self.pool.get('ir.model.data')
sale_order_form = models_data._get_id(
                                      cr, uid, 'sale', 'view_order_form')                 
sale_order_tree = models_data._get_id(
                                      cr, uid, 'sale', 'view_order_tree')


Check out in standard module.. Check the process of how CRM lead will be converted to Oppurtunity....

Hope this might help u....


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP