コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1700 ビュー

I'm using this code to get the order lines of a sale order
    sale_order_line_ids = fields.Many2many("sale.order.line","helpdesk_ticket_ids", compute="_compute_sale_order_lines", copy=True, auto_join=True)


    @api.depends("sale_order_id")    def _compute_sale_order_lines(self):        for record in self:            if record.sale_order_id:                record.write({"sale_order_line_ids": [(6, 0, record.sale_order_id.order_line.ids)]}) 

but if they are used in a view they cant be edited.
does anybody know what can be done to make them editable?

アバター
破棄
最善の回答

Hi,


You can't edit the field in the view because it is a computed field. By setting the computed field to readonly=False, you will make it editable.


.py

 sale_order_line_ids = fields.Many2many("sale.order.line","helpdesk_ticket_ids", compute="_compute_sale_order_lines", copy=True, auto_join=True,readonly=False)


Hope it helps

アバター
破棄
関連投稿 返信 ビュー 活動
0
3月 24
2249
1
1月 25
3491
2
8月 24
5882
1
10月 23
1337
6
12月 22
8861