diff options
| author | fw-bot <otis@odoo.com> | 2019-10-07 11:19:32 +0000 |
|---|---|---|
| committer | Joseph Caburnay <jcb@odoo.com> | 2019-10-07 11:47:26 +0000 |
| commit | a9adfbaa186236dc9fa10ece5338a9b505f4e2fa (patch) | |
| tree | 83dc2f1111b01035b74b7db7e021958f24ebf6ca /addons/pos_restaurant/static/src/js | |
| parent | b5bc4dd46a3fe4a574217a452df918e86ab3eda1 (diff) | |
[FIX] pos_restaurant: faulty behavior of newly created table
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/odoo#38068
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/pos_restaurant/static/src/js')
| -rw-r--r-- | addons/pos_restaurant/static/src/js/floors.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/pos_restaurant/static/src/js/floors.js b/addons/pos_restaurant/static/src/js/floors.js index b36a169312f..f7de936b526 100644 --- a/addons/pos_restaurant/static/src/js/floors.js +++ b/addons/pos_restaurant/static/src/js/floors.js @@ -217,7 +217,12 @@ var TableWidget = PosBaseWidget.extend({ self.table[field] = table[field]; } self.pos.tables_by_id[table.id] = self.table; - 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_sync_error_popup(); |
