Odoo Help


'account.invoice' object has no attribute 'on_change_bill_id'

Vale Trood
on 7/20/15, 6:17 AM 1,313 views

Hi friends !!!

Please, who can help me solve this error:

2015-07-20 10:11:46,540 9451 ERROR odoo openerp.http: Exception during JSON request handling.

Traceback (most recent call last):

File "/opt/odoo/odoo/openerp/http.py", line 536, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/opt/odoo/odoo/openerp/http.py", line 573, in dispatch

result = self._call_function(**self.params)

File "/opt/odoo/odoo/openerp/http.py", line 309, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/opt/odoo/odoo/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/opt/odoo/odoo/openerp/http.py", line 306, in checked_call

return self.endpoint(*a, **kw)

File "/opt/odoo/odoo/openerp/http.py", line 802, in __call__

return self.method(*args, **kw)

File "/opt/odoo/odoo/openerp/http.py", line 402, in response_wrap

response = f(*args, **kw)

File "/opt/odoo/odoo/addons/web/controllers/main.py", line 937, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/opt/odoo/odoo/addons/web/controllers/main.py", line 929, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/opt/odoo/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/odoo/openerp/api.py", line 363, in old_api

result = method(recs, *args, **kwargs)

File "/opt/odoo/odoo/openerp/models.py", line 5864, in onchange

record._onchange_eval(name, field_onchange[name], result)

File "/opt/odoo/odoo/openerp/models.py", line 5780, in _onchange_eval

method_res = getattr(self._model, method)(*args, context=self._context)

AttributeError: 'account.invoice' object has no attribute 'on_change_bill_id'




| 4 4 6
Hyderabad, India

On 7/20/15, 6:39 AM

Hi Drees,

You have to define a method called 'on_change_bill_id' in your py file for account.invoice object


The problem is that the error displayed does not mention the module where i can find the mistake.

Vale Trood
on 7/20/15, 6:50 AM

Your error is clearly displaying the object/model(account.invoice). you just needed to inherit the object and define this particular method.

on 7/21/15, 1:05 AM

Vale Trood

--Vale Trood--

| 5 2 7
Tunis, France
--Vale Trood--

Vale Trood
On 7/20/15, 6:47 AM

 I have found the error.

i found my self defining this in accout_invoice_view.xml file.

<field name="fiscal_position" options="{'no_create': True}" on_change="on_change_bill_id(partner_id, fiscal_position)"/>

And i am not defing it in the account_invoice.py.

Certainly, i have defined it and eliminate it from the python and i didnt remember to eliminate it from the xml.

I am sorry for the question i didnt pay attention, concentration miss...

I have eliminated it and everything works fine now ;)

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: 7/20/15, 6:17 AM
Seen: 1313 times
Last updated: 7/28/15, 9:44 AM