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

Kevin McMenamin

--Kevin McMenamin--
804
| 5 2 6
Auckland, New Zealand
--Kevin McMenamin--
Kevin McMenamin
On 7/15/14, 4:12 AM

there is a standard get_rate function which uses the currency_id and date as parameters to return the correct rate - either reference this or copy the code

 

This is from account/account_move_line.py

cur_obj = self.pool.get('res.currency')

tmp_amount = cur_obj.compute(cr, uid, line.account_id.company_id.currency_id.id, context.get('currency_id',False), abs(line.debit-line.credit), context={'date': line.date})

 

the function is compute not get_rate

 

Thank you Kevin, how can i use this? If i use like res=get_rate(invoiceline.company_id.currency_id,invoiceline.date_invoice) it is giving "global name 'get_rate' is not defined " error

samba
on 7/15/14, 5:03 AM

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/14/14, 7:19 AM
Seen: 611 times
Last updated: 3/16/15, 8:10 AM