[WIP] Refactoring Code

This commit is contained in:
Dario Lodeiros
2018-11-07 10:30:29 +01:00
parent 1359a3848d
commit 982c9b629b
102 changed files with 114 additions and 1470 deletions

View File

@@ -1,28 +0,0 @@
// Copyright 2018 Alexandre Díaz <dev@redneboa.es>
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
odoo.define('hotel_calendar.listview_button_open_reservation_wizard', function(require) {
'use strict';
var ListView = require('web.ListView'),
Core = require('web.core'),
_t = Core._t;
ListView.include({
render_buttons: function () {
var self = this;
this._super.apply(this, arguments); // Sets this.$buttons
if (this.dataset.model == 'hotel.reservation') {
this.$buttons.append("<button class='oe_button oe_open_reservation_wizard oe_highlight' type='button'>"+_t('Open Wizard')+"</button>");
this.$buttons.find('.oe_open_reservation_wizard').on('click', function(){
self.do_action('hotel_calendar.open_wizard_reservations');
});
}
}
});
return ListView;
});

View File

@@ -0,0 +1,28 @@
odoo.define('hotel.ListController', function(require) {
'use strict';
/*
* Hotel
* GNU Public License
* Alexandre Díaz <dev@redneboa.es>
*/
var ListController = require('web.ListController');
var Core = require('web.core');
var _t = Core._t;
ListController.include({
renderButtons: function () {
this._super.apply(this, arguments); // Sets this.$buttons
var self = this;
if (this.modelName === 'hotel.reservation') {
this.$buttons.append("<button class='btn btn-sm oe_open_reservation_wizard oe_highlight' type='button'>"+_t('Open Wizard')+"</button>");
this.$buttons.find('.oe_open_reservation_wizard').on('click', function(){
self.do_action('hotel.open_wizard_reservations');
});
}
}
});
});