Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Odoo Module ACL(Access Controls List)

This is done using a CSV file named security/ir.model.access.csv :

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_todo_task_group_user,todo.task.user,model_todo_task,base.group_user,1,1,1,1
The filename corresponds to the model to load the data into, and the first line of the file has the column names. These are the columns provided by the CSV file:

id: It is the record external identifier (also known as XML ID). It should be unique in our module.
name: This is a description title. It is only informative and it’s best if it’s kept unique. Official modules usually use a dot-separated string with the model name and the group. Following this convention, we used todo.task.user.
model_id: This is the external identifier for the model we are giving access to. Models have XML IDs automatically generated by the ORM: for todo.task, the identifier is model_todo_task.
group_id: This identifies the security group to give permissions to. The most important ones are provided by the base module. The Employee group is such a case and has the identifier base.group_user.
The last four perm fields flag the access to grant read, write, create, or unlink (delete) access.
Comment

PREVIOUS NEXT
Code Example
Python :: Creating a bag-of-words in scikit-learn 
Python :: fastai read data from image folders 
Python :: HIDING AND ENCRYPTING PASSWORDS IN PYTHON USING ADVPASS 
Python :: contigent def 
Python :: append to multidimensional list python 
Python :: python package for facial emotion recognition 
Python :: extending the existing user model 
Python :: how to choose appropriate graph for dataset visualization 
Python :: python lambda append to list and return it 
Python :: wn.synset vs wn.synsets in nltk 
Python :: Collecting package metadata (repodata.json): done Solving environment: failed ResolvePackageNotFound: - python==3.9.13 
Python :: 1043 uri solution 
Python :: Combine first and last 3 columns into new dataframe 
Python :: How to Use the abs() Function with a Complex Number Argument 
Python :: python csv string to array 
Python :: how to give order in boxplot matplotlib 
Python :: get_string python 
Python :: duur wordt voor woorden kennis 
Python :: re.add python 
Python :: site:github.com python ssh 
Python :: python console ending multiline input 
Python :: import math print(m.cos(10)) 
Python :: remove all the valu ein dict exacpt provided key pythn 
Python :: sidetable github 
Python :: emacs shift region left python 
Python :: Filters rows using the given condition 
Python :: couple legend from twin axes python 
Python :: python set table widget header 
Python :: idwt pywt 
Python :: remove grid from 3d plots 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =