Managing multiple websites
Odoo has built-in support for multiple websites. This means that the same Odoo instance can be run on multiple domains as well as when displaying different records.
Getting ready
For this recipe, we will be using the my_library
module from the previous recipe. In this recipe, we will hide books based on the website.
How to do it...
Follow these steps to make the online website multi-website-compatible:
- Add
website.multi.mixin
in thelibrary.book
model, as follows:class LibraryBook(models.Model): Â Â Â Â _name = 'library.book' Â Â Â Â _inherit = ['website.seo.metadata', 'website.multi.mixin'] ...
- Add
website_id
in the book form view, as follows:... <group> Â Â Â Â <field name="author_ids" widget="many2many_tags"/> Â Â Â Â <field name="website_id"/> </group> ...
- Modify the domain in the...