Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Record Rules not fully hiding Inter-Company Sale Orders / Purchase Orders

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
securitypurchaserecord_rulesdomain_filterir.ruleodoo15
1 Balas
164 Tampilan
Avatar
Uday

I am trying to restrict visibility of Inter-Company Purchase Orders and Sale Orders in Odoo 15.

I added a Boolean field on both models:

  • is_inter_company_po on purchase.order

  • is_inter_company_so on sale.order

If the field is True, the document should be visible only to a special access group.

All other users should not see these inter-company records.

 My Record Rules

<record id="purchase_hide_intercompany_po_rule" model="ir.rule"> <field name="name">Hide Intercompany Purchase Orders (Global)</field> <field name="model_id" ref="purchase.model_purchase_order"/> <field name="domain_force">[('is_inter_company_po', '=', False)]</field> <field name="groups" eval="[(6, 0, [])]"/> <!-- Apply to ALL users --> </record>

<record id="sale_hide_intercompany_so_rule" model="ir.rule"> <field name="name">Hide Intercompany Sale Orders (Global)</field> <field name="model_id" ref="sale.model_sale_order"/> <field name="domain_force">[('is_inter_company_so', '=', False)]</field> <field name="groups" eval="[(6, 0, [])]"/> <!-- Apply to ALL users --> </record>

In addition, I created a new group:

"Sales / Access to Intercompany Sale Orders" "Purchase / Access to Intercompany Purchase"

Some users can still see Inter-Company Sale Orders / Purchase Orders.

It looks like another record rule is overriding my hide rule.

Especially on purchase.order — the hide rule does not fully take effect.

I want to:

  1. Hide inter-company SO/PO from all users by default.

  2. Allow only one specific group to see them.

  3. Make sure no other record rule overrides or cancels this rule

0
Avatar
Buang
Uday
Penulis

I later tried to override the existing rule directly, but the override did not work and I am trying to understand why.

Original rule:

<record id="sale_order_see_all" model="ir.rule"> <field name="name">All Orders</field> <field ref="model_sale_order" name="model_id"/> <field name="domain_force">[(1,'=',1)]</field> <field name="groups" eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"/> </record>

My attempt to inherit/override it:

<record id="sale.sale_order_see_all" model="ir.rule"> <field name="domain_force">[('stock_move_request_id', '=', False)]</field> </record>

Can you explain why this override is ignored? I believe the module dependencies are correct, so I expected this to replace the domain_force of the original rule, but nothing changes.

Kunjan Patel

Hello, Use the <function> tag in your custom module's XML:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<function model="ir.rule" name="write">
<value eval="[ref('sale.sale_order_see_all')]"/>
<value eval="{'domain_force': &quot;['&amp;', ('stock_move_request_id', '=', False), (1, '=', 1)]&quot;}"/>
</function>
</odoo>

Hope it helps

Avatar
Kunjan Patel
Jawaban Terbai
Hello Uday
I hope you are doing well

groups = [] is a fallback rule (lowest priority) - group-specific rules override it.
Fix: Apply your hide rule to purchase.group_purchase_user and sale.group_sale_salesman instead of empty groups. Then create a second rule with [(1,'=',1)] for your special intercompany group to allow access.

I hope this information helps you

Thanks & Regards,
Kunjan Patel
0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Record rules are not working as expected even though the rules are defined properly. What am I missing?
security groups record_rules domain_filter
Avatar
Avatar
Avatar
Avatar
3
Des 21
8720
Security groups and record rules Diselesaikan
security record_rules
Avatar
Avatar
1
Nov 24
2439
Domain Filtering help: Is there any operator like 'includes' or 'contains', which will do the inverse of 'child_of' operator? Diselesaikan
record_rules domain_filter
Avatar
Avatar
2
Okt 22
12770
Add unlink = False for record rule not work
security record_rules
Avatar
0
Agu 21
3253
Restrict access by company Diselesaikan
security record_rules
Avatar
1
Jun 19
4935
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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