From 9e05a279d71de1ab233c5e7f7989544108e2bf09 Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Sun, 4 Oct 2026 15:04:53 +0200 Subject: [PATCH] [FIX] website_sale_lazy_loading: give the test products their shop order Created in one batch, every product got the same website_sequence (MAX + 5, read before the insert) and the shop breaks the tie by id desc, so the listing came out backwards and the page assertions failed. Co-Authored-By: Claude Opus 5.5 --- website_sale_lazy_loading/tests/test_lazy_loading.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website_sale_lazy_loading/tests/test_lazy_loading.py b/website_sale_lazy_loading/tests/test_lazy_loading.py index 47bea99..f56d571 100644 --- a/website_sale_lazy_loading/tests/test_lazy_loading.py +++ b/website_sale_lazy_loading/tests/test_lazy_loading.py @@ -25,11 +25,16 @@ class TestLazyLoading(HttpCase): cls.other_category = cls.env["product.public.category"].create( {"name": "Other Cat"} ) + # An explicit website_sequence keeps the shop order equal to the + # creation order: in a batch create every product gets the same default + # (MAX + 5, read before the insert) and the shop breaks the tie by + # `id desc`, which would list them backwards. cls.products = cls.env["product.template"].create( [ { "name": "Lazy Product %02d" % index, "list_price": 10.0 + index, + "website_sequence": index, "is_published": True, "public_categ_ids": [(6, 0, cls.category.ids)], }