Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Expect singleton: res.currency

形象
odoo
1 备注
形象
丢弃
形象
odoo
-

In the qweb I am commanding to call the field in this way: 



2 答案
0
形象
odoo
最佳答案

Hi,

First of all you have to correct the data type of the field amount_response, is it expected to hold integer or a string ? As per written function it has to be string, so field type should be Char or Text. Then modify the function as follows and see:

def _amount_response(self):
for rec in self:
amount_response = ''
if rec.currency_id:
amount_response = str(rec.currency_id.amount_to_text(rec.amount_total))
rec.amount_response = amount_response

Thanks

形象
丢弃
0
形象
odoo
最佳答案

You are getting multiple currency in currency_id instead of one currency.


形象
丢弃