- from odoo import models, fields
- class AccountMove(models.Model):
- _inherit = "account.move"
- rate = fields.Float(compute="_get_last_exchannge_rate")
- def _get_last_exchannge_rate(self):
- rate = self.currency_id.rate_ids[0]
- if rate:
- self.rate= rate.inverse_company_rate
-
|