mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] web_timeline: Ability to duplicate record
[IMP] web_timeline: Ability to duplicate record
This commit is contained in:
@@ -16,6 +16,7 @@ odoo.define('web_timeline.TimelineController', function (require) {
|
||||
onRemove: '_onRemove',
|
||||
onMove: '_onMove',
|
||||
onAdd: '_onAdd',
|
||||
onDuplicate: '_onDuplicate'
|
||||
}),
|
||||
|
||||
/**
|
||||
@@ -133,6 +134,25 @@ odoo.define('web_timeline.TimelineController', function (require) {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets triggered when a timeline item is duplicated (triggered by the TimelineRenderer).
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_onDuplicate: function (event) {
|
||||
var self = this;
|
||||
return this._rpc({
|
||||
model: this.model.modelName,
|
||||
method: 'copy',
|
||||
args: [event.data.id],
|
||||
context: this.getSession().user_context,
|
||||
})
|
||||
.then(function (res_id) {
|
||||
self.create_completed([res_id]);
|
||||
event.data.callback();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets triggered when a timeline item is moved (triggered by the TimelineRenderer).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user