Skip to Content
Menu
This question has been flagged
2 Replies
2830 Views

Hi, I try to filter sale orders by one of its customer empty field:


I tryied:

orders = self.env["sale.order"].filtered(lambda o: o.partner_id.customer_payment_mode_id.id == False)

orders = self.env["sale.order"].filtered(lambda o: o.partner_id.customer_payment_mode_id.id == None)

...but no effect.


Any idea how can I get it?

Thank you

Avatar
Discard
Best Answer

Hi,

Try this: 

orders = self.env['sale.order'].search([]).filtered(lambda o: not o.partner_id.customer_payment_mode_id)

 

Thanks

Avatar
Discard
Author

same reult: sale.order() ... thank you anyway

see the updated answer

Related Posts Replies Views Activity
2
Jan 24
655
2
Dec 23
12009
0
Oct 23
33
3
Oct 23
787
1
Oct 23
569