'create or modify a table from the point of sale UI.
table contains the table\'s fields. If it contains an
id, it will modify the existing table. It then
returns the id of the table.'

@api.model
def create_from_ui(self, table):

    if table.get('floor_id'):
        table['floor_id'] = table['floor_id'][0]
    table_id = table.pop('id', False)
    if table_id:
        self.browse(table_id).write(table)
    else:
        table_id = self.create(table).id
    return table_id
