Odoo Help

6

How to call a wizard from js in odoo

By
sreejith
on 10/12/16, 3:05 AM 535 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'

formView.include({

    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() {       

this._super();
        }    });

2

Avinash Nk

--Avinash Nk--
1188
| 3 2 4
Calicut, India
--Avinash Nk--


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

Hai sreejith...

Just try this code...


this.do_action({

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.

Register

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)

Stats

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