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.

1

How to get translated state through browse ?

By
Yug Faa
on 2/21/14, 8:05 AM 825 views

Hello everybody,

I use a XML-RPC to access to invoices, I want to get the states of invoices, but always I get paid instead of Payé (French)

I use administrator to connect to the databse, he has as lang = 'fr_FR'

def _get_invoice_states(self, cr, uid, ids, field_name, args, context=None):
    if not context : 
        context = {}
        user = self.pool.get('res.users').read(cr, uid, uid, ['lang','tz'])
        context.update({'lang' : str(user.get('lang',u'fr_FR'))})
        context.update({'tz' : str(user.get('tz',u'GMT'))})
        context.update({'uid' : uid})
    result = {}
    for invoice in self.browse(cr, uid, ids, context=context):
        res = _('Name : ') + (invoice.number or '') 
        res += _('Etat : ') + (invoice.state or '')

Can you help me to get the wanted result, Thank you

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

1 follower(s)

Stats

Asked: 2/21/14, 8:05 AM
Seen: 825 times
Last updated: 3/16/15, 8:10 AM