2011-10-06 13:44:08 +00:00
|
|
|
openerp.pad = function(instance) {
|
|
|
|
|
2012-04-19 08:28:15 +00:00
|
|
|
instance.web.Sidebar = instance.web.Sidebar.extend({
|
|
|
|
init: function(parent) {
|
|
|
|
this._super(parent);
|
|
|
|
this.add_items('other',[{ label: "Pad", callback: this.on_add_pad }]);
|
|
|
|
},
|
2011-10-26 21:06:51 +00:00
|
|
|
on_add_pad: function() {
|
2011-10-06 13:44:08 +00:00
|
|
|
var self = this;
|
2012-04-19 08:28:15 +00:00
|
|
|
var view = this.getParent();
|
2012-04-19 08:46:50 +00:00
|
|
|
var model = new instance.web.Model('ir.attachment');
|
|
|
|
model.call('pad_get', [view.model ,view.datarecord.id],{}).then(function(r) {
|
|
|
|
self.do_action({ type: "ir.actions.act_url", url: r });
|
2011-10-06 13:44:08 +00:00
|
|
|
});
|
2011-10-26 21:06:51 +00:00
|
|
|
}
|
2011-10-06 13:44:08 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
};
|