Multi-Brand Access Rules
by IT-Projects LLC https://twitter.com/OdooFree , Ildar Nasyrov https://twitter.com/OdooFree
Odoo
Required Apps |
Website (website)
|
Included Dependencies | Show |
Lines of code | 641 |
Technical Name |
ir_rule_website |
License | See License tab |
Website | https://twitter.com/OdooFree |
Also available in version | v 11.0 v 10.0 v 12.0 |
Required Apps |
Website (website)
|
Included Dependencies | Show |
Lines of code | 641 |
Technical Name |
ir_rule_website |
License | See License tab |
Website | https://twitter.com/OdooFree |
Also available in version | v 11.0 v 10.0 v 12.0 |
Multi-Brand Access Rules
Make website-dependent access to pages, products, etc.
Version: v13.0.2.0.0
Tested and maintained by
IT Projects Labs
Assitance: help@itpp.dev
Technical module that allows implementing different features. For example:
- Show a blog on specific websites only
- Show an event on specific websites only
- Show a product on specific websites only
Let our expertise work for you!
(Doors and windows below are clickable)
/itpp-labs-1100.jpg)
/itpp-labs-930.jpg)
/itpp-labs-690.jpg)
Multi-Brand Access Rules
Installation
- Install this module in a usual way
Backend Usage
- 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