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

Hello,

in stock.picking form view, i have a field 'note_delivery'

When the form is open, if this field is filled, i want to display a popup with its value

How is it possible to do that?

Is there an event i can use or something else ?

Thank you

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

If you need to get it as a pop up message, you can raise warning from onchange function of any fields.


Sample:

@api.onchange('company_id')
def _onchange_company_id(self):
if self.note_delivery:
return {
'warning': {
'title': _('Delivery Note'),
'message': _('%s', self.note_delivery)
}
}


If this method is not suited for you, you can show the delivery note field as an alert in the view.


Thanks

Awatar
Odrzuć
Autor

Hi Mehjabin,

Thank you for your answer.
I allready tried with onchange event but the problem is that when you open stock.picking form view from sale.order form view, no change is done also the message is not displayed.

That's why i was thinking about an open event or something like that.
Or maybe override the fields_view_get function !?!