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

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

形象
丢弃
最佳答案

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Hope it helps,

Thanks

形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
3
8月 21
3306
1
4月 24
3763
1
6月 23
4076
0
2月 22
2057
1
6月 21
4898