Odoo Help

0

call a field from another class in an onchange function

By
layal abishalhla
on 4/1/14, 11:19 AM 1,352 views

in an onchange function i need to call a field(in order to get its value) from another class . any help please ?

0
Prakash
On 4/1/14, 11:45 AM

You'll find lots of examples in addons folder

Example:-

  def onchange_partner_id(self, cr, uid, ids, part, context=None):
        part = self.pool.get('res.partner').browse(cr, uid, part, context=context)
        user = part.user_id and part.user_id.id or uid
        val = {
          'user_id': user
        }
        return {'value': val}

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 4/1/14, 11:19 AM
Seen: 1352 times
Last updated: 3/16/15, 8:10 AM