I have created a new security group.
<record id="real_estate.group_user_base_pricing" model="res.groups">
<field name="name">User Base Pricing</field>
<field name="category_id" ref="real_estate.module_category_real_estate"/>
<field name="comment">the user will have the access to the Real Estate Management System Price List</field>
</record>
Here's the python fields. I want to apply security group on "pricing_policy" if this is equals to 'unit_base'
pricing_policy = fields.Selection([
('area', 'Area Base'),
('unit_base', 'Unit Base'),
],default='area')
area_base = fields.Boolean(default=True)
unit_base = fields.Boolean(implied_group='real_estate.group_user_base_pricing')
@api.onchange('pricing_policy')
def _onchange_pricing_policy(self):
if self.pricing_policy == 'area':
self.area_base = True
self.unit_base = False
elif self.pricing_policy == 'unit_base':
self.area_base = False
self.unit_base = True
This is the field I want to make visible when above condition is right.
<page string="Particular" autofocus="autofocus">
<field name="pricelist_line">
<tree editable="bottom">
<field name="size_id" options="{'no_create': True, 'no_open': True}"/>
<field name="category_id"/>
<field name="unit_inventory_id" groups="real_estate.group_user_base_pricing"/>
<field name="sector_id"/>
<field name="starting_date"/>
<field name="end_date"/>
<field name="price"/>
</tree>
</field>
</page>
Any help would be appreciated.
Hope this will helps: https://www.scoop.it/t/learn-openerp