Odoo Help


TypeError: name_get() takes exactly 6 arguments (5 given) [Closed]

on 12/27/14, 6:11 AM 4,529 views

The Question has been closed

on 01/21/2016 23:15:22

i have use this code for onchange and its work

   def name_get(self, cr, uid, ids, kecamatan_id,city_id):
        if kecamatan_id:
            city= self.pool.get("wtc.kecamatan").browse(cr, uid, kecamatan_id)
            return {'value': {'city_id':city.city_id.id,'province_id':city.province_id.id}}

in my .xml

 <field name="kecamatan_id" on_change="name_get(kecamatan_id, city_id)"/>

when i hit save button version error but the data successfully saved

TypeError: name_get() takes exactly 6 arguments (5 given)

and when i choose one data , itss\ error like this

TypeError: name_get() got an unexpected keyword argument 'context'

whats should i fix with my code ? please help me

On 12/28/14, 10:11 PM


its still error even i add context=None

TypeError: name_get() takes at least 6 arguments (5 given)

what should i do with my code..hope u can help me


Baiju KS

--Baiju KS--
| 5 5 8
Kochi, India
--Baiju KS--
ODOO technical

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju KS
On 12/27/14, 10:38 PM

Hi Susi,

You have to pass context argument to that onchange function. Try this:-

def name_get(self, cr, uid, ids,context=None):




| 5 3 6
Jakarta, Indonesia
On 12/29/14, 1:25 AM

name_get is a special ORM method and the signature must be name_get(self, cr, user, ids, context=None).  So, you cannot pass in kecamatan_id and city_id.  If you want to use it for onchange, change the method name to something else (not name_get).

its work thank u

on 12/29/14, 6:16 AM

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.


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

1 follower(s)


Asked: 12/27/14, 6:11 AM
Seen: 4529 times
Last updated: 1/21/16, 11:15 PM