account_move.py 326 B

1234567891011121314
  1. from odoo import models, fields
  2. class AccountMove(models.Model):
  3. _inherit = "account.move"
  4. rate = fields.Float(compute="_get_last_exchannge_rate")
  5. def _get_last_exchannge_rate(self):
  6. rate = self.currency_id.rate_ids[0]
  7. if rate:
  8. self.rate= rate.inverse_company_rate