I have a function create stock picking named : action_picking_create()
My code :
if len(self.line_ids) == 0:
raise exceptions.Warning(_('No line'))
for line in self.line_ids :
if line.quantity > 0
self.action_picking_create()
else :
raise exceptions.Warning(_('Quantity must be > 0'))
I want to test if I have the same product I want to raise an exception.
I try with
for todo_line in self.line_id
for line in self.line_ids :
if todo_line.product_id.id != line.product_id.id
if line.quantity > 0
self.action_picking_create()
else :
raise exceptions.Warning(
_('Quantity must be > 0'))
else :
raise exceptions.Warning(
_('Product Exist'))
How to check it if exist the same product in the line_ids?