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

order_line = fields.Many2many ('purchase.order.line', string = 'Available Products')

@ api.model
def default_get (self, fields):
res = super (PurchaseUpdatePriceWizard, self) .default_get (fields)

active_product = self.env ["purchase.order"]. browse (self.env.context.get ("active_id")). search ([]) [0] 
res.update ( {
'order_line': [(6, 0, [active_product.id])]
})
return res



# I am getting blank wizard but i want to display current purchase order line in my wizard. Please help

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

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Hope it helps,

Thanks

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

Hi,

In your case, you search the records with the purchase.order models, but you need the purchase.order.line so could you please update your code with the purchase.order.line search.


try to write

res.update ( {
'order_line': [(6, 0, [active_product.order_line.ids])] }
)

Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 8 21
3830
1
thg 4 24
4459
1
thg 6 23
4872
0
thg 2 22
2484
1
thg 6 21
5595