Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4405 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Hope it helps,

Thanks

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
sie 21
3694
1
kwi 24
4308
1
cze 23
4667
0
lut 22
2376
1
cze 21
5471