İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Can't make stock.landed.cost model read-only for Accounting and Inventory groups (Odoo 15)

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
groupaccessaccessrightsodoo15
1 Cevapla
187 Görünümler
Avatar
Uday

I’m really tired of trying to edit the existing access rights for the model stock.landed.cost 

All I want is to make it read-only for these 3 user groups:

  • Accounting / Accountant
  • Inventory / Administrator
  • Accounting / Chief Accountant

What I tried:

I added the following lines in my security/ir.model.access.csv file:

"access_stock_landed_cost_account_manager","stock.landed.cost.account.manager","stock_landed_costs.model_stock_landed_cost","account.group_account_manager",1,0,0,0 "access_stock_landed_cost_account_accountant","stock.landed.cost.account.manager","stock_landed_costs.model_stock_landed_cost","base_accounting_kit.group_account_accountant",1,0,0,0 "access_stock_landed_cost","stock.landed.cost","stock_landed_costs.model_stock_landed_cost","stock.group_stock_manager",1,0,0,0

I tried using both the same names as the existing access rules and also different names, but it still didn’t work.

Users from these groups continue to have full access (create, write, unlink).

I know that access rights can be edited manually via the Odoo UI, but that is not my goal.

I want to:

  1. Keep the existing groups (Accounting / Accountant, Inventory / Administrator, Accounting / Chief Accountant) as read-only.
  2. Create a new user group that has full access (read, write, create, delete) to this model only


What’s the correct way to make the existing groups read-only on this model?

0
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi,


In Odoo, access rights are cumulative, meaning if a user belongs to multiple groups, they automatically inherit the highest level of permission from any of those groups. This is why your read-only access rules didn’t work, the users still had full rights inherited from existing rules defined in other modules.


To fix this, you first need to remove the existing ACLs for the stock.landed.cost model. You can do this in your custom module by adding <delete> tags in a security.xml file to delete the default access rules provided by the stock or accounting modules. After deleting the default rules, you can then define new access control entries in your ir.model.access.csv file that grant read-only permissions (1,0,0,0) to the three groups — Accounting / Accountant, Accounting / Chief Accountant, and Inventory / Administrator.


id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

access_stock_landed_cost_readonly_accountant,stock.landed.cost.readonly.accountant,stock_landed_costs.model_stock_landed_cost,account.group_account_manager,1,0,0,0

access_stock_landed_cost_readonly_chief_accountant,stock.landed.cost.readonly.chief_accountant,stock_landed_costs.model_stock_landed_cost,base_accounting_kit.group_account_accountant,1,0,0,0

access_stock_landed_cost_readonly_inventory_admin,stock.landed.cost.readonly.inventory.admin,stock_landed_costs.model_stock_landed_cost,stock.group_stock_manager,1,0,0,0



Next, if you need a specific group with full access to manage landed costs, you can create a new custom group (e.g., “Landed Cost Manager”) and assign it full permissions (1,1,1,1) on the same model.


<record id="group_landed_cost_manager" model="res.groups">

    <field name="name">Landed Cost Manager</field>

    <field name="category_id" ref="base.module_category_inventory"/>

</record>


access_stock_landed_cost_full_access,stock.landed.cost.full.access,stock_landed_costs.model_stock_landed_cost,my_module.group_landed_cost_manager,1,1,1,1


Finally, you should upgrade your module (not just restart the server) so Odoo properly reloads the updated ACLs. This approach ensures your existing groups have read-only access, while your new group retains full control over landed cost records.



If access rights alone don't work, add record rules in your security file:


<!-- Read-only rule for Accountants -->

<record id="stock_landed_cost_readonly_accountant_rule" model="ir.rule">

    <field name="name">Landed Cost - Read Only for Accountants</field>

    <field name="model_id" ref="stock_landed_costs.model_stock_landed_cost"/>

    <field name="domain_force">[(1, '=', 1)]</field>

    <field name="groups" eval="[(4, ref('account.group_accountant'))]"/>

    <field name="perm_read" eval="True"/>

    <field name="perm_write" eval="False"/>

    <field name="perm_create" eval="False"/>

    <field name="perm_unlink" eval="False"/>

</record>


<!-- Repeat for other groups -->

<record id="stock_landed_cost_readonly_account_manager_rule" model="ir.rule">

    <field name="name">Landed Cost - Read Only for Chief Accountants</field>

    <field name="model_id" ref="stock_landed_costs.model_stock_landed_cost"/>

    <field name="domain_force">[(1, '=', 1)]</field>

    <field name="groups" eval="[(4, ref('account.group_account_manager'))]"/>

    <field name="perm_read" eval="True"/>

    <field name="perm_write" eval="False"/>

    <field name="perm_create" eval="False"/>

    <field name="perm_unlink" eval="False"/>

</record>


<record id="stock_landed_cost_readonly_stock_manager_rule" model="ir.rule">

    <field name="name">Landed Cost - Read Only for Stock Managers</field>

    <field name="model_id" ref="stock_landed_costs.model_stock_landed_cost"/>

    <field name="domain_force">[(1, '=', 1)]</field>

    <field name="groups" eval="[(4, ref('stock.group_stock_manager'))]"/>

    <field name="perm_read" eval="True"/>

    <field name="perm_write" eval="False"/>

    <field name="perm_create" eval="False"/>

    <field name="perm_unlink" eval="False"/>

</record>


Hope it helps

2
Avatar
Vazgeç
Uday
Üretici

Thanks, that works!

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Hiding the menu items for user groups Çözüldü
group access
Avatar
Avatar
1
May 23
2711
Forbid user group to make any changes in products
access accessrights
Avatar
2
May 19
2450
odoo - access to user manager Çözüldü
group access user_management
Avatar
Avatar
2
Eyl 24
1991
How to prevent user from opening and closing any session in POS?
pos group accessrights
Avatar
0
Ağu 24
991
Struggling with ir.model.access.csv Çözüldü
security group access
Avatar
Avatar
Avatar
2
Eyl 21
12366
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now