This question has been flagged
1 Reply
10848 Views

I have been trying to get public user for altering sale orders created by public user. 

but i have seen no footprint of it anywhere in source code. anyone knows how to do it without giving 'login' or 'id' information ?

now i use this method to find the public user and fetch its commercial partner. 

public_user = self.pool['res.users'].browse(cr, SUPERUSER_ID, request.uid, context=context).login == 'public'

not the best way but does the job till i find something better.


Avatar
Discard
Author Best Answer

found i in ir_http.py

def _auth_method_public(self):
# TODO: select user_id from matching website
if not request.session.uid:
request.uid = self.pool['ir.model.data'].xmlid_to_res_id(request.cr, openerp.SUPERUSER_ID, 'base.public_user')
else:
request.uid = request.session.uid


Avatar
Discard