Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
4498 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Hope it helps,

Thanks

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
srp 21
3802
1
dub 24
4422
1
čvn 23
4797
0
úno 22
2443
1
čvn 21
5567