Skip to content

Commit a832e4f

Browse files
committed
[FIX] product_assortment: partner action
Partner action to show assortments shows only the ones linked by partner_ids, but not via `partner_domain`. Using already existing `applied_assortment_ids` takes all into account.
1 parent 970fb47 commit a832e4f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

product_assortment/models/res_partner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ def action_define_product_assortment(self):
2020
xmlid = "product_assortment.actions_product_assortment_view"
2121
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
2222
action["domain"] = [
23-
("partner_ids", "in", self.ids),
24-
("is_assortment", "=", True),
23+
("id", "in", self.applied_assortment_ids.ids),
2524
]
2625
ctx = self.env.context.copy()
2726
ctx.update(

product_assortment/tests/test_product_assortment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,18 @@ def test_create_assortment_without_context(self):
7474
)
7575

7676
def test_search_assortment_with_partner(self):
77-
self.filter_obj.with_context(product_assortment=True).create(
77+
assortment = self.filter_obj.with_context(product_assortment=True).create(
7878
{
7979
"name": "Test Assortment Partner",
8080
"domain": [],
8181
"partner_ids": [(4, self.partner.id)],
8282
}
8383
)
84+
self.partner._update_partner_assortments()
8485
search_domain = self.partner.action_define_product_assortment()["domain"]
8586
self.assertEqual(
8687
search_domain,
87-
[("partner_ids", "in", [self.partner.id]), ("is_assortment", "=", True)],
88+
[("id", "in", [assortment.id])],
8889
)
8990

9091
def test_product_assortment_view(self):

0 commit comments

Comments
 (0)