Can not create records in a custom module for normal users (can only created by admin access rights) - odoo

I installed odoo 12 and create a custom module
I got this message while creating a record by the normal user
Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:
- Administration/Access Rights
(Document model: ir.rule) - (Operation: read, User: 6)
Please help me, to fix this

Please go through the below link.
https://medium.com/#reedrehg/becoming-a-superuser-in-odoo-12-0-f6fc2de3a62e
If you are aware of the Odoo 10 and below versions, you will understand this.
Apart from all of this add access rights for newly creating classes in Odoo on file ir.model.access.csv.
For example:
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_industry_section,access_industry_section,model_industry_section,base.group_user,1,1,1,1

Related

Why am i getting (Operation: read, User: 2) as admin?

I've installed a very basic custom module (contains one tiny model) and when i try to use it in a form i get the following error:
Sorry, you are not allowed to access this document. Please contact
your system administrator if you think this is an error.
(Document model: {model name here}) - (Operation: read, User: 2)
While i'm logged in as admin and have developer mode on (should be irrelevant). I haven't altered anything in the security directory that was generated by odoo-bin scaffold ...
Since Odoo 12 the user OdooBot user (ID 1) is now the super user and doesn't need rights explicitly. But user Admin (ID 2) needs them now. I bet your tiny module does not have any right definition (ir.model.access.csv) in it.
So either implement rights or for testing purposes switch to OdooBot (developer mode context menu).
In case anyone is having similar problem and have properly configured security definition then check if you spelled your reference model right. In may case I was referencing res.user (which does not exists) instead of res.users and got that error

Odoo 11 user cannot create new contact despite extra permissions set

I'm running Odoo 11.0 CE 20180126.
Normal users get an error when trying to create a new partner under contacts, telling them that they need to be admin.
The extra permissions to create contacts are set, the buttons appears and the form can be called. But the below error message immediately pops up.
Weirdly enough users can edit existing contacts but not create new ones.
Any help is greatly appreciated.
The issue was an interaction with another module which restricted the access. Solution was to remove the unused module.

Assigning Edit rights to the Project Manager of a project - OpenERP Access Rights

I'm trying to make the "Edit" button on the Project form to only be visible if the user logged into the system is the Project Manager of that project. I've been reading various answers online regarding this, gathering some understanding of Access Rights vs. Record Rules but I haven't been able to get this working. To my understanding, Access Rights over-ride Record Rules. So, if I create a record rule under the group "Project/User" that has read and write access with the domain as the following:
[('user_id','=',user.id)]
This will be over-ridden by the Access Rights for Project/User anyway? So How would I get this to work?
Thanks to anyone who can help.
As far as I know, Record Rules can override Access Rights.
Here is an example where record rules are used to change the base_user edit capabilities depending on the Task state: https://github.com/OCA/project-service/tree/8.0/project_baseuser/security
However, the "edit" button is not dynamically visible depending on the Task Status: it's always visible but the rules may or may not allow to write upon "Save".
Access Control List is checked before Record Rules.
Because Access Control List is a CRUD security on models (create/read/update/delete).
Only if ACL is passed next record level security comes in.
As far as I understood you want to give Project User permission to edit his own projects (he is in group Project User not Project Manager but set as Project Manager for exact Project by Project Manager group user LOL).
I did this by doing the following:
1) Give project users Project Manager role.
2) Restrict them to only modify own projects by creating a Global rule (no group is set) with the following domain on update / delete operations:
['|', ('user_id','=',user.id),('create_uid','=',user.id)]
P,S, Here is screenshot - http://awesomescreenshot.com/0083nqyf76
For the model project.project, provide the write permission only to the group project manager.Go to settings/techical/security. There you can see the access control list. CHeck what all group is provided to the project.project model.for every group other than project manager, remove the write permission

Editing Class permission schema not working (REST)

By following the instructions given in http://quickblox.com/developers/Custom_Objects#Permissions
every new record created (using REST interface) seems to get the ORIGNAL Class permission values instead of the edited ones.
In addition to this, the "use class permission" check box makes no difference on those problematic records. If a single record is created or edited using the web admin panel, then the permissions are working on the client app also.
Thanks
Janne
I see some misunderstanding in your explanation.
Class Permissions and Records permissions - they aren't related to each other.
If you edit Class Permissions, then Records permissions won't be touched.
And vice-a-versa.
If you don't use "use class permission" check box - then Records permissions will be used to determine access level of the record
If you on "use class permission" check box - then Class Permissions (that you set in Admin panel) will be used to determine access level of the record and Records permissions will be ignored.
Default Record permissions are:
Read: Open
Update: Owner
Delete: Owner
Got it?

How to allow write rights only to specific users building a new module in OpenErp?

I'm new to OpenErp and I'm trying to undestand access rights writing a new module.
Let's say I have this module called Project, with title, description and a many2many relation with res.users called admin_ids, this relation represents project admins.
How can I give write rights on projects only to their admins?
Thanks in advance.
http://doc.openerp.com/trunk/developers/server/04_security/#access-rights
OpenERP 7 Access Rights for User Roles
Here are the some links which helpful to you
you have to make a group and assing this group access right to write and give this group to uses