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.

0

Error when tring to access a customer

By
Adrian
on 1/30/15, 7:35 AM 982 views

I get the following error when i click on a customer in Sales > Customers, i presume it has to do with the curency somehow although i used USD everywhere around.

This is the error text:

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 518, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 539, in dispatch result = self._call_function(**self.params) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 295, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 292, in checked_call return self.endpoint(*a, **kw) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 755, in __call__ return self.method(*args, **kw) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 388, in response_wrap response = f(*args, **kw) File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 949, in call_kw return self._call_kw(model, method, args, kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 932, in _call_kw records = getattr(request.session.model(model), method)(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 859, in proxy result = meth(cr, request.uid, *args, **kw) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3091, in read result = BaseModel.read(records, fields, load=load) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3123, in read self._read_from_database(stored) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3287, in _read_from_database res2 = self._columns[f].get(cr, self._model, ids, f, user, context=context, values=result) File "/usr/lib/python2.7/dist-packages/openerp/osv/fields.py", line 1361, in get result = self._fnct(obj, cr, uid, ids, name, self._arg, context) File "/usr/lib/python2.7/dist-packages/openerp/addons/account/partner.py", line 246, in _invoice_total result[partner.id] = sum(inv.user_currency_price_total for inv in invoices) File "/usr/lib/python2.7/dist-packages/openerp/addons/account/partner.py", line 246, in <genexpr> result[partner.id] = sum(inv.user_currency_price_total for inv in invoices) File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 774, in __get__ self.determine_value(record) File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 867, in determine_value record._prefetch_field(self) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3178, in _prefetch_field result = records.read(list(fnames), load='_classic_write') File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3123, in read self._read_from_database(stored) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3274, in _read_from_database res2 = self._columns[fs[0]].get(cr, self._model, ids, fs, user, context=context, values=result) File "/usr/lib/python2.7/dist-packages/openerp/osv/fields.py", line 1361, in get result = self._fnct(obj, cr, uid, ids, name, self._arg, context) File "/usr/lib/python2.7/dist-packages/openerp/addons/account/report/account_invoice_report.py", line 40, in _compute_amounts_in_user_currency currency_rate_id = currency_rate_obj.search(cr, uid, [('rate', '=', 1)], limit=1, context=context)[0] IndexError: list index out of range

Any help would be apreciated.

Install locale? User locale? Multi Currencies?

zbik
on 1/30/15, 8:11 AM

I tried to install multi currencies but I get the same error with or without it.

Adrian
on 1/30/15, 8:19 AM

base currency? demo data?

zbik
on 1/30/15, 10:22 AM

I check under Settings > Companies > My company name (just have one) and it's set to USD. I also picked USD when i installed the accounting module. I don't use demo data, i just have 1 client with a few invoices.

Adrian
on 1/30/15, 10:26 AM

Can't comment on your answer since i don't have enough karma, but that fixed the error. Thank you. I picked your answer as the correct one.

Adrian
on 1/30/15, 10:58 AM
3

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 1/30/15, 10:48 AM

You go to Invoicing/Miscellaneus/Currencies and verify USD currency, has rate = 1 (if so then retype). This may be compare rounding errors - ('rate', '=', 1) .

The issue is solved, when you activate multicurrecny, you need to put rate = 1 in your base currency.

wizardz
on 5/18/16, 4:53 AM
0
wizardz
On 5/18/16, 4:14 AM

 


When I change the rate to "1" it works, when I wanna put this in, I get this error you described . How can I fix that??

0
wizardz
On 5/18/16, 4:13 AM

where I can change the rate??? in the currencies???

0
Jan Kyselák
On 5/12/15, 3:59 AM

I have same problem and I have tried all of the above but nothing works, I am using Odoo 8 on Ubuntu, real data, CZK base currency, have multicurrency installed (we are also using EUR and GBP). I can open some customers and some not but can't find any reason why some works and some not. I wanted to comment on the last answer of Ludo but don't have enough carma yet...thank you for any help.

0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 1/30/15, 8:10 AM

In this passage "_compute_amounts_in_user_currency currency_rate_id = currency_rate_obj.search(cr, uid, [('rate', '=', 1)], limit=1, context=context)[0]" you autoamtically assume that you have at least one record in the return. This is probably not the case. 

Make sure that you first check the return value and only if anything exists check its first list item.

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: 1/30/15, 7:35 AM
Seen: 982 times
Last updated: 5/18/16, 4:14 AM