Odoo Help


How to call a wizard from js in odoo

on 10/12/16, 3:05 AM 766 views

i would like to create a module which call a wizard from js. Based on existing expiry date field on sale.order, enable edit mode only if the expiry date exceeds current date . if current date exceeds, then open a wizard to enter a new expiry date.what i tried is given below,it gives an error AttributeError: 'expiration.wizard' object has no attribute 'expiration_date_wizard'


    on_button_edit: function() {   

var today = new Date()   

var test = new Model('sale.order').query(["validity_date"])   

var wiz = new Model('expiration.wizard')   

return wiz.call('expiration_date_wizard') 

  return this.to_edit_mode();

to_edit_mode: function() {       

        }    });

Avinash Nk
On 3/4/17, 6:24 AM

Hai sreejith...

Just try this code...


type: 'ir.actions.act_window',

res_model: 'expiration.wizard',

view_mode: 'form',

view_type: 'form',

views: [[false, 'form']],

target: 'new',

context:{'temp': temp, 't_id': t_id}


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/12/16, 3:05 AM
Seen: 766 times
Last updated: 3/4/17, 6:25 AM