0

I need to create a customer service group which allow user to view(Read) Sales Orders, Customers, Invoices etc.

For that i have created a group 'Customer Service' in a separate module. Now instead setting rights for sale, stock, account, crm in core modules i want to set it in inherited modules for e.g rights for sale should be in sale_extension like wise.

I did same but the problem is if sale, sale_extension and stock is installed and i am accessing Sales -> Sales Orders it will raise warning Access Denied for model stock.picking, stock.move etc. as stock_extension(module containing rights for stock) is not installed.

How can i achieve this by setting rights in different modules?

Thank You,

Pooja
  • 575
  • 10
  • 28
  • Is there any particular reason why you don't want to set the permissions on the base modules? – miq Jul 09 '14 at 17:00
  • Hello miq, Yes i don't want to change core modules as it may cause problem while we migrate v7 to v8. – Pooja Jul 10 '14 at 10:23

1 Answers1

0

I don't see setting custom access control rules as "changing the core modules". I believe you have two options here:

1. You define access control rules in ir.model.access.csv file for Sale Order, Stock, etc. like this:

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_customer_service_sale_order,sale.order customer service,model_sale_order,my_groups.customer_service,1,0,0,0

2. You make your sale_extension depend on stock_extension.

I'd go for option 1 since I can't see what's the issue with defining access rules for core modules. As soon as you uninstall your sale_extension, the custom access rules are removed. Should work just fine when migrating.

miq
  • 2,746
  • 2
  • 24
  • 35
  • Access rights for sale are in sale_extension and for stock it is in stock_extension. Now sale_extension depends on sale_stock, so whenever i install sale_extension it will install sale as well as stock. But the problem is i haven't installed stock_extenstion yet so if i access Sales Orders it will throw warning 'Access Denied'. Any solution? Thanx – Pooja Jul 10 '14 at 10:51