Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    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
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Problem with mail.thread inheritance to avoid subscribe of external partners

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
v8inheritanceopenchattermail_thread
8708 Представления
Аватар
Sandor Dobi

Hi,

The mail system has several flaws and nasty behaviour especially with information leak.

I describe a scenario:

Actors: Partner A -> External partner of the company, customer

User B, Manager C - > internal employees of the company.


Partner A  has a customer record in the odoo system with correct email adress.

1. Partner A sending an RFQ for Manager A and the odoo catchall interface catching that email and inserting into open chatter module. Author Partner A, recipient Manager C, subscriber Manager C.

2. Manager C forwarding this mail outside of odoo to User B and give hime instructions that he must prepare a quote.

3. Odoo's catchall interface importing this mail too, correctly recognizing that is member of mail thread which was started by Partner A. But here is a problem,

    The original mail and the forwarded mail got a new subscriber Partner A, and Partner A getting notifications about them, basically the Odoo system sending the forwarded mail to Partner A! This is the place of internal company information leak! After that time Partner A will get any information/mail (after importing them into the system with fetchmail job).


There is a boolean flag in res.partner (modified in mail addons) called 'notify_email' which controls the mails generated by notifications. Unfortunatelly it is defaults to True. But if we set this to False it wil lnot correct the problem because the partner getting subscribed to mail.thread only he don't get notifications. But this is an ann or nothing flag if we disable it then the Partner will not get any notifications, even the correct ones. 


So we need to implement a 'no_subscribe' flag and modify the mail.thread auto_subscribe and message_subscribe methods to be aware of that flag.


So we do the following:

class res_partner(orm.Model):

""" Update partner to add a field about notification preferences, and to set none as a default of notify_email """ name = "res.partner"
_inherit = ['res.partner']
columns = {
'no_subscribe': fields.boolean('Do not add as Follower automatically')
}

_defaults = {
'no_subscribe': True,
'notify_email': lambda *args: 'none'
}


class custom_mail_thread(orm.AbstractModel):
_inherit = "mail.thread"

def message_subscribe(self, cr, uid, ids, partner_ids, subtype_ids=None, context=None):

ids = self.pool.get('res.partner').search(cr, uid, [('no_subscribe','=',False), ('id','in', partner_ids)])
_logger.info(' MAIL.THREAD SUB: Filtering out partner ids:' + str(partner_ids) + ' result_ids:' + str(ids))
res = super(custom_mail_thread, self).message_subscribe(cr, uid, ids, ids, subtype_ids, context)
return res

def _message_auto_subscribe_notify(self, cr, uid, ids, partner_ids, context=None):

ids = self.pool.get('res.partner').search(cr, uid, [('no_subscribe','=',False), ('id','in', partner_ids)])
_logger.info(' MAIL.THREAD AUTO SUB NOTIFY: Filtering out partner ids:' + str(partner_ids) + ' result_ids:' + str(ids))
res = super(custom_mail_thread, self)._message_auto_subscribe_notify( cr, uid, ids, ids, context=None)
return res

As You see we are logging to log file both method call, and we expect them to be called, but there is a problem. The res.partner modification was ok there is a new field and we can see it, and the new default setting for notify_email is working too.

But our two new method was never called, we try several with several mails feeded into fetchmail cron job to see if they called or not and they are not called at all and we cannot change the errorneous behaviour of the mail.thread. 


Please help us to find the correct way  ti implement this change, and please help us to understand the quirks of odoo model inheritance, because we don't see the point why it not working at all.


Thanks


 




1
Аватар
Отменить
Dr Obx

Very interesting subject, I will follow it because I need something like that too.

Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
followers from many2many field
v8 openchatter
Аватар
Аватар
1
июл. 21
4354
Inherit view to another model
v8 views inheritance
Аватар
Аватар
1
сент. 16
5263
How do you replace the module name with a nicer string in OpenChatter section?
v8 history openchatter
Аватар
1
мар. 15
4579
Why can't I override the "name" field on the Sales Order Lines view? Решено
v8 views inheritance
Аватар
1
мар. 15
7835
odoo v8 mail_thread displaying received html email with table inside, table width wider than parent div width
mail v8 css mail_thread
Аватар
1
июл. 16
4789
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة 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, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

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