Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- orders = env['sale.order']
- sale_orders = env['sale.order'].search([('state', '=', 'done'), ('invoice_status', '=', 'invoiced'), ('create_date', '>=', '05/01/2019 00:00:00')])
- for so in sale_orders:
- lines = so.order_line.filtered(lambda l: l.product_uom_qty != l.qty_invoiced and l.invoice_status == 'invoiced')
- if lines:
- orders += so
- orders.action_unlock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement