Skip to content

Commit e6159d4

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 e6159d4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_search_assortment_with_partner(self):
8484
search_domain = self.partner.action_define_product_assortment()["domain"]
8585
self.assertEqual(
8686
search_domain,
87-
[("partner_ids", "in", [self.partner.id]), ("is_assortment", "=", True)],
87+
[("id", "in", [self.filter_obj.id])],
8888
)
8989

9090
def test_product_assortment_view(self):

0 commit comments

Comments
 (0)