This question has been flagged
1 Reply
3380 Views

Hi. im just trying to get the 'partner_id' from the 'res.users' of the account im currently , here's my code below:

current_obj=self.pool.get('res.users').browse(cr,uid,ids,context)
                num=current_obj.partner_id

 

self.write(cr,uid,ids,{'storage':num},context=context)

=================================================AND THEN THIS ERROR CAME OUT and no result came in.

MissingError

One of the documents you are trying to access has been deleted, please try again after refreshing.

 

 

 

 

 

Avatar
Discard
Best Answer

Hi Lakay , the problem is with your code, you are passing the account_object ids to res.users object so you are getting error

current_obj=self.pool.get('res.users').browse(cr,uid,ids,context)
                num=current_obj.partner_id

use instead

current_obj=self.pool.get('res.users').browse(cr,uid,uid,context)
                num=current_obj.partner_id and current_obj.partner_id.id or False

Avatar
Discard
Author

yes i already figured this out. thanks for your reply