Commit Graph

324 Commits

Author SHA1 Message Date
Denis Ledoux dd47b6f5bc [FIX] account: Exchanges rates gain/loss during reconciliations
When processing the reconciliation of a bank statement
within the company currency with an invoice in a foreign currency,
avoid to recompute the bank statement debit / credit within
the currency rate at the time of the invoice when the
`amount_currency` of the bank statement line and the `amount_currency`
of the invoice move line are the same
(while having the invoice move line and the
bank statement move line in the same currency,
and having the bank statement currency and
the company currency the same),
to prevent gain/loss exchanges during currencies conversion.

Computing the amount of the statement line
within the currency of the invoice is useful
to compute the difference of amount paid within the company currency
when a change of currency rates occured between the invoice date
and the date of the payment.

Nevertheless, recomputing the amount in the currency of the company
is useless when the payment currency
and the company currency are the same,
and the amount of the invoice and the statement in the foreign currency
are identical, since the amount is already computed, within the
debit/credit field of the invoice move line.

Besides, this prevents gain/loss changes.
opw-631748
opw-632133
opw-631895
closes #6559
2015-05-06 18:29:47 +02:00
Arthur Maniet ce32867a90 [FIX] account: bank statement reconciliation:
- ctrl-enter only persist balanced reconciliations
- give a reconciliation proposition only if there's an unambiguous match
- added some missing tanslations
- use default order to display statement lines in reconciliation widget
2015-05-05 09:55:36 +02:00
Arthur Maniet 25429656c7 [FIX] account: rounding error when the balanced operation done in bank statement reconciliation is converted to the company currency. 2015-02-23 15:08:49 +01:00
Arthur Maniet 69b6cf44bd [FIX] account: in bank statement reconciliation, show the invoice line from a partial reconciliation.
Since all the lines in a partial reconciliation share the same state and the same amount_residual, we need to keep only one 'result' line.
It was the first line found that was kept ; now it's the line whose amount is greater than amount_residual, whiwh most likely is the significant one.

Fixes #5129
2015-02-17 11:07:14 +01:00
Arthur Maniet d1be21dfdf [IMP] account: feature that links bank accounts to partners upon bank statement closing.
Retreive additional informations to write on the res.partner.bank by using the onchange_partner_id, instead of only writing the partner_id
2015-02-16 11:55:45 +01:00
Denis Ledoux e07309d809 [FIX] account: bank statement line needaction domain
Before 8.0, the field journal_entry_id did not exist.

For database coming from older release, like 7.0, this field is not filled in during the migration, because this is not possible.
Set the needaction to depend only on the journal_entry_id will have as effect to have every bank statement line entered when the database was under 7.0 to match the domain, while the needaction is made to display the number of records that need an action.

Besides, even in 8.0, this is possible that a line has not the journal_entry_id set, while not needing any actions (see 2bb38ca89d)
2015-01-15 16:53:59 +01:00
Denis Ledoux 2bb38ca89d [FIX] account: closing of bank statement without reconciliation
For bank statement line having an account_id, but no journal_entry_id, it is not possible to reconcile the line in the bank statement reconciliation tool, as a filter is applied to only reconcile lines having journal_entry_id AND account_id not set.

As written in the help message of the account_id field:
This technical field can be used at the statement line creation/import time in order to avoid the reconciliation process on it later on. The statement line will simply create a counterpart on this account

Not allowing the reconciling should not prevent to close the statement in such a case. The button "close" was displayed only when all lines had journal_entry_id set.
2015-01-15 16:45:47 +01:00
Akash Balar d4027e6182 [IMP] account: account.statement.operation.template model
- better many2one ondelete strategies
- domain set on fields, not views
- added domain on analytic_account_id field
2014-11-28 08:42:01 +01:00
Arthur Maniet d7a46b4d84 [FIX] account: floating point comparisons in get_reconciliation_proposition 2014-11-28 05:20:09 +01:00
Arthur Maniet a6de1b150c [IMP] account: bank statement reconciliation widget: allow to filter move lines on due date 2014-11-26 11:38:32 +01:00
Arthur Maniet a8ae0ffbb4 [IMP] account: bank statement reconciliation proposition:
- find a move line whose amount exactly matches the bank statement line amount even if it has no partner
- properly handle multicurrency
- if there's no exact match, look for a set of move line whose amount is <= to the statement line's amount
2014-11-25 16:48:32 +01:00
Stéphane Bidoul 24ec228acc [FIX] avoid leaving dangling account moves when deleting a bank statement
Fixes #3292
2014-10-27 10:58:11 +01:00
Guewen Baconnier 3af6bed743 [REF] Extract the domain generation for get_move_lines_for_reconciliation and get_reconciliation_proposition in new methods
This way, the query method can be used with a custom domain. Such a domain
could match on a 'transaction_ref' field as well as on 'ref' and 'name'.

Example of implementation:

    class account_bank_statement_line(orm.Model):
        _inherit = 'account.bank.statement.line'

        def _domain_reconciliation_proposition(self, cr, uid, st_line,
                                               excluded_ids=None, context=None):
            _super = super(account_bank_statement_line, self)
            _get_domain = _super._domain_reconciliation_proposition
            domain = _get_domain(cr, uid, st_line, excluded_ids=excluded_ids,
                                 context=context)
            new_domain = []
            for criterium in domain:
                if len(criterium) == 3:
                    field, op, value = criterium
                    if (field, op) == ('ref', '='):
                        new_domain += [
                            '|',
                            ('transaction_ref', '=', value),
                        ]
                new_domain.append(criterium)
            return new_domain

        def _domain_move_lines_for_reconciliation(self, cr, uid, st_line,
                                                  excluded_ids=None, str=False,
                                                  additional_domain=None,
                                                  context=None):
            _super = super(account_bank_statement_line, self)
            _domain_meth = _super._domain_move_lines_for_reconciliation
            domain = _domain_meth(cr, uid, st_line, excluded_ids=excluded_ids,
                                  str=str, additional_domain=additional_domain,
                                  context=context)
            if not str and str != '/':
                return domain
            domain = domain[:]
            domain.insert(-1, '|')
            domain.append(('transaction_ref', 'ilike', str))
            return domain
2014-10-16 14:12:06 +02:00
Christophe Simonis 2e3f59181d [MERGE] forward port of branch saas-3 up to db75994 2014-10-14 15:13:14 +02:00
Denis Ledoux b13898c058 [MERGE] forward port of branch 7.0 up to 03df412f 2014-10-07 17:34:42 +02:00
Ferdinand Gassauer bc69e1812a [FIX] account: self typo 2014-10-06 17:10:50 +02:00
Arthur Maniet 0a524e9e53 [FIX] account: bank statement reconciliation: when creating a new move line to reconcile an existing one, use the existing move line's partner or, if there's none, the statement line's partner 2014-09-17 17:12:50 +02:00
Arthur Maniet 8574f61ab7 [IMP] account: bank statement reconciliation: allow to filter on move line name 2014-09-17 15:02:02 +02:00
Stéphane Bidoul ae742db21d [IMP] broaden scope of search of bank statement reconciliation candidates
Looking for accounts with reconcile=True is enough.
Restricting on payable/receivable account types narrows the search
to much and makes it difficult to implement transfer account holding
the payment while they are in transit at the bank.
2014-09-17 14:24:24 +02:00
qdp-odoo c21f26ac35 [FIX] account, bank reconciliation widget: fixed the method that manage the pager in case of partial reconciliations 2014-09-17 14:18:52 +02:00
Arthur Maniet 0a7fd6a943 [FIX] account: bank statement reconciliation: when fetching moves lines for reconciliation, if lines from the same partial reconciliation are filtered out, keep fetching to returne the correct number of lines 2014-09-17 13:49:39 +02:00
Arthur Maniet de58cf4950 [FIX] account: bank statement reconciliation widget: when filtering move lines by string, for a statement line with no partner, do a or on varchar fields, not a and 2014-09-17 13:00:21 +02:00
qdp-odoo 3e47eca083 [REF] account: minor change made during code review 2014-09-17 11:18:16 +02:00
Arthur Maniet 197ce282bd [IMP] account: bank statement reconciliation widget: ctrl-enter makes only 1 RPC call 2014-09-16 17:15:54 +02:00
Arthur Maniet c6ca31dd9f [IMP] account: bank statement reconciliation: correctly find reconciliation proposition based on amount match 2014-09-16 17:03:04 +02:00
Arthur Maniet 8f46da455e [IMP] account: bank statement reconciliation: for a partially reconciled move line, display total and residual amount 2014-09-16 12:23:13 +02:00
Arthur Maniet 75b37a7f42 [IMP] account: bank statement reconciliation widget: display partner name found in statement import in change partner field ; do not set the partner to false before changing the partner 2014-09-16 11:01:06 +02:00
qdp-odoo f4e350ca36 [FIX] account: several fixes on the new bank statement reconciliation widget 2014-09-04 11:32:16 +02:00
qdp-odoo 98801be77f [FIX] account, bank statement reconciliation: fixed use cases involving transactions made in a different currency than the company AND the statement ones 2014-09-02 11:37:57 +02:00
qdp-odoo 2a1f447d06 [FIX] account, bank statement reconciliation: payment and invoice in foreign currency use case fixed 2014-09-02 10:42:28 +02:00
qdp-odoo cbc52f80eb [FIX] account: fixes of bank statement reconciliation widget. Add of a partner_name field to hold the name of the counterparty in case it is not detected instead of merging it to the communication. Structured communication goes in the same communication field, while reference field holds the reference of the transaction (for whatever that means)" 2014-08-29 19:13:41 +02:00
qdp-odoo 6244ec55c9 [FIX] account: several fixes in bank statement reconciliation related to multi-currencies use cases where the statement is a foreign currency but receive a payment in the company currency 2014-08-28 11:09:48 +02:00
Martin Trigaux 30469bd69b [FIX] account: name of bank statement is not required
At the confirmation of a bank statement, the name may not be set (e.g. generated by point of sale). This field is not requred so make a fallack on the statement line (which is required).
2014-08-26 16:33:58 +02:00
Fabien Pinckaers 9c175fe730 [FIX] difference POS / Cash 2014-08-21 10:54:38 +02:00
Daniel Dico 42f3575bb3 [FIX] account: Bank Statement reconcilation with different currency
When generating reconciled moves in bank statement, use the amount_currency field instead of amount for currency conversion.
Otherwise we would endup with moves with an amount of 0.
2014-07-23 11:19:41 +02:00
qdp-odoo e9c92b57b9 [FIX] account: fixed the copy of a bank statement 2014-07-23 10:15:29 +02:00
qdp-odoo 5ae60d8a2d [FIX] point_of_sale: fixed errors that avoid closing a pos session + [IMP] account: added back the account_id field on statement.line obj to ease the reconciliation process when importing statements (or creating them through pos.orders). Fix #932 2014-07-18 15:43:20 +02:00
qdp-odoo f61339b82c [FIX] account, bank statement reconciliation: fixed huge bugs when using tax with several children or when debit/credit are 0 but some amounts have to be put in a tax code + improved usability by adding domains where needed 2014-07-11 17:15:34 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
qdp-odoo 9a4784fcbe [IMP] account, account_cancel: added the possibility to cancel a single statement line when it has already been through the reconciliation process 2014-07-04 11:07:23 +02:00
Niels Huylebroeck e15bd7eec1 Fixing a problem where the exact match returns a single item.
The function get_data_for_reconciliations expects a list at line 473 to loop over.
Without this fix you get TypeError: string indices must be integers, not str
2014-06-30 18:50:37 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
Cedric Snauwaert 10568ffd3b [FIX] account: structured communication have a higher priority 2014-06-23 11:39:43 +02:00
Cedric Snauwaert 7e4443547e [WIP]remove some unneeded argument in computing reconciliation line 2014-06-23 11:33:48 +02:00
qdp-odoo bc05fe262c [FIX] account: fixed the proposal of reconciliation in the bank statement for negative amounts 2014-06-20 10:01:35 +02:00
qdp-odoo 59b47119c8 [FIX] account: bank statement creation do not confuse anymore with default name 2014-06-20 10:01:23 +02:00
Cedric Snauwaert f133f397b9 [FIX]account reconciliation: filter take partner name into account if no partner defined 2014-06-20 10:01:11 +02:00
qdp-odoo f1d9683147 [IMP] account, bank statement reconciliation: bugfixes related to the use case of clearing accounts where the type is 'other' but can be reconciled (amount_residual can now be used on these accounts) 2014-06-20 10:00:41 +02:00
qdp-odoo b32e3a3f8a [FIX] account: allow to cancel a bank statement if the option is set on the bank journal 2014-06-20 09:59:09 +02:00
qdp-odoo 5e7e7cef41 [IMP] account: learn the res.partner.bank of partners in reconciliation process on bank statement + adapted l10n_be 2014-06-20 09:58:42 +02:00