Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
3559 Ansichten

I try to put the value from currency "rate" to my account_invoice rows.

my field looks like this:


show_rate = fields.Char(related="res_currency.rate", store=True)


this gives me everytime an error with res_currency. 

I want to see the "rate" field in my account_invoice rows. How can I manage that?


thank you

Avatar
Verwerfen
Beste Antwort

It's not fair to use related field here. Related field will write back the value to the currency table.

If you only need to see the value, you could use a functional field.

@api.one
@api.depends('currency_id', 'currency_id.rate')
def _compute_amount(self):
    self.currency_rate = self.currency_id.rate
currency_rate = fields.Float('Currency Rate', compute='_currency_rate', store=True)
Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Nov. 20
3741
0
Juli 25
687
3
Feb. 25
2937
1
Nov. 24
2692
1
Dez. 23
2568