Created
September 12, 2012 07:35
-
-
Save ecarreras/3704978 to your computer and use it in GitHub Desktop.
Eliminem duplicats quan s'ha apretat més d'una vegada el botó
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fids = O.AccountInvoice.search([('date_invoice', '=', '2012-08-31'])) | |
delete = [] | |
done = [] | |
for factura in O.AccountInvoice.read(fids, ['name']): | |
if factura['name'] in done: | |
delete.append(factura['id']) | |
else: | |
done.append(factura['name']) | |
O.AccountInvoice.unlink(delete) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment