mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[WIP] refactoring res.config.settings' for hotel calendar
This commit is contained in:
@@ -52,14 +52,13 @@ var CalendarMenu = Widget.extend({
|
||||
this._rpc({
|
||||
model: 'res.users',
|
||||
method: 'read',
|
||||
args: [[Session.uid], ["pms_show_notifications", "pms_show_pricelist", "pms_show_availability", "pms_divide_rooms_by_capacity"]],
|
||||
args: [[Session.uid], ["pms_show_notifications", "pms_show_pricelist", "pms_show_availability"]],
|
||||
context: Session.user_context,
|
||||
})
|
||||
).then(function(result) {
|
||||
this._show_notifications = result[0]['pms_show_notifications'];
|
||||
this._show_pricelist = result[0]['pms_show_pricelist'];
|
||||
this._show_availability = result[0]['pms_show_availability'];
|
||||
this._show_divide_rooms_by_capacity = result[0]['pms_divide_rooms_by_capacity'];
|
||||
return this.update();
|
||||
}.bind(this));
|
||||
},
|
||||
@@ -127,18 +126,6 @@ var CalendarMenu = Widget.extend({
|
||||
window.location.reload();
|
||||
});
|
||||
},
|
||||
|
||||
toggle_show_divide_rooms_by_capacity: function() {
|
||||
this._show_divide_rooms_by_capacity = !this._show_divide_rooms_by_capacity;
|
||||
this._rpc({
|
||||
model: 'res.users',
|
||||
method: 'write',
|
||||
args: [[Session.uid], {pms_divide_rooms_by_capacity: this._show_divide_rooms_by_capacity}],
|
||||
context: Session.user_context,
|
||||
}).then(function () {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var PMSCalendarView = AbstractView.extend({
|
||||
|
||||
@@ -21,12 +21,12 @@ return AbstractModel.extend({
|
||||
},
|
||||
|
||||
save_changes: function (params) {
|
||||
params.splice(0, 0, false); // FIXME: ID=False because first parameter its an integer
|
||||
// params.splice(0, 0, false); // FIXME: ID=False because first parameter its an integer
|
||||
return this._rpc({
|
||||
model: this.modelName,
|
||||
method: 'save_changes',
|
||||
args: params,
|
||||
//context: Session.user_context,
|
||||
context: Session.user_context,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -373,7 +373,6 @@
|
||||
<li><a href="#" data-action="toggle_show_notification"><span t-if="manager._show_notifications" class="fa fa-check"/> Show Notifications</a></li>
|
||||
<li><a href="#" data-action="toggle_show_pricelist"><span t-if="manager._show_pricelist" class="fa fa-check"/> Show Pricelist</a></li>
|
||||
<li><a href="#" data-action="toggle_show_availability"><span t-if="manager._show_availability" class="fa fa-check"/> Show Availability</a></li>
|
||||
<li><a href="#" data-action="toggle_show_divide_rooms_by_capacity"><span t-if="manager._show_divide_rooms_by_capacity" class="fa fa-check"/> Divide Rooms by Capacity</a></li>
|
||||
</t>
|
||||
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user