Skip to content
Snippets Groups Projects
Commit c45c0bf8 authored by Romain Derie's avatar Romain Derie Committed by qsm-odoo
Browse files

[FIX] website, *: add website_id in seo save rpc context

*: website_event

Without this, the seo saving would not forward the current website in
the context. It's especially bad in this case as it's writing on views
which are not triggering the COW due to the lack of a website_id in the
context.

Step to reproduce:
- Go to /shop (if you didn't do anything, this will be bound to the
  `website_sale.products` view which has no website_id set and is called
  a generic view)
- Open "Optimize SEO" dialog and type something in the title
- Save
- It saved the change on the mentioned view, without duplicating it
  (COW) before writing on it. The title you added is now applied to
  every websites and not only the one you edited, which is against the
  website holy grail rule: only the website you edit should be changed.

Technically, this is because we refactored that part of the code in Odoo
16: the website is now editable in the backend.

Note that this fix also revealed that a test for events (which has been
introduced with [1]) was relying on the bug: it tested the meta title of
a view that should (and will after this fix) have been COW'ed. This test
will now indirectly protects this bug from re-happening, although we
might want to write a dedicated test in the future as the behavior for
events might need some refactoring.

[1]: https://github.com/odoo/odoo/commit/2072a7739eb9a9ee87c8b3c7b0d43a82a7e2375f



opw-3499285

closes odoo/odoo#136084

Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: default avatarqsm-odoo <qsm@odoo.com>
parent 0c840590
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment