diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2019-02-28 08:57:45 +0000 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2019-02-28 08:57:45 +0000 |
| commit | 645d9dc037d856d002ad19d360ea621acba3ec19 (patch) | |
| tree | bd1cf9dd4c6516886597dd831f8dcb59ca30a506 | |
| parent | 72e7976d1ea48515a96304ff75515530e8c63723 (diff) | |
[FIX] account: reconciliation widget partner domain all reconcile accounts
Have an account move which lines have all the same partner
Have a bank statement, without a partner
Enter the reconciliation widget for the bank statement
All the lines appear
Select one of the lines of the account move for the partner
Before this commit, all other lines disappeared from the proposition
including the ones for the partner selected
This cas because when having set a partner on the widget,
only receivables and payables accounts were searched for
After this commit, all account move lines for the partner are searched for
OPW 1942936
closes odoo/odoo#31488
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
| -rw-r--r-- | addons/account/models/reconciliation_widget.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/addons/account/models/reconciliation_widget.py b/addons/account/models/reconciliation_widget.py index 36103ff196a..564ac75bda3 100644 --- a/addons/account/models/reconciliation_widget.py +++ b/addons/account/models/reconciliation_widget.py @@ -455,21 +455,12 @@ class AccountReconciliation(models.AbstractModel): ('payment_id', '<>', False) ] - # Black lines = unreconciled & (not linked to a payment or open balance created by statement - domain_matching = [('reconciled', '=', False)] - if partner_id: - domain_matching = expression.AND([ - domain_matching, - [('account_id.internal_type', 'in', ['payable', 'receivable'])] - ]) - else: - # TODO : find out what use case this permits (match a check payment, registered on a journal whose account type is other instead of liquidity) - domain_matching = expression.AND([ - domain_matching, - [('account_id.reconcile', '=', True)] - ]) + # default domain matching + domain_matching = expression.AND([ + [('reconciled', '=', False)], + [('account_id.reconcile', '=', True)] + ]) - # Let's add what applies to both domain = expression.OR([domain_reconciliation, domain_matching]) if partner_id: domain = expression.AND([domain, [('partner_id', '=', partner_id)]]) |
