Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

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

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
crmportal-userLeadsresellersodoo18
2 Besvarelser
148 Visninger
Avatar
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
Avatar
Kassér
Avatar
Ray Carnes (ray)
Bedste svar

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
Avatar
Kassér
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Bedste svar
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
Avatar
Kassér
Elijah Nyendwa
Forfatter

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!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
See activities dashboard
crm Leads
Avatar
Avatar
1
jun. 24
2557
Auto-fill CRM fields when creating lead from email alias Løst
crm Leads
Avatar
1
maj 22
4717
Facebook forms create leads
crm facebook Leads
Avatar
Avatar
Avatar
Avatar
Avatar
4
sep. 25
5761
I am trying to open the popup dialog from lost when I change the stage on the kanban
crm dialog odoo18
Avatar
1
jul. 25
754
copy chatter messages from leads to sales order
crm chatter Leads
Avatar
Avatar
1
feb. 24
1920
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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