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)
HR payroll Employees attendances Payslips
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
HR payroll Employees attendances Payslips
Mengenai forum ini
  1. Human Resources
  2. Forum

Odoo CE v13. Time Off module - ordinary users do not see the all records.

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
securityholidaysrecord_rules13.0
1 Balas
2441 Tampilan
Avatar
Vasyl Melnychuk

Hi! I wasted 4 hours searching and yet can not find a good solution. In nightly build 31.03 every user could see all unavailabilities in Time Off\Everyone. After I upgraded the module to the May version, one record rule for some reason has been simply updated. I have found how to fix it manually but to make sure this never happens again, I wrote a small add-on. However, the same technique I saw in the original source code, does not work for my custom code!

I am trying to override the record rule:

    <record id="hr_leave_rule_employee" model="ir.rule">
        <field name="name">Time Off base.group_user read</field>
        <field name="model_id" ref="hr_holidays.model_hr_leave"/>
        <field name="domain_force">[(1,'=',1)]</field>
        <field name="perm_create" eval="False"/>
        <field name="perm_write" eval="False"/>
        <field name="perm_unlink" eval="False"/>
        <field name="groups" eval="[(4,ref('base.group_user'))]"/>
    </record>
and I tried a variety of the model ref samples, but none of them work, and only one

hr_holidays.hr_leave_rule_employee
 is definitely wrong, but worked out and strangely created an additional rule with the reference to Qweb Field, while the proper value
hr_holidays.model_hr_leave

throws the following error message:

Error: Odoo Server Error Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse self._tag_root(de) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root f(rec) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record record = model._load_records([data], self.mode == 'update') File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create return self.create(values) File "<decorator-gen-51>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 199, in create res = super(IrRule, self).create(vals_list) File "<decorator-gen-3>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3742, in create records = self._create(data_list) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3895, in _create records._validate_fields(name for data in data_list for name in data['stored']) File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields check(self) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in _check_model_transience if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in <genexpr> if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/api.py", line 463, in __getitem__ return self.registry[model_name]._browse(self, (), ()) File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 177, in __getitem__ return self.models[model_name] KeyError: 'hr.leave' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/http.py", line 624, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 14, in reraise raise value File "/usr/lib/python3/dist-packages/odoo/http.py", line 669, in dispatch result = self._call_function(**self.params) File "/usr/lib/python3/dist-packages/odoo/http.py", line 350, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call result = self.endpoint(*a, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 915, in __call__ return self.method(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap response = f(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1326, in call_button action = self._call_kw(model, method, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1314, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/api.py", line 387, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/api.py", line 374, in _call_kw_multi result = method(recs, *args, **kwargs) File "<decorator-gen-66>", line 2, in button_immediate_upgrade File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 72, in check_and_log return method(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 634, in button_immediate_upgrade return self._button_immediate_function(type(self).button_upgrade) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 419, in load_modules force, status, report, loaded_modules, update_module, models_to_check) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 315, in load_marked_modules perform_checks=perform_checks, models_to_check=models_to_check File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 225, in load_module_graph load_data(cr, idref, mode, kind='data', package=package, report=report) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 68, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 736, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 803, in convert_xml_import obj.parse(doc.getroot()) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 721, in parse exc_info[2] File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 13, in reraise raise value.with_traceback(tb) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse self._tag_root(de) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root f(rec) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record record = model._load_records([data], self.mode == 'update') File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create return self.create(values) File "<decorator-gen-51>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 199, in create res = super(IrRule, self).create(vals_list) File "<decorator-gen-3>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3742, in create records = self._create(data_list) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3895, in _create records._validate_fields(name for data in data_list for name in data['stored']) File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields check(self) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in _check_model_transience if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in <genexpr> if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/api.py", line 463, in __getitem__ return self.registry[model_name]._browse(self, (), ()) File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 177, in __getitem__ return self.models[model_name] odoo.tools.convert.ParseError: "hr.leave" while parsing /mnt/extra-addons/augusta_time_off/security/hr_holidays_security.xml:2, near <odoo> <record id="hr_leave_rule_employee" model="ir.rule"> <field name="name">Time Off base.group_user read</field> <field name="model_id" ref="hr_holidays.model_hr_leave"/> <field name="domain_force">[(1,'=',1)]</field> <field name="perm_create" eval="False"/> <field name="perm_write" eval="False"/> <field name="perm_unlink" eval="False"/> <field name="groups" eval="[(4,ref('base.group_user'))]"/> </record> </odoo>

What is wrong? Thanks in advance!


0
Avatar
Buang
Avatar
Vasyl Melnychuk
Penulis Jawaban Terbai

in addition what is quite strange:

the record rule I want to change has id=40, and if I use ref = hr_holidays.hr_leave_rule_employee, it creates a new rule referencing the model  ir.qweb.field (XML ID = base.model_ir_qweb_field), and what a coincidence - its id is also 40!

select * from ir_rule where id = 40

...returns 1 record which I want to amend, and I have a feeling that the XML parser somehow looks up for id value (40), not model_id value (197) in ir_model:

select * from ir_model where id = 40
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
Security groups and record rules Diselesaikan
security record_rules
Avatar
Avatar
1
Nov 24
2444
Add unlink = False for record rule not work
security record_rules
Avatar
0
Agu 21
3254
[13.0] how to restrict access to a website page for portal users with a condition
security record_rules permissions website 13.0
Avatar
1
Sep 20
7211
Restrict access by company Diselesaikan
security record_rules
Avatar
1
Jun 19
4942
How to segregate contact records using record rules
security record_rules permissions
Avatar
Avatar
2
Nov 24
2150
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