[REF] account_reconcile_payment_order: Adapt module to native payment refactoring

Following OCA/bank-payment#979
This commit is contained in:
Pedro M. Baeza
2022-11-08 13:36:46 +01:00
parent cd3e728bf6
commit d38da251eb

View File

@@ -23,14 +23,15 @@ class AccountReconciliationWidget(models.AbstractModel):
def _get_reconcile_lines_from_order(self, st_line, order, excluded_ids=None): def _get_reconcile_lines_from_order(self, st_line, order, excluded_ids=None):
"""Return lines to reconcile our statement line with.""" """Return lines to reconcile our statement line with."""
aml_obj = self.env["account.move.line"] aml_obj = self.env["account.move.line"]
reconciled_lines = aml_obj.search( lines = aml_obj
[("bank_payment_line_id", "in", order.bank_line_ids.ids)] for payment in order.payment_ids:
lines |= payment.move_id.line_ids.filtered(
lambda x: x.account_id != payment.destination_account_id
and x.partner_id == payment.partner_id
)
return (lines - aml_obj.browse(excluded_ids)).filtered(
lambda x: not x.reconciled
) )
return (
reconciled_lines.mapped("move_id.line_ids")
- reconciled_lines
- aml_obj.browse(excluded_ids)
).filtered(lambda x: not x.reconciled)
def _prepare_proposition_from_orders(self, st_line, orders, excluded_ids=None): def _prepare_proposition_from_orders(self, st_line, orders, excluded_ids=None):
"""Fill with the expected format the reconciliation proposition """Fill with the expected format the reconciliation proposition