Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

How to create or expose a CRM portal view so that portal users can access and view CRM records (leads/opportunities) securely, just like they can view sales or invoices?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
record_rulescontrollersdevelopperguidecrm_leadportal-user
2 Respuestas
464 Vistas
Avatar
Elijah Nyendwa

Context

I’m developing a custom Odoo module (v18) to extend the portal functionality for CRM, similar to how portal users can access Sales Orders or Invoices by default.

The goal is for portal users (non-internal, unlicensed) to:

  • View and create CRM leads from the portal (/crm/my)
  • Move leads through stages
  • Have those leads visible to internal sales users inside the CRM pipeline.

Goal

Portal users can:

  • Log in and see a “My Leads” section in their portal dashboard
  • Create and update their leads through a form view
  • Move their leads through stages

Internal users can:

  • View all leads, including those created by portal users, inside the CRM module

 Current Behavior

  • Portal users can create leads — they show up under /crm/my and are stored in the database.
  • Leads do not appear in the internal CRM pipeline, even when searching by record ID.
  • In the backend, the Salesperson field (user_id) only shows internal users — not portal ones.
  • The “My Leads” menu item also does not appear in the portal homepage, even though it’s defined in XML.
  • Currently, the only way to reach the leads list is by manually entering the route /crm/my.

 Implementation Overview

1️Portal Menu XML

<template id="inherit_portal_active_warning_my_home" inherit_id="portal.portal_my_home" name="Custom Portal Menus" priority="25" customize_show="True"> <xpath expr="//div[hasclass('o_portal_docs')]" position="inside"> <t t-call="portal.portal_docs_entry"> <t t-set="icon" t-value="'/crm/static/description/icon.png'"/> <t t-set="title">My Leads</t> <t t-set="url" t-value="'/crm/my'"/> <t t-set="text">View and create new leads</t> <t t-set="placeholder_count" t-value="'lead_count'"/> </t> </xpath> </template>

Expected behavior: “My Leads” should appear on the portal dashboard.

Actual behavior: It does not appear, though other portal menu entries do.

2️Custom Portal Group

<record id="group_portal_crm" model="res.groups"> <field name="name">Portal User - CRM Access</field> <field name="category_id" ref="base.module_category_hidden"/> </record>

3️Record Rules for CRM Lead Access

<!-- Portal users: can see their own or linked partner leads --> <record id="rule_crm_lead_portal_user" model="ir.rule"> <field name="name">CRM Lead: portal user allowed leads</field> <field name="model_id" ref="crm.model_crm_lead"/> <field name="domain_force">['|', ('partner_id','child_of', user.commercial_partner_id.id), ('create_uid', '=', user.id)]</field> <field name="groups" eval="[(4, ref('base.group_portal'))]"/> <field name="perm_read" eval="True"/> <field name="perm_write" eval="True"/> <field name="perm_create" eval="True"/> <field name="perm_unlink" eval="False"/> </record> <!-- Internal users: can see all leads --> <record id="rule_crm_lead_internal_all" model="ir.rule"> <field name="name">CRM Lead: internal users see all</field> <field name="model_id" ref="crm.model_crm_lead"/> <field name="domain_force">[(1, '=', 1)]</field> <field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/> <field name="perm_read" eval="True"/> <field name="perm_write" eval="True"/> <field name="perm_create" eval="True"/> <field name="perm_unlink" eval="True"/> </record>

Leads created by portal users appear fine on the portal side

Internal users still cannot see those same leads in the CRM pipeline.

4️Controller Snippet

From controllers/crm_lead.py:

@http.route(['/portal/crm_lead/create'], type='http', auth='user', methods=['POST'], csrf=False) def portal_crm_create(self, **post): user = request.env.user vals = { 'name': post.get('name') or 'New Lead', 'contact_name': post.get('contact_name') or '', 'email_from': post.get('email_from') or '', 'type': post.get('type') or 'lead', 'user_id': user.id, # Assign to portal user 'partner_id': user.partner_id.id, } lead = request.env['crm.lead'].create(vals) return request.redirect('/crm/my')

Lead is created successfully

 Does not show up under the CRM app, even for Admin or Sales users.

 Problem Summary

  1. Portal-created leads exist in the database but are invisible in the CRM backend.
  2. The “My Leads” portal menu does not appear on the dashboard.
  3. Salesperson field (user_id) only lists internal users — cannot assign a portal user.

 My Questions

  1. How can I properly expose CRM leads to portal users so that:
    • Portal users can see and manage only their own leads,
    • Internal users can view all leads (including portal-created ones)?
  2. Why might the “My Leads” entry from my custom XML not appear on the portal homepage?
  3. Is there a safe way to allow portal users to be linked to leads (or even selectable in the Salesperson field) without converting them to internal users and consuming extra licenses?
  4. Are there specific wizards, views, or filters (like the user_id domain) in Odoo CRM that restrict visibility to internal users which I should override?
0
Avatar
Descartar
Avatar
Ray Carnes (ray)
Mejor respuesta

We already provide this functionality via the Resellers App:

https://www.odoo.com/documentation/18.0/applications/sales/crm/track_leads/resellers.html


Resellers use their Portal Account to (1) indicate they are interested in a Lead (which converts it into an Opportunity)


Then (2) update the information about Opportunities:


Resellers and Employees can then work on the same Lead / Opportunity together to support a Channel Sales model.


Also, look into the difference between a Lead and an Opportunity. They are both stored in the same model / table but Leads are only available from the Leads Menu, and only when the Leads feature is activated:

0
Avatar
Descartar
Elijah Nyendwa
Autor

ah, thanks very much

is it possible to extend the functionality where partners can themselves create leads assigned to themselves?

Ray Carnes (ray)

Create a Website Form that submits to create a Lead - just be sure it populates the Assigned Partner field.

Ray Carnes (ray)

They already have the option to Create an Opportunity so most people just do that.

Avatar
Codesphere Tech
Mejor respuesta

Hello,
Please check this third party app
https://apps.odoo.com/apps/modules/18.0/tk_portal_partner_leads

0
Avatar
Descartar
Elijah Nyendwa
Autor

hi so i downloaded your module,

either i dont know exactly how it works or its not working

I created a portal user and logged in and i could create a lead

EXCEPT that record is never created, doesnt appear in odoo CRM, doesnt even apear on the portal of my leads

Codesphere Tech

It is not developed by us.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
How to restrict portal access records Resuelto
record_rules portal-user odoo17EE
Avatar
Avatar
2
nov 24
2413
Odoo15 Show Quotes, Sales Order, Invoices for all companies for a portal user
record_rules multicompany portal-user
Avatar
Avatar
1
ene 24
2100
Controller giving 404 Error
controllers
Avatar
Avatar
Avatar
2
ago 25
3382
Controller not working Resuelto
controllers
Avatar
Avatar
Avatar
2
jun 25
1894
How many times a user is logging into portal?
portal-user
Avatar
2
oct 24
34
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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