Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4544 Weergaven

Hello everyone,


I have created a wizard and i need this wizard to be called in case of some logic.


Her the function that i called the wizard inside it:

def button_mark_done(self):
     res = super(MrpProduction, self).button_mark_done()
     for order in self:

if any(x.quality_state == 'fail' for x in order.check_ids)

self.call_change_location_wizard()

return res

Her the  other function with wizard action:


def call_change_location_wizard(self)

wizard = self.env['ir.actions.act_window']._for_xml_id("custom_module.wizard_action")

return wizard

No errors raised and when executing any print statement inside any function work but the wizard not pop-up


Thanks...


Avatar
Annuleer
Beste antwoord

Hi,
Please return the wizard function.
Ie,

def button_mark_done(self):
     res = super(MrpProduction, self).button_mark_done()
    for order in self:
       if any(x.quality_state == 'fail' for x in order.check_ids):
           return self.call_change_location_wizard()
    return res

You want to return the function then only pop-up the wizard.

Regards

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
okt. 22
5431
2
mrt. 22
4377
0
jan. 23
2217
0
sep. 22
2058
0
jul. 22
2358