| 1234567891011121314151617 |
- 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):
- if self.currency_id.rate_ids:
- rate = self.currency_id.rate_ids[0]
- if rate:
- self.rate= rate.inverse_company_rate
- else:
- self.rate = 0
-
|