Skip to Content
Menú
This question has been flagged
1 Respondre
12410 Vistes

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
Descartar
Autor 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
Descartar
Related Posts Respostes Vistes Activitat
0
de juny 16
3091
8
de febr. 16
4766
0
de maig 20
3470
0
de gen. 17
3827
2
de nov. 16
4953