Skip to Content
Menu
This question has been flagged
5 Replies
9553 Views

Hello everyone,

Could I use smart button to open wizard??? if yes could you give me a sample example.

Thanks

Avatar
Discard
Best Answer

You can call wizard directly with type action button:

<button  type="action"  name="%(my_action)d" />
Avatar
Discard
Author

could you give me an example please

it is in the account_invoice_view.xml of the account module. You need to place that button in the form you want to add it into
Author

I found it thanks for the help

welcome :)

Best Answer

Hello Jihen,


Try this :-

<button class="oe_stat_button" type="object" name="open_tracebility" icon="fa-arrows-v" string="Tracebility" widget="statinfo"/>


@api.multi

def open_tracebility(self):

    res = self.env['ir.actions.act_window'].for_xml_id('custom_module_name', 'wizard_action')

    return res


Hope it works for you.

Thanks,

Avatar
Discard
Author

Thanks for your help but I didn't understand why I'm getting "External ID not found in the system" the wizard view: Comment Wizard school.comment.wizard 30

the button action: @api.multi def create_comment(self): res = self.env['ir.actions.act_window'].for_xml_id('school.comment.wizard', 'view_comment_wizrd_form') return res

Folder name is there instead of school.comment.wizard. Thanks,

Author

When I put it the folder name instead of school.comment.wizard I get this error return self.read(cr, uid, [res_id], [], context)[0]