Skip to content

Commit

Permalink
[FIX] pos_restaurant: faulty behavior of newly created table
Browse files Browse the repository at this point in the history
When a table is created, the new table appears to be selected but the
capability to resize and drag is not active. As a result, when this new
table is dragged, it is unselected instead. This is because of the call
of `save_changes`. The table widget is rendered but the event handlers
for resizing and dragging are not assigned. After this commit, the
created table can be resized and dragged immediately after creation.

closes odoo#37571

Signed-off-by: Nicolas Martinelli (nim) <[email protected]>
  • Loading branch information
caburj committed Oct 7, 2019
1 parent 0b78e02 commit bbc9ab9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addons/pos_restaurant/static/src/js/floors.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ var TableWidget = PosBaseWidget.extend({
for (var field in table) {
self.table[field] = table[field];
}
self.renderElement();
// If selected, render with drag and resize event handlers.
if (!self.selected) {
self.renderElement();
} else {
self.select();
}
});
}, function(type,err) {
self.gui.show_popup('error',{
Expand Down

0 comments on commit bbc9ab9

Please sign in to comment.