Odoo Help

1

0
3 Answers
2
Avatar

Dhinesh

--Dhinesh--
3895
| 6 4 11
Pondicherry, India
--Dhinesh--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks.

 

Dhinesh
06-01-15 03:49

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....

1
Marvin Haß
06-01-15 03:56

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

 

3 Comments
Dhinesh
06-01-15 05:33

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

Marvin Haß
06-01-15 05:38

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

Dhinesh
08-01-15 21:53

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

0
Avatar

Ivan

--Ivan--

3400
| 6 3 9
Jakarta, Indonesië
--Ivan--
Ivan
06-01-15 04:26

@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).

1 Opmerking
Dhinesh
06-01-15 05:30

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

Stel een vraag
Writer
Keep Informed
1 volger(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now