Fix the use of rowcount because it can return -1 or None according to PEP249
This commit is contained in:
@@ -1706,7 +1706,7 @@ class Invoice(ModelSQL, ModelView):
|
||||
cursor.execute('SELECT id FROM sale_invoices_rel ' \
|
||||
'WHERE invoice IN (' + ','.join(['%s' for x in ids]) + ')',
|
||||
ids)
|
||||
if cursor.rowcount:
|
||||
if cursor.fetchone():
|
||||
self.raise_user_error(cursor, 'delete_sale_invoice',
|
||||
context=context)
|
||||
return super(Invoice, self).delete(cursor, user, ids,
|
||||
|
||||
Reference in New Issue
Block a user