**Impacted versions:**
8.0

**Steps to reproduce:**

* The product is created with its respective configuration (it must be stokable, have a supplier and procurement by buy),  in the accouting tab the "inventory valuation" section should be "Real time".
* Proceed to create its reordering rule, it is assigned a value min = 100 and max = 160.                                                      
* Run Scheduler, Which generates a purchase order to supply the product created.                                                              
* The Reordering Rule is modified so that min = 120 and max = 170.                                                                            
* Run Scheduler, Which doubles the procurement for the product in question.                                                                   
* We locate the generated purchase order and change quantity = 170 to quantity = 160 in the product line, then it is confirmed and change Invoicing control to "Based on Incoming shipments". Update the Total.                                                                                             
* Confirm Order. Approve Order. "Go to Shipments". If we review the related picking we will see that for product line duplicate the input creating a second with quantity = 0 value.                                                                                                                        
* Transfer. Apply. Create Invoice. At this point we appreciate the invoice with a duplicate product line and with quantity value equal to zero.
* Validate. (traceback error)

**Current behaivor:**                                                                                                                                         
                                                                                                                                                              
Currently the process described above generates a duplicate product line and with quantity equal to zero for the picking and that is transferred to the invoice when we do the latter from the picking. As shown in the following video in an example from runbot.odoo.com  [ Here.](https://youtu.be/CziZuFZvGHo)                                                
                                                                                                                                                              
catch traceback error:
![traceback](https://cloud.githubusercontent.com/assets/11073475/25353055/090eb32c-28fc-11e7-975c-d35afe179bf8.png)


**Expected behaivor:**                                                                                                                                        
                                                                                                                                                              
Do not generate duplicate product line with quantity zero and thus avoid being transferred to the invoice generating a traceback error at the time of validating the invoice as shown:

Video/Screenshot link (optional):

https://youtu.be/CziZuFZvGHo


"""Create the purchase order from the procurement, using
           the provided field values, after adding the given purchase
           order line in the purchase order.
           :params procurement: the procurement object generating the purchase order
           :params dict po_vals: field values for the new purchase order (the
                                 ``order_line`` field will be overwritten with one
                                 single line, as passed in ``line_vals``).
           :params dict line_vals: field values of the single purchase order line that
                                   the purchase order will contain.
           :return: id of the newly created purchase order
           :rtype: int
        """
        po_vals.update({'order_line': [(0,0,line_vals)]})
        return self.pool.get('purchase.order').create(cr, uid, po_vals, context=context)
    def _get_purchase_schedule_date(self, cr, uid, procurement, company, context=None):
        """Return the datetime value to use as Schedule Date (``date_planned``) for the
           Purchase Order Lines created to satisfy the given procurement.
           :param browse_record procurement: the procurement for which a PO will be created.
           :param browse_report company: the company to which the new PO will belong to.
           :rtype: datetime
           :return: the desired Schedule Date for the PO lines
        """
        procurement_date_planned = datetime.strptime(procurement.date_planned, DEFAULT_SERVER_DATETIME_FORMAT)
        schedule_date = (procurement_date_planned - relativedelta(days=company.po_lead))
        return schedule_date
    def _get_purchase_order_date(self, cr, uid, procurement, company, schedule_date, context=None):