[IMP] point_of_sale: allow clearing a set fiscal position

This was not really possible before. This prepends a dummy undefined
fiscal position to the selection list that'll clear the current fiscal
position when selected.

Also considered was using the "Cancel" button of the selection widget to
clear the fiscal position, but that doesn't make a lot of sense from a
UI point of view. Pressing a "Cancel" button shouldn't change anything
in the underlying model, it should just get rid of the dialog window.

opw-668155
This commit is contained in:
Joren Van Onder
2016-02-18 15:48:16 +01:00
parent d9891a5bbe
commit d5dfeb9dac
@@ -1937,12 +1937,18 @@ var set_fiscal_position_button = ActionButtonWidget.extend({
},
button_click: function () {
var self = this;
var selection_list = _.map(self.pos.fiscal_positions, function (fiscal_position) {
var no_fiscal_position = [{
label: _t("None"),
}];
var fiscal_positions = _.map(self.pos.fiscal_positions, function (fiscal_position) {
return {
label: fiscal_position.name,
item: fiscal_position
};
});
var selection_list = no_fiscal_position.concat(fiscal_positions);
self.gui.show_popup('selection',{
title: _t('Select tax'),
list: selection_list,