This question has been flagged
2 Replies
4455 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'

Avatar
Discard
Best Answer

Hi Drees,

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

Thanks    


Avatar
Discard
Author

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

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

Author Best Answer

 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 ;)

Avatar
Discard