Odoo Help

Welcome!

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

0

How to call a wizard from js in odoo

By
sreejith
on 10/12/16, 3:05 AM 207 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();
        }    });

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/12/16, 3:05 AM
Seen: 207 times
Last updated: 10/12/16, 4:52 AM