Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
2204 Переглядів

Hello,

I'm trying to display a warning message in some case, in the write function but it doesn't work


Here is my code below :

def write(self,values):

    record = super(StockPicking, self).write(values)
    if record:

        if self.s_note:
            return {
                  'value': record,
                  'warning': {
                      'title': 'WARNING',
                      'message': self.s_note}
                  }

    return record


Is it possible to do that ? If yes, where is my error?


Аватар
Відмінити
Автор Найкраща відповідь

Hello,

i finally found the solution.

I override the validate button in stock.picking form and add a wizard to display the warning message

Аватар
Відмінити
Найкраща відповідь

Odoo framework does not allow to return of any action/wizard from ORM methods like create/write/search, etc.
You will have to change your requirement and look for other ways to open a popup wizard-like from the button.

Аватар
Відмінити