跳至內容
選單
此問題已被標幟
1 回覆
4578 瀏覽次數
最佳答案

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

相關帖文 回覆 瀏覽次數 活動
2
5月 22
33765
0
3月 19
3930
0
1月 19
4968
4
2月 24
12180
0
1月 18
3856