Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4562 Visualizzazioni
Avatar
Abbandona
Risposta migliore

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

 

Avatar
Abbandona
Autore

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

Post correlati Risposte Visualizzazioni Attività
2
mag 22
33755
0
mar 19
3927
0
gen 19
4963
4
feb 24
12170
0
gen 18
3853