use of _track and track_visibility

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 the 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>
原文地址:https://www.cnblogs.com/chjbbs/p/3510431.html