← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 537858] Re: on_change event does not pass context to the method!

 

** Changed in: openobject-client
   Importance: Undecided => Wishlist

** Changed in: openobject-client
   Importance: Wishlist => Undecided

-- 
on_change event does not pass context to the method!
https://bugs.launchpad.net/bugs/537858
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Addons Modules: Confirmed
Status in OpenObject GTK Client: Confirmed
Status in OpenObject Web Client: Confirmed
Status in OpenObject Server: Confirmed

Bug description:
I wrote on_change event on product_id field in my object form to fill up another 'Description' field value with product name but what I notice it product name can not fetch according to language selected in preferences it fetch only English name. 

    def onchange_product_id(self, cr, uid, ids, product_id, context={}):
        res = {'desc': ''}
        if product_id:
            product = self.pool.get('product.product').read(cr, uid, product_id, ['name'], context)
            res['desc'] = product['name'] and product['name'] or ''
        return {'value':res}

I also try to print context which I passed in 'onchange_product_id' and its print blank dictionary and there for it can not pass in product object's read method and product name cant fetch according to context language.