Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Integrate OpenChatter (mail.thread) in existing Model

Subscribe

Get notified when there's activity on this post

This question has been flagged
inherit7.0openchatter
3 Replies
27267 Views
Avatar
Marvin Haß

Hello,

is it possible to integrate the OpenChatter (mail.thread) in an existing Model like stock.move?

 

Regards

3
Avatar
Discard
Avatar
Dhinesh
Best Answer

Hi, This is a simple example. Add this _inherit = ['mail.thread', 'ir.needaction_mixin'] to stock.move in py:

class stock_move(models.Model):
    _name = "stock.move"
    _inherit = ['stock.move','mail.thread', 'ir.needaction_mixin']

In xml:

Add this before to your end of form tag:
<div class="oe_chatter">
    <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
    <field name="message_ids" widget="mail_thread"/>
</div>

To track changes in your field, you may want to use track visiblity. You can find detail here....

4
Avatar
Discard
Avatar
Marvin Haß
Author Best Answer

I'm working in Version 7.

class stock_move(osv.osv):
    _name = "stock.move"
    _inherit = ['mail.thread', 'ir.needaction_mixin']

Raises:

Traceback (most recent call last):
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/cli/server.py", line 97, in preload_registry
    db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/registry.py", line 203, in get
    update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/registry.py", line 233, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/loading.py", line 351, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/loading.py", line 256, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/loading.py", line 165, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/module.py", line 374, in init_module_models
    result = obj._auto_init(cr, {'module': module_name})
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/osv/orm.py", line 3114, in _auto_init
    self._o2m_raise_on_missing_reference(cr, f)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/osv/orm.py", line 3419, in _o2m_raise_on_missing_reference
    raise except_orm('Programming Error', "There is no reference field '%s' found for '%s'" % (f._fields_id, f._obj,))
except_orm: ('Programming Error', "There is no reference field 'sale_line_id' found for 'stock.move'")

######################

class my_stock_move(osv.osv):
    _inherit = ['stock.move', 'mail.thread', 'ir.needaction_mixin']

Raises:

Traceback (most recent call last):
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/cli/server.py", line 97, in preload_registry
    db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/registry.py", line 203, in get
    update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/registry.py", line 233, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/loading.py", line 351, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/loading.py", line 256, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/loading.py", line 161, in load_module_graph
    models = pool.load(cr, package)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/modules/registry.py", line 118, in load
    model = cls.create_instance(self, cr)
  File "/home/marvin/dev/erp-dev/7.0/parts/odoo/openerp/osv/orm.py", line 898, in create_instance
    raise TypeError('_name is mandatory in case of multiple inheritance')
TypeError: _name is mandatory in case of multiple inheritance

 

1
Avatar
Discard
Dhinesh

I have updated my answer. Put _name = "stock.move" and try again.

Marvin Haß
Author

Thanks! It works! I have not enough karma to vote or to mark my question as answerd... Stupid!

Dhinesh

Karma restrictions have been changed now due to spammers. I have upvoted your question so that you can get minimum points.

Avatar
Ivan
Best Answer

@Dhinesh forgets to put 'stock.move' in the _inherit.  It should be _inherit = ['stock.move', 'mail.thread', 'ir.needaction_mixin'].  Well, to get the discussion thread _inherit = ['stock.move', 'mail.thread'] would suffice.  The 'ir.needaction_mixin' is used more for validation feature (if an action is needed for this record).

0
Avatar
Discard
Dhinesh

Thanks. I forget to add 'stock.move' in _inherit.

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

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

Sign up
Related Posts Replies Views Activity
how can I add my google analytic tracking code to an inherit module (depend on web)
web analytic inherit 7.0
Avatar
0
Mar 15
5846
Is Webkit inheritance possible?
inheritance webkit inherit 7.0
Avatar
0
Mar 15
4180
How to do Prototpye inherit in odoo
inherit
Avatar
Avatar
Avatar
Avatar
Avatar
4
Mar 24
4622
Inheritance for account.financial.report model?
inherit
Avatar
Avatar
1
Oct 23
6586
Difference between_inherit (no _name property) and _inherit (_name property value same as _inherit) ?
inherit
Avatar
Avatar
1
Jun 22
7940
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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