Odoo Help

Welcome!

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

3

use of _track and track_visibility

By
Patricia
on 4/8/13, 4:16 PM 7,680 views

Dosen't work...the followers don't recieve an email when the state is change. Here is the code

In the document .py

_track = {
    'state': {
        'mt_escribano_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['enalquiler', 'alquilado', 'enventa','vendido'],
    },
}   

_columns = {
    'id': fields.integer('ID', readonly=True),
    'name': fields.char('Descripción', size=256, required=True),
    'number': fields.char('Nro. de expediente', size=64, required=True),
'state': fields.selection(PROPIEDAD_ESTADOS, 'Estado', size=16, readonly=True, track_visibility='onchange'),
'active': fields.boolean('Activo'),        
}

in then docuement _view.xml

     <field name="message_follower_ids" widget="mail_followers"/>
     <field name="message_ids" widget="mail_thread"/>

in the docuement _data.xml

<openerp>
    <data noupdate="1">
        
        <record id="mt_escribano_stage" model="mail.message.subtype">
            <field name="name">Stage Changed</field>
            <field name="res_model">escribano</field>
            <field name="default" eval="False"/>
            <field name="description">Stage changed</field>
        </record>
    </data>
</openerp>

The followers as well as the subtypes appears in the docuement web when i create a new document. Also when i add a follower he recieves an email inviting him to follow the document, but when i change the state of a document the followers don't recieve an email. What i'm doing wrong? Thanks.

Hi, have you already got an answer? I met with the same confusion.

phoebe
on 4/9/14, 6:12 AM
1

If you invite a new follower, he won't follow subtypes flagged with default=False. He will not receive the messages having this subtype. If you want new followers to automatically receive stage change notifications, set default to True.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 4/8/13, 4:16 PM
Seen: 7680 times
Last updated: 7/11/16, 4:49 AM