Skip to Content
Menu
This question has been flagged
1 Reply
1600 Views

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

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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 !?!