Created
September 20, 2024 15:54
-
-
Save name1984/33c101301b18a22d20d8de540f53763a to your computer and use it in GitHub Desktop.
Búsqueda de Descuentos por Linea de Orden de Compra
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
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