'Used in on_change to set taxes and price.'

def _set_taxes(self):

    if (self.invoice_id.type in ('out_invoice', 'out_refund')):
        taxes = (self.product_id.taxes_id or self.account_id.tax_ids)
    else:
        taxes = (self.product_id.supplier_taxes_id or self.account_id.tax_ids)
    company_id = (self.company_id or self.env.user.company_id)
    taxes = taxes.filtered((lambda r: (r.company_id == company_id)))
    self.invoice_line_tax_ids = fp_taxes = self.invoice_id.fiscal_position_id.map_tax(taxes, self.product_id, self.invoice_id.partner_id)
    fix_price = self.env['account.tax']._fix_tax_included_price
    if (self.invoice_id.type in ('in_invoice', 'in_refund')):
        prec = self.env['decimal.precision'].precision_get('Product    Price')
        if ((not self.price_unit) or (float_compare(self.price_unit, self.product_id.standard_price, precision_digits=prec) == 0)):
            self.price_unit = fix_price(self.product_id.standard_price, taxes, fp_taxes)
    else:
        self.price_unit = fix_price(self.product_id.lst_price, taxes, fp_taxes)
