Multi-Brand Access Rulesby IT-Projects LLC https://twitter.com/OdooFree , Ildar Nasyrov https://twitter.com/OdooFree
|Lines of code||641|
|License||See License tab|
|Also available in version||v 10.0 v 11.0 v 12.0|
Multi-Brand Access Rules
Make website-dependent access to pages, products, etc.
Tested and maintained by
IT Projects Labs
- Show a blog on specific websites only
- Show an event on specific websites only
- Show a product on specific websites only
Multi-Brand Access Rules
- Install this module in a usual way
- As usual open [[ Settings ]] >> Technical >> Security >> Record Rules to create a new rule or edit existing one
- RESULT: you can use variables websites and website_ids in domain_force field
Usage in a module
If you have a model accessible through a website, you can apply restriction in a following way:
- Add field website_ids to your model to specify on which websites the record should be available
- Add this ir_rule_website into the "depends" section of your manifest file
- Create a security rule using website_ids in domain_force field. For example,
<?xml version="1.0" encoding="utf-8"?> <odoo> <record id="blog_rule_all" model="ir.rule"> <field name="name">Blogs available only for specifed websites</field> <field name="model_id" ref="model_blog_blog"/> <field name="domain_force">[('website_ids', 'in', website_ids)]</field> </record> </odoo>
The MIT License (MIT) Copyright 2020 IT-Projects Labs Copyright 2015-2020 IT-Projects LLC Copyright 2014-2015 Ivan Yelizariev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module
- The author can leave a single reply to each comment.
- This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
- If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.