Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

how update password of users in bulk using SQL

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
passwordsqlodoo
4 Antwoorden
5208 Weergaven
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
Annuleer
Avatar
Nirav Lakhani
Beste antwoord

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
Annuleer
Avatar
Dennis
Auteur Beste antwoord

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
Annuleer
Dennis
Auteur

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
Auteur

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
Beste antwoord

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
Annuleer
Dennis
Auteur

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
Beste antwoord

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
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
using SQL within Odoo...
values sql odoo
Avatar
Avatar
1
feb. 24
3289
Odoo demo not let me change the user password
password odoo odoodemo
Avatar
Avatar
1
jun. 23
2794
d
sql odoo v14
Avatar
0
aug. 21
111
how to use translated fields in search using query
database search sql odoo
Avatar
Avatar
1
mrt. 24
2248
Duplication error thrown even though no duplicate exists.
sql bug duplication odoo
Avatar
Avatar
1
mei 23
4118
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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