Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8688 Lượt xem

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' )



Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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!


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
6061
1
thg 9 17
6461
1
thg 6 16
10512
1
thg 6 20
4074
1
thg 9 17
7662