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.

3

OpenERP 7.0.1.3 errors in multicurrency

By
Farshid G.
on 9/4/13, 3:07 PM 4,573 views

I have just upgraded my code to 7.0.1.3. I am using multicurrency and here is a brief configurations info:

  1. Two currencies (AFN as base and USD as secondary)
  2. Proper accounts created in the chart of accounts for both currencies
  3. Two journals created, one for AFN which is base currency and 2nd one for USD. Secondary currency in the journal is set to USD
  4. I create an invoice in AFS, receive the payment through USD journal but when i confirm, i get an error (No currency rate associated for currency 48 for the given period):
  5. Fiscal year, periods are set properly. Currency exchange rates are there for the current period. Price lists for both currencies set.

Below is the error log from the server: 2013-09-04 17:09:57,419 3850 ERROR xyzcompany openerp.tools.safe_eval: Cannot eval u'proforma_voucher()' Traceback (most recent call last): File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/tools/safe_eval.py", line 241, in safe_eval return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict) File "", line 1, in <module> File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 374, in function_proxy return attr(self._cr, self._uid, [self._id], args, *kwargs) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher self.action_move_line_create(cr, uid, ids, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account_voucher/account_voucher.py", line 1397, in action_move_line_create move_line_id = move_line_pool.create(cr, uid, self.first_move_line_get(cr,uid,voucher.id, move_id, company_currency, current_currency, context), context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/account_move_line.py", line 1226, in create result = super(account_move_line, self).create(cr, uid, vals, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 4319, in create vals = self._add_missing_default_values(cr, user, vals, context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 2489, in _add_missing_default_values defaults = self.default_get(cr, uid, missing_defaults, context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/account_move_line.py", line 163, in default_get data = self._default_get(cr, uid, fields, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/account_move_line.py", line 299, in _default_get data['amount_currency'] = currency_obj.compute(cr, uid, account.company_id.currency_id.id, data['currency_id'], -total, context=compute_ctx) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 230, in compute rate = self._get_conversion_rate(cr, uid, from_currency, to_currency, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/res_currency.py", line 31, in _get_conversion_rate rate = super(res_currency_account, self)._get_conversion_rate(cr, uid, from_currency, to_currency, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 201, in _get_conversion_rate if from_currency.rate == 0 or to_currency.rate == 0: File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 486, in __getattr__ return self[name] File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 401, in __getitem__ field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write") File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 113, in read res = super(res_currency, self).read(cr, user, ids, fields, context, load) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 3606, in read result = self._read_flat(cr, user, select, fields, context, load) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 3726, in _read_flat res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/fields.py", line 1133, in get result = self._fnct(obj, cr, uid, ids, name, self._arg, context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account_voucher/account_voucher.py", line 38, in _current_rate res = super(res_currency, self)._current_rate(cr, uid, ids, name, arg, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 34, in _current_rate return self._current_rate_computation(cr, uid, ids, name, arg, True, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 60, in _current_rate_computation raise osv.except_osv(_('Error!'),_("No currency rate associated for currency %d for the given period" % (id))) except_osv: (u'Error!', u'No currency rate associated for currency 48 for the given period') 2013-09-04 17:09:57,420 3850 ERROR xyzcompany openerp.netsvc: Error! No currency rate associated for currency 48 for the given period Traceback (most recent call last): File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, *args, *kwargs) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/osv.py", line 220, in exec_workflow res = self.exec_workflow_cr(cr, uid, obj, signal, args) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/osv.py", line 213, in exec_workflow_cr return object._workflow_signal(cr, uid, [res_id], signal)[res_id] File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 3928, in _workflow_signal result[res_id] = wf_service.trg_validate(uid, self._name, res_id, signal, cr) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/wkf_service.py", line 119, in trg_validate res2 = instance.validate(cr, id, ident, signal) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/instance.py", line 43, in validate workitem.process(cr, witem, ident, signal, force_running, stack=stack) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/workitem.py", line 60, in process ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/workitem.py", line 175, in _split_test _join_test(cr, t[0], t[1], ident, stack) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/workitem.py", line 183, in _join_test create(cr,[activity], inst_id, ident, stack) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/workitem.py", line 40, in create process(cr, res, ident, stack=stack) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/workitem.py", line 52, in process result = _execute(cr, workitem, activity, ident, stack) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/workitem.py", line 106, in _execute returned_action = wkf_expr.execute(cr, ident, workitem, activity) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/wkf_expr.py", line 67, in execute return _eval_expr(cr, ident, workitem, activity['action']) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr ret = eval(line, env, nocopy=True) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/tools/safe_eval.py", line 241, in safe_eval return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict) File "", line 1, in <module> File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 374, in function_proxy return attr(self._cr, self._uid, [self._id], *args, *kwargs) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher self.action_move_line_create(cr, uid, ids, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account_voucher/account_voucher.py", line 1397, in action_move_line_create move_line_id = move_line_pool.create(cr, uid, self.first_move_line_get(cr,uid,voucher.id, move_id, company_currency, current_currency, context), context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/account_move_line.py", line 1226, in create result = super(account_move_line, self).create(cr, uid, vals, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 4319, in create vals = self._add_missing_default_values(cr, user, vals, context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 2489, in _add_missing_default_values defaults = self.default_get(cr, uid, missing_defaults, context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/account_move_line.py", line 163, in default_get data = self._default_get(cr, uid, fields, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/account_move_line.py", line 299, in _default_get data['amount_currency'] = currency_obj.compute(cr, uid, account.company_id.currency_id.id, data['currency_id'], -total, context=compute_ctx) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 230, in compute rate = self._get_conversion_rate(cr, uid, from_currency, to_currency, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account/res_currency.py", line 31, in _get_conversion_rate rate = super(res_currency_account, self)._get_conversion_rate(cr, uid, from_currency, to_currency, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 201, in _get_conversion_rate if from_currency.rate == 0 or to_currency.rate == 0: File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 486, in __getattr__ return self[name] File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 401, in __getitem__ field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write") File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 113, in read res = super(res_currency, self).read(cr, user, ids, fields, context, load) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 3606, in read result = self._read_flat(cr, user, select, fields, context, load) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/orm.py", line 3726, in _read_flat res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/osv/fields.py", line 1133, in get result = self._fnct(obj, cr, uid, ids, name, self._arg, context) File "/home/ubuntu/WorkSpace/openerp/dev/addons/account_voucher/account_voucher.py", line 38, in _current_rate res = super(res_currency, self)._current_rate(cr, uid, ids, name, arg, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 34, in _current_rate return self._current_rate_computation(cr, uid, ids, name, arg, True, context=context) File "/home/ubuntu/WorkSpace/openerp/dev/server/openerp/addons/base/res/res_currency.py", line 60, in _current_rate_computation raise osv.except_osv(_('Error!'),_("No currency rate associated for currency %d for the given period" % (id))) except_osv: (u'Error!', u'No currency rate associated for currency 48 for the given period') 2013-09-04 17:09:57,422 3850 INFO xyzcompany werkzeug: 127.0.0.1 - - [04/Sep/2013 17:09:57] "POST /web/dataset/exec_workflow HTTP/1.1" 200

There seems to be multiple errors i am facing with 7.0.1.3, this is just one of them. Any solutions?

1

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 9/4/13, 3:45 PM

Salam Farshidjan,

This is more about config. Make sure you configure only 1 base currency, and the currencies you use have valid date (atleast one record with 1/1/2013 with rate) and rate.

Hope this helps.

Thanks, Serpent Consulting Services Pvt. Ltd.

2
Farshid G.
On 9/4/13, 3:56 PM

Seems like my friend Jay Vora from SerpentCS India helped me fix this issue.

The problem is that i had to set the base currency conversion date ( 1=1) to the first day of my first period starting! Works perfect 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: 9/4/13, 3:07 PM
Seen: 4573 times
Last updated: 3/16/15, 8:10 AM