Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. orders = env['sale.order']
  2. sale_orders = env['sale.order'].search([('state', '=', 'done'), ('invoice_status', '=', 'invoiced'), ('create_date', '>=', '05/01/2019 00:00:00')])
  3. for so in sale_orders:
  4. lines = so.order_line.filtered(lambda l: l.product_uom_qty != l.qty_invoiced and l.invoice_status == 'invoiced')
  5. if lines:
  6. orders += so
  7. orders.action_unlock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement