can't translate on_change warning message

Bug #686051 reported by Paulius Sladkevičius @ hbee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Undecided
Unassigned

Bug Description

I found that e.g. in the stock module onchange_lot_id function warning message translation don't work. If you translate this entry, in the warning will show English one, not translated.

Addons revno: 2886
Server revno: 2156

Revision history for this message
Hannes (Neobis) (nb2) wrote :

same here (openacademy training):

    def onchange_remaining_seats(self, cr, uid, ids, seats, attendee_ids):
        res = {
            'value':{
                'remaining_seats_percent': self._get_remaining_seats_percent(seats, attendee_ids)
            }
        }
        if seats < 0:
            res['warning'] = {
                'title': _('Warning'),
                'message': _('You cannot have negative seats'),
            }
        return res

This is not translated, although the exported PO file is translated correctly in the meantime.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

I'm marking this bug as not a duplicate anymore.
The messages can't be translated because the server does not pass a context parameter to the on_change functions.
It was refused to change this in v6.0 and v6.1.
But the roadmap for v7.0 states that the context will be implicitly passed everywhere.
So I'm confirming this bug for the R&D team to make sure we can eventually translate messages in on_change functions.
Lionel Sausin.

affects: openobject-addons → openobject-server
Changed in openobject-server:
status: New → Confirmed
Revision history for this message
Numérigraphe (numerigraphe) wrote :

Marking as duplicate of #900861 because another generic solution was proposed there.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.