تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2531 أدوات العرض

Hi,


I want to disable the tour (Drop Icon) for all users.


Where can I find this field in the database?


Thank you

الصورة الرمزية
إهمال

What was the answer?

If anyone finds the answer to this, I know our entire company would be happy to have them disabled

أفضل إجابة

those tours really are totally annoying
you could create a server action on users and create a contextual action using the following code

name: Consume All Known Tours

python code:

tour_mod = env["web_tour.tour"]
known_tour_names = set(tour_mod.search([]).mapped('name'))

for user_id in records:
  log_msg = ''
  for tour_name in known_tour_names:
    tour_id = tour_mod.search([('name', '=', tour_name),('user_id', '=', user_id.id)])
    if tour_id:
      log_msg = "{}user {} already consumed tour {}\n".format(log_msg, user_id.name, tour_name)
    else:
      tour_id = tour_mod.sudo().create({'name': tour_name, 'user_id': user_id.id})
      log_msg = "{}consumed tour {} for user {}\n".format(log_msg, tour_name, user_id.name)
  log(log_msg, level='info')


note that this relies on that someone (e.g. the admin through debug and the "disable all tours" on the bug) consumed all tours already.
it will then be applied to all users that are selected when the action is run
it also creates a log entry per user so you can check what it did...

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مايو 25
11
2
يناير 25
2357
1
ديسمبر 24
6066
1
نوفمبر 24
1884
2
سبتمبر 24
1721