It is currently Sat Feb 11, 2012 10:42 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Get the ids of the selected line(s) in a tree view
PostPosted: Thu Sep 17, 2009 3:06 pm 
Offline

Joined: Thu Feb 19, 2009 3:42 pm
Posts: 57
Location: Bordeaux France
I have a form (timesheet) with a a tree view inside (timesheetlines).
I want to modify some lines of the tree with a wizard.

I found this old topic: http://www.openobject.com/forum/topic7665.html , but I don't understand how the problem was solved.

Is there an integrated method to get this id ?
In other words, how can my wizard get the id(s) of the selected (means highlighted) tree's line(s) ?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 17, 2009 5:08 pm 
Offline

Joined: Mon Jul 27, 2009 12:45 pm
Posts: 148
Selected ids are stored in data['ids'] variable. So from your wizard function, you can directly access all ids by doing for example:

Code:
ids = data['ids']


Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 17, 2009 7:25 pm 
Offline

Joined: Thu Feb 19, 2009 3:42 pm
Posts: 57
Location: Bordeaux France
Thx for fast reply.
I knew this ( data[ids]), but, my wizard is on the form view, so data[ids] contains the id of the form's object (timesheet in my case) not the ids of the lines selected in the treeview (the timesheet lines). That's what is explained in the old post I talked in the first message.

Is there a way to put the wizard in the tree view ? with a bouton ? an action ?
In fact I'd like to start my wizard by double cliking on one line.

Any idea about this ?

thx


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 17, 2009 8:51 pm 
Offline

Joined: Mon Jul 27, 2009 12:45 pm
Posts: 148
Oh, I understand your goal now... well, sorry, I have never done something like that so, let's hope somebody else can give you a decent answer!

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 09, 2009 7:55 am 
Offline

Joined: Fri Nov 06, 2009 7:11 am
Posts: 36
@ l_olivier
Quote:
Is there a way to put the wizard in the tree view ? with a bouton ? an action ?


I tried successfully to open wizard by click on a button on each line in tree view.
I hope it would be useful to you.
Here I want to share my code.

<record id="view_issue_tree" model="ir.ui.view">
<field name="name">project.issue.tree</field>
<field name="model">project.issue</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Bugs">
<field name="number"/>
<field name="name"/>
<field name="project_id"/>
<field name="priority"/>
<field name="state"/>
<field name="user_assign_id"/>
<field name="secure"/>
<button string="Subscribe Me" icon="terp-crm" name="%(wizard_subscribe_me)d" type="action"/>
</tree>

--
Regards,
rch


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 09, 2009 6:03 pm 
Offline

Joined: Thu Feb 19, 2009 3:42 pm
Posts: 57
Location: Bordeaux France
Cool, I will try this .
Thanx for sharing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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