Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

how update password of users in bulk using SQL

Odebírat

Get notified when there's activity on this post

This question has been flagged
passwordsqlodoo
4 Odpovědi
5169 Zobrazení
Avatar
Dennis

I am using Odoo 13 and above.

For testing purpose, I want update passwords of all users ( excluding Admin ) in bulk because you know update one by one in backend is time consuming and error prone.

I think I can open psql and update res_user table directly, but the password there is encrypted, I should also update set password=encrypt('password').

However, I don't know how this encryption should be done.

Anyone knows the correct method to update password using SQL? Your help is appreciated.

0
Avatar
Zrušit
Avatar
Nirav Lakhani
Nejlepší odpověď

Hello, 

You can Use Below Module For Bulk Updating Password in Backend which is available in V14,15,16.

https://apps.odoo.com/apps/modules/14.0/bulk_update_user_password_sit

1
Avatar
Zrušit
Avatar
Dennis
Autor Nejlepší odpověď

Thanks for your swift suggestion.

Having a trial, it returns error.

UPDATE res_users SET password = crypt('password_for_test', gen_salt('sha1')) WHERE id in (6,10);

ERROR:  function gen_salt(unknown) does not exist

LINE 1: UPDATE res_users SET password = crypt('password_for_test', gen_salt('s...

                                                         ^

HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Is the gen_salt function version dependent?

I am using Odoo 13 CE. 


0
Avatar
Zrušit
Dennis
Autor

Pagico Flex's answer is inspiring though it's not completed and not working at least on my Odoo 13 CE.

But, upon further exploration to the issue, just learn more about the Odoo password.

First, the gen_salt function inside PostgreSQL is unknown but after CREATE EXTENSION crypt, then it becomes known.

Second, even gen_salt known but it doesn't support sha1 algorithm.

Third, whether odoo is uing sha1 unknown.

I have a select id, login, password from res_users; i found all password (encrypted) in db share a same format liked
$pbkdf2-sha512$25000$dC6ltJZSas2 .............

from start up to $25000$ are the same and in between a string sha512... does it mean it's using sha512?
sha512 also not supported by gen_salt

moreover, an identical string as prefix means concatenated encrypted password?

i am still looking for a solution for a SQL to change odoo user password altogether.

any idea is appreciated.

Dennis
Autor

I finally found the answer myself. It is very interesting and so simple that
update res_users set password = 'new_password' where id = xx;
that's it. simply give a password in plain text, no any complicated md5(), crypt() functions required.
then in psql,
select id, password you'll see the password in plain text, but....
you can login.
when u use backend to change password, the pw in db is encrypted.
very happy but do spend so much time on this, why didn't i just try the most simple way to update from the very beginning???

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

Hi,

You can utilize the following query to update the passwords for all users.


UPDATE res_users

SET password = md5('new_password')

WHERE id != (SELECT id FROM res_users WHERE login = 'admin');


Regards

-1
Avatar
Zrušit
Dennis
Autor

md5 is not work.
upon issued the update password SQL using md5() the password stored in res_users not liked other passwords created from backend.
e.g. the length of encrypted password much shorter.

Avatar
Pagico Flex
Nejlepší odpověď

UPDATE res_users SET password = crypt('new_password', gen_salt('sha1')) WHERE login != 'admin'; 

Replace 'new_password' with the actual password you want to set, and 'admin' with the login of the user you want to exclude (e.g., the Administrator).

-1
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
using SQL within Odoo...
values sql odoo
Avatar
Avatar
1
úno 24
3277
Odoo demo not let me change the user password
password odoo odoodemo
Avatar
Avatar
1
čvn 23
2787
d
sql odoo v14
Avatar
0
srp 21
111
how to use translated fields in search using query
database search sql odoo
Avatar
Avatar
1
bře 24
2246
Duplication error thrown even though no duplicate exists.
sql bug duplication odoo
Avatar
Avatar
1
kvě 23
4104
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now