Thanks for the response Shivoham,
I have tried many for loops but they seem not work.
The below code is what I was trying to do.
def compute_cheapest(self):
for rec in self:
partner = rec.env['purchase.order'].search([('partner_id', '=', rec.partner_id.id)])
for each_partner in partner:
line = each_partner.order_line
for item in line:
if item.product_id._________________:
item.write({'quality': True})
else:
item.write({'quality': False})
The place where I have put the dash is where I am stuck. How can I search in every vendor's oder_line and find similar products quoted by them. The cheapest price for that product I do the last code which I have written:
NB: I have set field quality to Boolean that's why in the end I am writting "True" or "False"
....
item.write({'quality': True})
else: item.write({'quality': False})
Or is there a better way to do it