Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3527 Visualizzazioni

I'm developing a custom module. In some models I have some tracked fields by using "_track_visibility" option and state field by using "_track" option. When a new object is created tracked fields are shown properly translated, but when I change state field value to confirmed, then tracked fields are shown in English and not as I was expecting translated to Spanish.

What's the problem here? I'm doing something wrong? Is this problem fixed in Odoo v8? There is some parts of my code:

class death(osv.osv): _name = 'death.death' _description = _("Death Record") _rec_name = 'date' _inherit = ['mail.thread', 'ir.needaction_mixin'] _track = { 'state': { 'animal_health_and_biosafety.mt_death_confirmation': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['confirmed'] }, } columns = { 'date': fields.date('Date', required=True, readonly=False, states={'confirmed': [('readonly', True)]}), 'cause_id': fields.many2one('death.cause', string='Cause', help='Death cause', readonly=False, states={'confirmed': [('readonly',True)]}, track_visibility='always'), 'amount': fields.function(_amount, type='integer', string='Amount', multi="amount", help="Number of dead animals", track_visibility='always'), 'note': fields.text('Description', readonly=False, states={'confirmed': [('readonly', True)]}), 'state': fields.selection([('unconfirmed', 'Unconfirmed'), ('confirmed', 'Confirmed')], 'State', required=True, help="Status"), }
Avatar
Abbandona