Hello,
We have created a material requisition model from which we can choose if the RFQ needs to be created. If the products are to be requested from the same vendor, the current code creates individual RFQ for every line item (product). But we need to loop it in the same RFQ with multiple products to the single vendor. My current code is
for partner_id in rec.partner_ids:
self.env['purchase.order'].create({
'partner_id': partner_id.id,
'requisition_order': self.name,
'project_requisition_name_id': self.project_requisition_name_id.id,
'job_number': self.job_num,
"order_line": [(0, 0, {
'product_id': rec.product_id.id,
'product_qty': rec.quantity,
'name': rec.description,
})]})
Could you please advise/guide how to make sure a single RFQ is created for multiple line items (products) having the same vendor