Comment 2 for bug 434266

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote :

No, it does not translate it correctly, but the context "arrives" correctly at:

    def action_move_create(self, cr, uid, ids, context={}):

Translation doesn't work because there're these lines of code:

            context.update({'lang': inv.partner_id.lang})
            compute_taxes = ait_obj.compute(cr, uid, inv.id, context=context)

before the call to:

            raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))

So, the previous lines should be:

            ctx = {}
            ctx.update( context )
            ctx['lang'] = inv.partner_id.lang
            compute_taxes = ait_obj.compute(cr, uid, inv.id, context=ctx)

For the rest everything should be OK. As I said the context reaches the function with the correct value. Please check out latest changes from the branch as I found some bugs which should now be fixed. I think that could be considered stable.