Compare commits

..

2 Commits

Author SHA1 Message Date
Raphaël Valyi
676011f868 reconciliation domain has no payment_id in OCB 2020-08-06 01:34:05 -03:00
clementmbr
44b19dfe60 Merge pull request #124 from akretion/12.0-imp-button-prod-to-bom
[IMP] mrp_usability: improve smart button from products to BoMs
2020-08-05 16:04:24 -03:00

View File

@@ -696,6 +696,15 @@ class AccountReconciliation(models.AbstractModel):
# We want to replace a domain item by another one
position = domain.index(('payment_id', '<>', False))
domain[position] = ['journal_id', '=', st_line.journal_id.id]
if ('payment_id', '<>', False) in domain:
# True on official v12:
# https://github.com/odoo/odoo/blob/12.0/addons/account/models/reconciliation_widget.py#L490
position = domain.index(('payment_id', '<>', False))
domain[position] = ['journal_id', '=', st_line.journal_id.id]
else:
# OCB which has backport fixes from v13
# https://github.com/OCA/OCB/blob/12.0/addons/account/models/reconciliation_widget.py#L486
domain = expression.AND([domain, [('journal_id', '=', st_line.journal_id.id)]])
return domain