[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>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user