I am trying to duplicate a purchase order line, so I could split up lines that have more than 1 product_qty, to multiple lines of 1 unit.
This is how I tried to duplicate the line:
classPurchaseOrderLine(models.Model):
_inherit ='purchase.order.line'
@api.onchange('product_qty')defx_onchange_product_qty(self):
self.copy()
But that only creates an empty line bellow. How do I do this correctly?