Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Нерухомість
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Консалтинг
    • Бухгалтерська компанія
    • Партнер Odoo
    • Агенція маркетингу
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Меблі
    • Їжа
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Системи сонячної енергії
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Інші
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

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

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
crmportal-userLeadsresellersodoo18
2 Відповіді
161 Переглядів
Аватар
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
Аватар
Відмінити
Аватар
Ray Carnes (ray)
Найкраща відповідь

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
Аватар
Відмінити
Аватар
Cybrosys Techno Solutions Pvt.Ltd
Найкраща відповідь
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
Аватар
Відмінити
Elijah Nyendwa
Автор

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!

Реєстрація
Related Posts Відповіді Переглядів Дія
See activities dashboard
crm Leads
Аватар
Аватар
1
черв. 24
2563
Auto-fill CRM fields when creating lead from email alias Вирішено
crm Leads
Аватар
1
трав. 22
4721
Facebook forms create leads
crm facebook Leads
Аватар
Аватар
Аватар
Аватар
Аватар
4
вер. 25
5772
I am trying to open the popup dialog from lost when I change the stage on the kanban
crm dialog odoo18
Аватар
1
лип. 25
757
copy chatter messages from leads to sales order
crm chatter Leads
Аватар
Аватар
1
лют. 24
1929
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція Odoo - це одночасно дуже проста у використанні та повністю інтегрована.

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