콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

Hello  all,

I have use this code to convert amount to word in my invoice report in odoo 14 C, and it worked great! but now I wannt to do unit tests for this function "amount_to_text" . If you have any ideas how to do it , please help! 

Thank you.

This my python file including this function:

********************************

from odoo import fields, models


class InvoiceOrder(models.Model):
_inherit = 'account.move'

# @api.multi
def _compute_amount_in_word(self):
for rec in self:
rec.num_word = str(rec.currency_id.amount_to_text(rec.amount_total))

num_word = fields.Char(string="Amount In Words:", compute='_compute_amount_in_word')

**************************************



아바타
취소

I think no any issues in your code.

작성자

Yes it works fine, but I am asked to perform unit tests for this function.
I followed the documentation on unit tests in Odoo but it still doesn't work for me!

관련 게시물 답글 화면 활동
1
1월 24
4642
2
10월 23
2651
0
6월 23
3666
1
5월 22
4648
0
11월 21
21