diff --git a/setup/lib/cli.py b/setup/lib/cli.py index f2ee06fb..c15d234f 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -127,7 +127,8 @@ def main(): #'update_special_values', 'set_sys_params', #'setup_reports', - ] + 'consume_tours', + ] if cmd == 'setup': methods = setup_methods diff --git a/setup/lib/functions.py b/setup/lib/functions.py index 0b28b55e..9691dfc7 100644 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -909,6 +909,25 @@ class DatenpolFunctions(): # except: # print "Fehler Anlage ExtID " + 'cust_account_mapp_' + acc + return True + def consume_tours(self): + """Odoo-Touren auf konsumiert setzen""" + + tours = [ + 'crm_tour', + 'mail_tour', + 'sale_tour', + 'rte', + 'rte_inline', + ] + + for uid in self._execute('res.users', 'search', []): + for t in tours: + vals = { + 'name': t, + 'user_id': uid, + } + self._execute('web_tour.tour', 'create', vals) return True