[FIX] website: properly filter website.page records on list/kanban view

Note: This fw-port commit cherry-picked and squashed commit [2] directly
      as it was fixing this original commit before it had the chance to
      be forward ported.

Since commit [1], which adapted the website pages list view to OWL, the
records listed on screen are filtered according to the active website
filter. However, the full list of records is still used behind the
scenes for all potential actions.

Steps to reproduce:
1. Go to the pages list view.
2. Select a specific website (if it's not already the case).
   => The total of records in the upper right corner does not match the
      number of pages on that specific website.
3. Click on the "Select all" checkbox.
   => All the pages are selected, including those that do not appear on
   screen.

This is because the records were just visually hidden with a `t-if`.

[1]: https://github.com/odoo/odoo/commit/940f4ee875332dafa1f379970a7683be6b3ee606
[2]: https://github.com/odoo/odoo/commit/db670f64f4c2190f1655f9077ea62885049a3c84

Courtesy of @robinlej and @detrouxdev

Related to task-3676124
opw-3554064
opw-3658648

closes odoo/odoo#149547

X-original-commit: 8d78a916dc8c0eca82e8a6a2c6f5541938709930
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Romain Derie
2024-01-22 21:10:46 +00:00
parent 772e713317
commit 41e2c4859b
17 changed files with 332 additions and 3 deletions
@@ -10,6 +10,14 @@
<field name="perm_read" eval="True"/>
</record>
<!-- SOME DEFAULT TEST.MODEL RECORDS WITH DIFFERENT WEBSITE_ID -->
<record id="test_model_generic" model="test.model">
<field name="name">Test Model Generic</field>
</record>
<record id="test_model_website_1" model="test.model">
<field name="name">Test Model Website 1</field>
<field name="website_id" ref="website.default_website"/>
</record>
<!-- RECORDS FOR RESET VIEWS TESTS -->
<record id="test_view" model="ir.ui.view">