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

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

By
Drees Far
on 7/20/15, 6:17 AM 764 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'

0

Pawan

--Pawan--
1267
| 4 3 5
Hyderabad, India
--Pawan--


Pawan
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

Thanks    


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

Drees Far
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.

Pawan
on 7/21/15, 1:05 AM
0

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
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 ;)

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