diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3e97bd80372..d29baca6cd5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4049,8 +4049,9 @@ class Commande extends CommonOrder $this->status = $this::STATUS_DRAFT; // Lines - $nbp = 5; + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) $xnbp = 0; + while ($xnbp < $nbp) { $line = new OrderLine($this->db);