Skip to content

Instantly share code, notes, and snippets.

@name1984
Created September 20, 2024 15:54
Show Gist options
  • Save name1984/33c101301b18a22d20d8de540f53763a to your computer and use it in GitHub Desktop.
Save name1984/33c101301b18a22d20d8de540f53763a to your computer and use it in GitHub Desktop.
Búsqueda de Descuentos por Linea de Orden de Compra
po = env['purchase.order'].search([('state','in', ['purchase','done'])])
f = open("/tmp/myfile.txt", "w")
for line in po:
if line.order_line.filtered(lambda x: x.discount > 0):
f.write(line.name+' '+str(line.create_date)+'\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment