[FIX] account_reconcile_model_oca: fix partner category reconciliation when partner has multiple categories
* Create a reconciliation model that matches partners that have a
category `C`
* Create a bank statement and a partner that has *multiple* categories,
including C.
* Validate and reconcile
The reconciliation model you created should be used, but it is not.
Related to a0016fc6c9
pull/819/head
parent
8de3e4485d
commit
02ccd70dc0
|
@ -258,7 +258,7 @@ class AccountReconcileModel(models.Model):
|
||||||
or (
|
or (
|
||||||
self.match_partner
|
self.match_partner
|
||||||
and self.match_partner_category_ids
|
and self.match_partner_category_ids
|
||||||
and partner.category_id not in self.match_partner_category_ids
|
and not (partner.category_id & self.match_partner_category_ids)
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -773,7 +773,10 @@ class TestReconciliationMatchingRules(AccountTestInvoicingCommon):
|
||||||
test_category = self.env["res.partner.category"].create(
|
test_category = self.env["res.partner.category"].create(
|
||||||
{"name": "Consulting Services"}
|
{"name": "Consulting Services"}
|
||||||
)
|
)
|
||||||
self.partner_2.category_id = test_category
|
test_category2 = self.env["res.partner.category"].create(
|
||||||
|
{"name": "Consulting Services2"}
|
||||||
|
)
|
||||||
|
self.partner_2.category_id = test_category + test_category2
|
||||||
self.rule_1.match_partner_category_ids |= test_category
|
self.rule_1.match_partner_category_ids |= test_category
|
||||||
self._check_statement_matching(
|
self._check_statement_matching(
|
||||||
self.rule_1,
|
self.rule_1,
|
||||||
|
|
Loading…
Reference in New Issue