تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4734 أدوات العرض
الصورة الرمزية
إهمال
أفضل إجابة

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
مايو 22
34143
0
مارس 19
4181
0
يناير 19
5246
4
فبراير 24
12491
0
يناير 18
4021