This question has been flagged
10 Replies
2861 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.

Avatar
Discard

Install locale? User locale? Multi Currencies?

Author

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

base currency? demo data?

Author

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.

Author

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.

Best Answer

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

Avatar
Discard

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

Best Answer

 


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??

Avatar
Discard
Best Answer

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

Avatar
Discard
Best Answer

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.

Avatar
Discard
Best Answer

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.

Avatar
Discard