This question has been flagged
1 Reply
2407 Views

saleorderids_notcontains_orderline = saleorder_obj.search(cr,uid,[('order_line','is',None)])

I have written above query to get sales orders which does not contain Order lines in openerp.

It is giving thi error. " ValueError: Invalid leaf ('order_line', 'is', None) ". Pleae can any one solve this error? (OR ) suggest me a way how can i get sales order id's which doesnot contain sale order lines.

The definition of the column in sales order table. 'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),

Avatar
Discard
Thank you Ajay,

I am facing some more problem. Sales delivery automation. Can you please look into this problem http://119.235.51.66:8069/?db=KelltonTechSolutions_test&ts=1413806813699#action=97

On Mon, Oct 20, 2014 at 2:40 PM, Ajay <ajay.chauhan727@mail.odoo.com> wrote:

A new answer for How can i get sales orders which does not contain Order lines in openerp? has been posted. Click here to access the post.

--
Ajay
Sent by Odoo Inc. using Odoo about Forum Post How can i get sales orders which does not contain Order lines in openerp?

Best Answer

Hello Samba,

Try as saleorderids_notcontains_orderline = saleorder_obj.search(cr,uid,[('order_line','=',False)])

This will work.

Avatar
Discard

Please add correct spacing, we can't read your answer.

Domain needed is : [ ( 'order_line', '=', False) ] . Hope it is visible now.