コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4518 ビュー

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...


アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
10月 22
5418
2
3月 22
4374
0
1月 23
2214
0
9月 22
2036
0
7月 22
2349