How can I extend this function (edit button) on JavaScript within Odoo?
<p>I would like to create a module which controls edit button on certain conditions. I tried the following code in js but I got no effect. So I would like to know how to extend a function in js.</p>

<pre><code>formView.include({
    init:function(){

        var edits = new Model('sale.order');
        edits.query(['validity_date']);
        console.log(validity_date)
        },
    on_button_edit: function(){
        this._super();
</code></pre>