Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Disable invitation email when creating user

Subscribe

Get notified when there's activity on this post

This question has been flagged
ldapemailnotification
4 Replies
17685 Views
Avatar
Sellem

Hi all,

I am setting up a self-hosted Odoo 8.0 to test some features and I activated LDAP Authentication.

LDAP is working fine but when I create a user, I have the following message :


"An invitation email containing the following subscription link has been sent:

http://odoo.mycompany.eu/web/reset_password?token=XXXXXXXXXXXXXX=XXXX"


I didn't find how to disable this invitation, someone has any idea of how to do it ?

I would like to know if it's also possible to make bulk import with LDAP, I mean just specify an OU and import all users inside this OU, any idea ?

Thanks for your help :)



4
Avatar
Discard
A. Person

Did you find any way to disable the invitation email? I'd like to do that too.

Avatar
Aron Lorincz
Best Answer

I browsed the source code and it turned out to be pretty easy. If you add  `no_reset_password` to the context, it won't send an email. You can then set the password manually (and find a way to let the user know it, obviously).

user = self.pg_user = self.env["res.users"].sudo().with_context(no_reset_password=True).create({
# user details here...
})
4
Avatar
Discard
feriel bendimerad

Hi Aron, coud you be more specific , which module do i have to change?

Aron Lorincz

Hi Feriel, The question is about how to disable email when you create it programmatically, so it assumes you already have your custom module installed. If you don't have a custom module, then create one, as it's really a bad idea to change other modules' source code, because your changes will be erased if you update that module to a newer version.

feriel bendimerad

Hi Aron , i got it , i actually have a custom module, do i have to inherit from the mail module? It has res_users.py file , if so , should i override the "create" methode only or others , please enlightened me .Thanks

Aron Lorincz

You should create your own res_users.py like this: class res_users(models.Model): _name = "res.users" _inherit = "res.users" Then override method "signup" and call the superclass method with the context parameter I mentioned in my answer. Hope it helps.

feriel bendimerad

thank you for help , but i missing something ,what should i put in user details ?

Aron Lorincz

The name, login, password, etc. of the user you want to create programmatically. This's what the original question was about. If you want to prevent Odoo from sending an invite when creating an user MANUALLY, you should just override the "signup" method in the "res.users" model like I described above.

feriel bendimerad

well , i'm creating a user using webservice API (java language) , and an email invitation is sent to him to change his password , so what do you mean by override "signup " method? changing only the context

Aron Lorincz

Can you pass context parameters via the API? If you can, I think it's enough to pass no_reset_password=True, then it won't send an email. If you can't pass context params via the webservice API, then create a new method in res.users which takes parameters about the user you want to create and creates it in the way I described in my answer.

Aron Lorincz

ps: and call that method via the API, obviously.

ubik

@Aron thanks for your answer, it helped. Just a question, why sudo() call is necessary?

Aron Lorincz

Well, it's not really necessary if the user that runs this code has rights to create users, but that was not the case in my code.

Avatar
tinnanka2
Best Answer

Thanks for all the information shared here!

0
Avatar
Discard
Avatar
Pedro Vagner
Best Answer

On Odoo 12, to disable via XML, just put no_reset_password context attribute:

<record id="demo_user0" model="res.users" context="{'no_reset_password': True}">
<field name="partner_id" ref="partner_demo_portal"/>
<field name="login">portal</field>
<field name="password">portal</field>
<field name="signature"><![CDATA[<span>-- <br/>Mr Demo Portal</span>]]></field>
<field name="groups_id" eval="[(5,)]"/><!-- Avoid auto-including this user in any default group -->
</record>
0
Avatar
Discard
Avatar
Emmanuel Belair
Best Answer

Hi, i know this post is a little bit old....

I'm beginner and i don't know how add this code inside a module. Could you post a more complete example please?

0
Avatar
Discard
Jonathan Leaders

I presume you could search for that line of code (with a grep like tool) in a locally cloned github repository

Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Is there an Email Notification on Leads/Issues?
email notification
Avatar
Avatar
4
Aug 16
7264
Mail Notification while approving leave in OpenERP in Andoird
email notification
Avatar
0
Mar 15
4800
ODOO [15.0] : Email - force options - Request a Delivery Receipt and Request a Read Receipt
email notification odoo15
Avatar
0
Jun 24
2055
Send email notifications through discuss module Solved
email notification discuss
Avatar
Avatar
1
Mar 24
3641
Create an email notification in odoo
mail email notification
Avatar
Avatar
1
Feb 24
4075
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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