Skip to content

Instantly share code, notes, and snippets.

@acarmisc
Created November 20, 2013 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acarmisc/7571345 to your computer and use it in GitHub Desktop.
Save acarmisc/7571345 to your computer and use it in GitHub Desktop.
def wiz_launch(self, cr, uid):
view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'hr_shift_wizard', 'act_window_wiz_shift_view')
return {
'name':"Display Name",
'view_mode': 'form',
'views': view_id,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'hr.shift.wizard',
'type': 'ir.actions.act_window',
'target': 'new',
'context': {}
}
and in js:
callPrint: function(e){
var self = this;
var ds = new instance.web.DataSet(this, 'wiz.shift', this.dataset.context);
ds.call('wiz_launch', []).done(function(r) {
console.log(r);
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment