It is currently Sun Feb 12, 2012 7:59 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: osv_memory
PostPosted: Thu Mar 11, 2010 3:10 am 
Offline

Joined: Fri Apr 10, 2009 5:41 am
Posts: 46
Location: Ottawa, Canada
Hello,

I'm trying to develop a multi-page wizard for estimation. I basically collect a bunch of info about the order on the first couple of pages and then (try to) open up a one2many_list (also osv_memory) which is populated with products filtered by category.

What I've noticed is that it appears that it creates a new object every time I move to the next form in the wizard, which doesn't work for my approach. I'm using two classes - one for the estimate and one for the one2many, so every time I go to the next form it writes a new line to the estimate table.

I've tried returning the active_id in the context but that didn't seem to help. When I get to the one2many_list I end up with a bunch of new records in the estimate table and it ends up trying to do a select on 'id=False' which fails miserably.

So... does anyone have any insights into how to work with the new wizards? Specifically, how to operate on the same id for a multi-page wizard? I couldn't find any decent examples...

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 14, 2010 10:38 pm 
Offline

Joined: Sun Aug 17, 2008 7:39 pm
Posts: 71
Location: France - Jura
perhaps with :

new_part_id = self.read(cr, uid, ids, [])[0]
context.update({'new_part_id' : new_part_id['id']})

new_part_id contains actual osv_memory object on which you work.

put this in your action_method and pass new context in the return to the next page.

You can acces it via context['new_part_id']


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 24, 2010 4:11 am 
Offline

Joined: Fri Apr 10, 2009 5:41 am
Posts: 46
Location: Ottawa, Canada
Thanks bb39700, you pointed me in the right direction!


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