Odoo Help

1
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

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 7/14/14, 7:19 AM
Seen: 794 times
Last updated: 3/16/15, 8:10 AM