Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

How can I enforce lead ownership rules for portal users on a reseller CRM module (custom code approach)?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
crmportal-userLeadsresellersodoo18
2 Replies
147 Rodiniai
Portretas
Elijah Nyendwa

I’m customizing an Odoo 18 setup where portal users (resellers) can log in to a CRM portal and view or edit opportunities assigned to them.

Right now, the module already:

  • Allows portal users to move opportunities through certain stages.

  • Lets them update key fields and communicate through the chatter.

The client, however, wants an additional lead ownership mechanism that can be enforced.

The idea is that:

  • A portal user can “claim” a lead when they start engaging it.

  • Once claimed, the lead should be locked to that user for a defined period (for example, 48 hours, 14 days, or 30 days depending on activity).

  • Ownership should expire automatically or via some manageable rule if no activity or progress is recorded.

  • Other portal users shouldn’t be able to re-claim or edit that lead until it’s released or expired.

I’m looking for suggestions or examples of how to implement this kind of lead ownership logic cleanly — ideally with a custom model, computed fields, or record rules — but still maintain flexibility for admin overrides.

What would be the best approach from a technical standpoint?

Any patterns or examples from similar portal-based CRM implementations would be very helpful.

0
Portretas
Atmesti
Portretas
Ray Carnes (ray)
Best Answer

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:

1
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer
Hi,

Try the following steps.

1. Add custom fields for ownership tracking:
To enable lead ownership, create three new fields in the crm.lead model, one to store the user who claimed the lead (claimed_by), one for the date the claim was made (claim_date), and one to record when the claim should expire (claim_expiry). The expiry date can be automatically computed using a helper method that sets it based on a configurable claim period (like 48 hours or 14 days). This setup provides the foundation for tracking lead ownership duration and expiration.

2. Add a “Claim” and “Release” button:
Next, add two action buttons on the CRM lead form, “Claim Lead” and “Release Lead.” These buttons trigger Python methods that assign the logged-in user to the claimed_by field or clear it when released. You can also add a computed boolean field is_expired to dynamically check if a lead’s ownership period has expired. This allows users to claim only unclaimed or expired leads, ensuring ownership control is respected.

3. Automatically expire ownership:
To manage expiring claims, create a scheduled action (cron job) that runs periodically, for example, every hour or day. This cron job identifies all leads whose claim_expiry date has passed and automatically resets their ownership fields. It ensures that expired leads become available again to other users without requiring manual intervention.

4. Apply record rules for portal users:
Use Odoo’s record rules to restrict portal users so that they can only edit leads they have claimed and that are still active (not expired). All other leads should be viewable but not editable. The record rule domain checks the claimed_by and claim_expiry fields to determine access rights. Admins or internal users are excluded from these restrictions so they can manage all leads freely.

5. Add flexibility for administrators:
Provide administrators with additional control by adding a “Force Release” option or allowing them to manually reset ownership fields. You can also include an optional is_admin_locked boolean field to prevent automatic expiration for specific cases. This gives admins full flexibility to override lead ownership rules when necessary.

6. Optional enhancement, extend ownership on activity:
For a more dynamic experience, configure the system so that the claim expiry automatically extends whenever the user performs an activity such as updating the stage or posting in the chatter. This can be achieved by overriding methods like message_post or using a compute function that refreshes the claim_expiry date whenever lead activity occurs.

This overall setup keeps the workflow clean, automated, and secure while allowing both portal users and administrators to manage lead ownership efficiently.



Hope it helps

0
Portretas
Atmesti
Elijah Nyendwa
Autorius

Thanks, but I've already tried that method, and I find it a bit redundant. The portal user is automatically assigned a lead when they click "I am interested," so they already own it. Adding claim fields seems to duplicate existing functionality, and the admin can easily remove the lead from the partner by clearing the partner assignment field.

What I'm looking for is something that tracks the assignment time and automatically releases the lead after, for example, 48 hours if no activity occurs.

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

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

Registracija
Related Posts Replies Rodiniai Veikla
See activities dashboard
crm Leads
Portretas
Portretas
1
birž. 24
2557
Auto-fill CRM fields when creating lead from email alias Solved
crm Leads
Portretas
1
geg. 22
4717
Facebook forms create leads
crm facebook Leads
Portretas
Portretas
Portretas
Portretas
Portretas
4
rugs. 25
5761
I am trying to open the popup dialog from lost when I change the stage on the kanban
crm dialog odoo18
Portretas
1
liep. 25
754
copy chatter messages from leads to sales order
crm chatter Leads
Portretas
Portretas
1
vas. 24
1920
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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