def action_new_quotation(self):
action = super(CrmLead, self).action_new_quotation()
vals = [fields.Command.clear()]
for order in self.order_line_ids:
order.ensure_one()
vals.append(fields.Command.create({
'product_id': order.product_id.id,
'name': order.name,
'product_uom_qty': order.product_uom_qty,
'price_unit': order.price_unit,
'price_subtotal': order.price_subtotal,
}))
if action and 'context' in action:
action['context'].update({
'default_order_line': vals,
})
return action
Although values are successfully passed, the sale.order.line fails to capture the details. Interestingly, when the same values are passed to another custom One2many field in sale.order, the data is captured. Any insights or suggestions on this matter?