1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Copyright (c) 2007-2008 Sandas. (http://www.sandas.eu) All Rights Reserved.
6
# WARNING: This program as such is intended to be used by professional
7
# programmers who take the whole responsability of assessing all potential
8
# consequences resulting from its eventual inadequacies and bugs
9
# End users who are looking for a ready-to-use solution with commercial
10
# garantees and support are strongly adviced to contract a Free Software
13
# This program is Free Software; you can redistribute it and/or
14
# modify it under the terms of the GNU General Public License
15
# as published by the Free Software Foundation; either version 2
16
# of the License, or (at your option) any later version.
18
# This program is distributed in the hope that it will be useful,
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
# GNU General Public License for more details.
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the Free Software
25
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27
############################################################
33
def _after_login(self, cr, uid, data, context):
34
user_pool = pooler.get_pool(cr.dbname).get('res.users')
35
action_pool = pooler.get_pool(cr.dbname).get('personal.base.action.login')
36
wizard_pool = pooler.get_pool(cr.dbname).get('ir.actions.wizard')
37
for id in action_pool.search(cr, uid, []):
38
action = action_pool.browse(cr, uid, id)
39
if action.action_id.type == 'ir.actions.wizard':
40
my_wizard = wizard_pool.browse(cr, uid, action.action_id.id)
41
service = netsvc.LocalService('wizard.' + my_wizard.wiz_name)
42
service.execute(cr.dbname, uid, {"form":{}})
44
res = user_pool.search(cr, uid, [])
45
user = user_pool.browse(cr, uid, res[0])
47
user_pool.write(cr, uid, uid, {'first_login': False})
51
class wizard_after_login(wizard.interface):
55
'result': {'type': 'action', 'action':_after_login, 'state':'end'}
58
wizard_after_login("personal.base.wizard.after_login")