Invoice and shipment getting posted with blank lines

When I am posting Retail sales orders using Sales Post Codeunit, in a few cases the Retail posted sales invoices and Retail posted sales shipments are getting formed without any line items. This is not happening for every order but only for a few. Please let me know why this is happening. Thanks in advance.

I thin you use customized LS-solution. How many changed do you have for this area? + you may receive empty (posted Doc without lines) posted sales shipment and invoice when users are trying to delete record from sales header (without or during poting)