Skip to Content

Welcome!

human made "AI" (advises & inputs) forum by Odoo professionals, experts and enthusiasts challenging real use cases with standard solutions!

-> solutions should be applicable for Odoo community or online (at the limit with Studio), all without custom modules.

This question has been flagged
2 Replies
353 Views

when switching to Odoo from another system or implementing Odoo, there always comes an opportunity to invite contacts to create a new account.

how to go online with Odoo and efficiently invite contacts to login?

Avatar
Discard

simpler variant, directly from the contact, that:
​# Create the portal wizard (it auto-populates user_ids from selected contacts = records)
​# Keep only wizard users who do NOT already have a portal user linked
​# Grant portal access to each eligible wizard user

portal_wizard = env['portal.wizard'].create({})
for user in portal_wizard.user_ids.filtered(lambda w: not w.partner_id.user_ids.filtered(lambda u: u.has_group('base.group_portal'))):
    user.action_grant_access()
Avatar
Discard
Author
  • from contact:
    • Select contacts and grant portal access by sending the “Portal: User Invite” email
  • efficient bulk solution
    • export contacts ID (not External ID) and email address of desired contacts and edit:
      • rename columns ID to “related partner/database id"
      • rename email column to “login”
      • add column “groups_id” with value “User types / Portal”
    • go to users and import the file
    • select the imported users and send password reset instructions
  • to send a personalised email:
    • adapt the template "Settings: New Portal Signup"
    • create a server action to send the personalised email:
records.with_context(create_user=True).action_reset_password()


  • If desired, to use/adapt other templates like “Settings: New User Invite” 
    • Adapt the template and also replace in all languages <a t-attf-href=“/web/login?auth_login={{object.email}}” with <a t-attf-href=“#{object.signup_url}”
    • adapt server action to send the “Settings: New User Invite” email
template = env.ref('auth_signup.mail_template_user_signup_account_created')
for record in records:
    template.send_mail(record.id, force_send=True)


Avatar
Discard
Related Posts Replies Views Activity
1
Aug 25
208
2
Mar 26
295
1
Aug 26
331
1
Aug 26
230
1
Aug 26
57