mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] account_reconcile_oca: Add auto-reconcile compatibility (Example: Rule to match invoices/bills)
TT52146
[FIX] account_reconcile_oca: Fix test related to match_text_location fields
Related to 8948b31407
TT52146
This commit is contained in:
@@ -532,7 +532,14 @@ class AccountBankStatementLine(models.Model):
|
||||
res = (
|
||||
self.env["account.reconcile.model"]
|
||||
.search(
|
||||
[("rule_type", "in", ["invoice_matching", "writeoff_suggestion"])]
|
||||
[
|
||||
(
|
||||
"rule_type",
|
||||
"in",
|
||||
["invoice_matching", "writeoff_suggestion"],
|
||||
),
|
||||
("company_id", "=", self.company_id.id),
|
||||
]
|
||||
)
|
||||
._apply_rules(self, self._retrieve_partner())
|
||||
)
|
||||
@@ -555,6 +562,8 @@ class AccountBankStatementLine(models.Model):
|
||||
)
|
||||
amount -= sum(line.get("amount") for line in line_data)
|
||||
data += line_data
|
||||
if res.get("auto_reconcile"):
|
||||
self.reconcile_bank_line()
|
||||
return self._recompute_suspense_line(
|
||||
data,
|
||||
reconcile_auxiliary_id,
|
||||
@@ -745,6 +754,7 @@ class AccountBankStatementLine(models.Model):
|
||||
models = self.env["account.reconcile.model"].search(
|
||||
[
|
||||
("rule_type", "in", ["invoice_matching", "writeoff_suggestion"]),
|
||||
("company_id", "in", result.company_id.ids),
|
||||
("auto_reconcile", "=", True),
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user