[FIX] pad action
bzr revid: al@openerp.com-20120419084650-clu7oke9rz6me6pi
This commit is contained in:
@@ -5,20 +5,12 @@ instance.web.Sidebar = instance.web.Sidebar.extend({
|
||||
this._super(parent);
|
||||
this.add_items('other',[{ label: "Pad", callback: this.on_add_pad }]);
|
||||
},
|
||||
on_attachments_loaded: function(attachments) {
|
||||
this._super(attachments);
|
||||
var self = this;
|
||||
var $padbtn = self.$element.find('button.pad');
|
||||
var is_pad = function(a) {
|
||||
return a.type == 'url' && a.name == 'Pad';
|
||||
};
|
||||
},
|
||||
on_add_pad: function() {
|
||||
var self = this;
|
||||
var view = this.getParent();
|
||||
view.dataset.call_button('pad_get', [[view.datarecord.id], view.dataset.get_context()], function(r) {
|
||||
self.do_update();
|
||||
self.do_action(r.result);
|
||||
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 });
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user