hello everyone,
i created tow groups to manage contact create and edit access right as below:
<odoo>
<data>
<!-- Create Contact group -->
<record id="group_create_contact" model="res.groups">
<field name="name">Create Contact</field>
</record>
<!-- Edit Contact group -->
<record id="group_edit_contact" model="res.groups">
<field name="name">Edit Contact</field>
</record>
</data>
</odoo>
then i created csv field to setup the access :rights:id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_create_contact,access_create_contact,base.model_res_partner,contact_access_rights.group_create_contact,1,0,1,0
access_edit_contact,access_edit_contact,base.model_res_partner,contact_access_rights.group_edit_contact,1,1,0,0
the edit works fine, but when trying to create a new contact the press save button it shows below error message:
You are not allowed to modify 'Contact' (res.partner) records. This operation is allowed for the following groups: - Edit Contact Contact your administrator to request access if necessary.
i disabled all res.partner model access right and record rule to find the issue, but still getting same error. i searched and found that Odoo sometimes needs to allow "write" access to specific models to enable creation (even temporarily), so i create a record rule and add domain [('id', '=', False)]. it's simple but not working, any ideas odoooers?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
1
Odpowiedz
1293
Widoki
by overriding create and edit ORM methods and provide sudo privilege,
def create(self, vals):
record = super(ResPartner, self.sudo()).create(vals)
return record
def write(self, vals):
res = super(ResPartner, self.sudo()).write(vals)
return res
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
sie 18
|
14659 | ||
|
0
lis 15
|
4749 | ||
access rights manual
Rozwiązane
|
|
1
mar 15
|
5017 | |
|
1
mar 15
|
8423 | ||
|
10
gru 23
|
36755 |