Skip to content

Commit

Permalink
[IMP] estate: add security configurations,update access rights for Es…
Browse files Browse the repository at this point in the history
…tate module

- Created security.xml with groups for 'Agent' and 'Manager' roles
- Updated __manifest__.py to include category and security XML file
- Configured access rights in ir.model.access.csv to restrict access as follows:
  - Full access to Real Estate Manager
  - Read-only access for Real Estate Agent
  - No delete permissions for properties
  • Loading branch information
pkgu-odoo committed Sep 2, 2024
1 parent 2d10d68 commit 7f748b7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
3 changes: 2 additions & 1 deletion estate/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
'version': '1.0',
'summary': 'This is E-state module about the property',
'description': 'A detailed description of my module',
'category': 'Sales',
'category': 'Real Estate/Brokerage',
'author': 'pkgu',
'depends': ['base'],
'data': [
'security/security.xml',
'security/ir.model.access.csv',
'wizard/estate_add_offer_wizard_views.xml',
'data/property_types_data.xml',
Expand Down
18 changes: 14 additions & 4 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1
access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,0,0,0
access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,0,0,0
access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,0,0,0
access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,0,0,0
access_estate_add_offer_wizard,access_estate_add_offer_wizard,model_estate_add_offer_wizard,base.group_user,1,1,1,1

access_estate_manager,estate_manager_access,model_estate_property,estate.estate_group_manager,1,1,1,1
access_estate_property_type_manager,access_estate_property_type_manager,model_estate_property_type,estate.estate_group_manager,1,1,1,1
access_estate_property_tag_manager,access_estate_property_tag_manager,model_estate_property_tag,estate.estate_group_manager,1,1,1,1
access_estate_property_offer_manager,access_estate_property_offer_manager,model_estate_property_offer,estate.estate_group_manager,1,1,1,1

access_estate_agent_types_tags_read,estate_agent_types_tags_read_access,model_estate_property_type,estate.estate_group_user,1,0,0,0
access_estate_agent_tags_read,estate_agent_tags_read_access,model_estate_property_tag,estate.estate_group_user,1,0,0,0
access_estate_agent_property,estate_agent_property_access,model_estate_property,estate.estate_group_user,1,1,1,0
access_estate_agent_offer,estate_agent_offer_access,model_estate_property_offer,estate.estate_group_user,1,1,1,0
16 changes: 16 additions & 0 deletions estate/security/security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<odoo>
<data>
<!-- Agent Group -->
<record id="estate_group_user" model="res.groups">
<field name="name">Agent</field>
<field name="category_id" ref="base.module_category_real_estate_brokerage"/>
</record>

<!-- Manager Group -->
<record id="estate_group_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_real_estate_brokerage"/>
<field name="implied_ids" eval="[(4, ref('estate_group_user'))]"/>
</record>
</data>
</odoo>

0 comments on commit 7f748b7

Please sign in to comment.