It is currently Mon May 21, 2012 6:13 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to assign a value in a field in the same form
PostPosted: Wed Apr 13, 2011 6:15 pm 
Offline

Joined: Wed Dec 22, 2010 10:54 am
Posts: 401
Hello
I created a field (Test) "One2Many" in the product from
Calibrate which is in the object product.test.one
Then a button confirmation.

I'm trying to create a function to assign the value in the form of product description_sale.

Help thx.

_________________
je fume du thé et je reste éveillé le cauchemar continue


Top
 Profile  
 
 Post subject: Re: How to assign a value in a field in the same form
PostPosted: Wed Apr 13, 2011 6:46 pm 
Offline

Joined: Wed Dec 22, 2010 10:54 am
Posts: 401
def confirmation(self, cr, uid, ids, *args):
for o in self.browse(cr, uid, ids):
if o.test:
self.write(cr, uid, ids, {'description_sale': o.test})

I like matches : browse_record(product.test, 1)
no value

_________________
je fume du thé et je reste éveillé le cauchemar continue


Top
 Profile  
 
 Post subject: Re: How to assign a value in a field in the same form
PostPosted: Wed Apr 13, 2011 7:03 pm 
Offline

Joined: Wed Dec 22, 2010 10:54 am
Posts: 401
the solution :

def confirmation(self, cr, uid, ids, context=None):
for o in self.browse(cr, uid, ids, context=context):
if o.test:
self.write(cr, uid, ids, {'description_sale': o.test.name})

tx

_________________
je fume du thé et je reste éveillé le cauchemar continue


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