'Prepare the dict of values to create the new invoice line for a sales order line.
:param qty: float quantity to invoice'

@api.multi
def _prepare_invoice_line(self, qty):

    self.ensure_one()
    res = {}
    account = (self.product_id.property_account_income_id or self.product_id.categ_id.property_account_income_categ_id)
    if (not account):
        raise UserError((_('Please    define    income    account    for    this    product:    "%s"    (id:%d)    -    or    for    its    category:    "%s".') % (self.product_id.name, self.product_id.id, self.product_id.categ_id.name)))
    fpos = (self.order_id.fiscal_position_id or self.order_id.partner_id.property_account_position_id)
    if fpos:
        account = fpos.map_account(account)
    res = {'name': self.name, 'sequence': self.sequence, 'origin': self.order_id.name, 'account_id': account.id, 'price_unit': self.price_unit, 'quantity': qty, 'discount': self.discount, 'uom_id': self.product_uom.id, 'product_id': (self.product_id.id or False), 'layout_category_id': ((self.layout_category_id and self.layout_category_id.id) or False), 'invoice_line_tax_ids': [(6, 0, self.tax_id.ids)], 'account_analytic_id': self.order_id.project_id.id, 'analytic_tag_ids': [(6, 0, self.analytic_tag_ids.ids)]}
    return res
