Configuration:
- Company Currency: MXN
- Tax 16%.
- Multicurrency, MXN and USD.
- Decimal precision: 4
- Currency Data:
MXN: rate 1.0
USD rates

| Database time | rate | Local time (Mexico) | 
| --- | --- | --- |
| 2016-09-09 00:00:01 | 0.054440 | 2016-09-08 17:00:01 |
| 2016-10-11 00:00:01 | 0.051815 | 2016-10-10 17:00:01 |

Steps to reproduce:

1. Create an invoice for 600 USD  + tax (16%) with date 09/09/16 (September 9, 2016) and when you validate in the journal entry is $12,784.7172 MXN.
3. Create a bank statement in MXN and add a line with date 11/10/16 (October 11, 2016) and amount $13,372.80 MXN.
4. When reconcile select the invoice and there is a difference ($588.0828 MXN) add a line with the difference and select an account for the difference. 
<img width="607" alt="captura de pantalla 2016-11-04 a la s 17 23 26" src="https://cloud.githubusercontent.com/assets/6758279/20025385/749605a2-a2b3-11e6-8b1a-4e9fbf1521ed.png">

**Note that the amount of difference is $588.08 in when you select the account**

5. Click on reconcile.

Expected behavior:
- Reconcile the invoice and create account move.

Current behavior:
- Raise an error  `Wrong credit or debit value in accounting entry !`

![captura de pantalla 2016-11-01 a la s 19 18 52](https://cloud.githubusercontent.com/assets/6758279/19913537/1c272866-a069-11e6-9b06-5851681c7fa5.png)

addons/account/models/account_move.py
""" change index on partner_id to a multi-column index on (partner_id, ref), the new index will behave in the
            same way when we search on partner_id, with the addition of being optimal when having a query that will
            search on partner_id and ref at the same time (which is the case when we open the bank reconciliation widget)
        """
        cr.execute('DROP INDEX IF EXISTS account_move_line_partner_id_index')
        cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_partner_id_ref_idx',))
        if not cr.fetchone():
            cr.execute('CREATE INDEX account_move_line_partner_id_ref_idx ON account_move_line (partner_id, ref)')
    @api.depends('debit', 'credit', 'amount_currency', 'currency_id', 'matched_debit_ids', 'matched_credit_ids', 'matched_debit_ids.amount', 'matched_credit_ids.amount', 'account_id.currency_id', 'move_id.state')
    def _amount_residual(self):
        """ Computes the residual amount of a move line from a reconciliable account in the company currency and the line's currency.
            This amount will be 0 for fully reconciled lines or lines from a non-reconciliable account, the original line amount
            for unreconciled lines, and something in-between for partially reconciled lines.
        """
        for line in self:
            if not line.account_id.reconcile:
                line.reconciled = False
                line.amount_residual = 0
                line.amount_residual_currency = 0
                continue
            
            amount = abs(line.debit - line.credit)
            amount_residual_currency = abs(line.amount_currency) or 0.0
            sign = 1 if (line.debit - line.credit) > 0 else -1
            if not line.debit and not line.credit and line.amount_currency and line.currency_id:
                
                sign = 1 if float_compare(line.amount_currency, 0, precision_rounding=line.currency_id.rounding) == 1 else -1
            for partial_line in (line.matched_debit_ids + line.matched_credit_ids):