diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index f3758d2618c..797fb75f7c9 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -42,7 +42,7 @@ + quick_add="False" avatar_model="hr.employee"> diff --git a/addons/hr_holidays/static/src/js/QuickCreate.js b/addons/hr_holidays/static/src/js/QuickCreate.js deleted file mode 100644 index 586aa591a21..00000000000 --- a/addons/hr_holidays/static/src/js/QuickCreate.js +++ /dev/null @@ -1,83 +0,0 @@ -openerp.hr_holidays = function(instance) { - var _t = instance.web._t; - var QWeb = instance.web.qweb; - instance.hr_holidays = {} - /** - * Quick creation view. - * - * Triggers a single event "added" with a single parameter "name", which is the - * name entered by the user - * - * @class - * @type {*} - */ - instance.hr_holidays.QuickCreate = instance.web_calendar.QuickCreate.extend({ - template: 'hr_holidays.QuickCreate', - - /** - * close_btn: If true, the widget will display a "Close" button able to trigger - * a "close" event. - */ - init: function(parent, dataset, buttons, options, data_template) { - this._super(parent); - - this.dataset = dataset; - this._buttons = buttons || false; - this.options = options; - - //this.options.disable_quick_create = true; - - // Can hold data pre-set from where you clicked on agenda - this.data_template = data_template || {}; - }, - - - start: function() { - var self=this; - this._super(); - - new instance.web.Model("hr.holidays.status").query(["name"]).filter([["active", "=",true]]).all().then(function(result) { - var holidays_status = {}; - - _.each(result, function(item) { - var filter_item = { - value: item.id, - label: item.name, - }; - holidays_status[item.id] = filter_item; - }); - - var optionType = QWeb.render('hr_holidays.QuickCreate.select', { elements: holidays_status }); - console.log(optionType); - $(".qc_type").html(optionType); - }); - - }, - - focus: function() { - this.$el.find('input').focus(); - }, - - /** - * Gathers data from the quick create dialog a launch quick_create(data) method - */ - quick_add: function() { - var name = this.$el.find(".qc_name").val(); - var type = this.$el.find(".qc_type").val(); - - if (/^\s*$/.test(name)) { - return false; - } - return this.quick_create({'name': name,'holiday_status_id':parseInt(type)}).always(function() { return true; }); - }, - - - slow_add: function() { - var name = this.$el.find(".qc_name").val(); - var type = this.$el.find(".qc_type").val(); - this.slow_create({'name': name,'holiday_status_id':parseInt(type)}); - }, - - }); - -}; diff --git a/addons/hr_holidays/static/src/xml/qweb.xml b/addons/hr_holidays/static/src/xml/qweb.xml deleted file mode 100644 index 2148c5f7e61..00000000000 --- a/addons/hr_holidays/static/src/xml/qweb.xml +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file