Odoo18-Base/addons/l10n_dz/models/account_move.py

13 lines
419 B
Python
Raw Permalink Normal View History

2025-03-10 11:12:23 +07:00
from odoo import api, models, fields
class AccountMove(models.Model):
_inherit = 'account.move'
amount_total_words = fields.Char("Amount total in words", compute="_compute_amount_total_words")
@api.depends('amount_total', 'currency_id')
def _compute_amount_total_words(self):
for record in self:
record.amount_total_words = record.currency_id.amount_to_text(record.amount_total)