Skip to content
Snippets Groups Projects
  1. May 16, 2023
    • Guillaume (gdi)'s avatar
      [FIX] website: compute company id for new users · eda9ad14
      Guillaume (gdi) authored
      When a new user is created from the website, the company id was always
      set to the first company of the database even if the website was the one
      of another company. This flow has been already fixed if there is the
      "Specific User Account" setting activated (see [this other commit]).
      This commit fixes the same issue but for every case.
      
      Steps to reproduce the issue:
      - Create 2 companies A & B
      - For each company, create a website linked to a different URL
      - Activate 'Free sign up' for company B
      - As a public user, go to website of company B
      - Go to 'Sign in > Don't have an account?' and create an account
      
      => If as an admin you check the company of the created user, it is
      company A instead of company B.
      
      [this other commit]: https://github.com/odoo/odoo/commit/77c708c516beb322df37220634e178ba82e894c9
      
      
      
      task-3277317
      
      closes odoo/odoo#120475
      
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      eda9ad14
  2. Oct 14, 2019
    • Lucas Lefèvre's avatar
      [FIX] website: Display duplicate login error message · d133df58
      Lucas Lefèvre authored
      
      When you try to create two users with the same login, the shown error message is
      the Postgresql integrity error instead of a nice (translated) validation error.
      This happens since bf88f3e3 which changed the way error messages are translated.
      
      The reason is the manually created unique index `res_users_login_key_unique_website_index`.
      The error handling and translation mechanisms don't know it exists.
      The index was created for performance reasons in commit b5a12b4a where the
      original python constraint was replaced with this custom SQL index.
      
      In this commit, the python constraint is re-introduced to remove the index hack,
      but the implementation now uses a single SQL query, which should be quite fast.
      
      closes odoo/odoo#38737
      
      X-original-commit: 817a811e
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      d133df58
Loading