跳至内容
菜单
此问题已终结
2 回复
8648 查看

Hello there,

Unable to display the currency symbol (the dollar symbol $) in the last colum (Taux horaire) of this tree view.


The currency_id should be the one of the main company.

Could you help? Where is my error?


In the tree view :

<field name="taux_horaire" widget='monetary' />
<field name="currency_id" invisible="1"/>              


In the Python :

class account_analytic_line(models.Model):
    _inherit = 'account.analytic.line'
 
    currency_id = fields.Many2one("res.currency", related='user_id.company_id.currency_id', string="Currency", readonly=True, required=True)
    to_invoice = fields.Boolean(string="To invoice", default=True)
    taux_horaire = fields.Float(string="Taux horaire", related='user_id.employee_ids.product_id.standard_price' )



形象
丢弃
编写者 最佳答案

Finally, I have changed this line :

currency_id = fields.Many2one("res.currency", related='user_id.company_id.currency_id', string="Currency", readonly=True)

I have restarted the server. It works now!


形象
丢弃
最佳答案

I have the same issue as you. But my problem is I forgot to add the currency_id field in view:


形象
丢弃
相关帖文 回复 查看 活动
1
3月 15
6016
1
9月 17
6413
1
6月 16
10485
1
6月 20
4053
1
9月 17
7642