Odoo Help

0

Stock Picking Out - Chatter Integration and Tracking

By
Peter
on 11/17/16, 4:07 AM 511 views

Hi!

I want to add the chatter module to the stock.picking.out model in OpenERP 7.

It seems to work, and we can send messages... 

But what doesn't work, is to track changes (by using the _track variable). The declared subtypes appear in the followers section, but i cant check the checkboxes and nothing happens...

I created a own module and heres my code:

stock_picking_chatter.py:

from openerp.osv import fields, osv

class stock_picking_chatter(osv.osv):
       
    _name = 'stock.picking.chatter'
    _inherit = ['stock.picking.out','mail.thread']
    _track = {
        'state':{
            'stock.picking.out.subtype_xml': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
            'stock.picking.out.subtype_xml2': lambda self, cr, uid, obj, ctx=None: obj['state'] != 'done',
        }
    }
stock_picking_chatter()

stock_picking_chatter.xml:

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
    <record id="subtype_xml" model="mail.message.subtype">
        <field name="name">Delivered</field>
        <field name="res_model">stock.picking.out</field>
        <field name="default" eval="True"/>
        <field name="description">Delivered!</field>
    </record>
 
    <record id="subtype_xml2" model="mail.message.subtype">
        <field name="name">Not delivered</field>
        <field name="res_model">stock.picking.out</field>
        <field name="default" eval="True"/>
        <field name="description">Not delivered!</field>
    </record>
</data>
</openerp>
0
aheficent
On 2/23/17, 10:05 AM

I think you just need to set:

_name = 'stock.picking.out'

It has to be the same as the name you are inheriting from

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

Question tools

1 follower(s)

Stats

Asked: 11/17/16, 4:07 AM
Seen: 511 times
Last updated: 2/23/17, 10:05 AM