Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Internal Server Error

Odebírat

Get notified when there's activity on this post

This question has been flagged
record_rulesServerError
2 Odpovědi
2714 Zobrazení
Avatar
Imran ahmed

I was trying to create a record rule for the group_hr_manager. The objective of this record rule is not to show admin user and his user in users list. I saw it was achieved while I was already logged in.

But when I try to logout and then login into the system using a user id of this group the "Internal Server Error" appears. 

bellow is the record rules in security.xml:



Only admin can see admin user field

['&',('id', '!=', 2),('id', '!=', user.id)]




  
    



  
    




  
    
0
Avatar
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

Hi,

You can fix the 'Internal Server Error' by removing the '&' symbol in the record rule here the example code:

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


    <field name="name">Hide admin users</field>


    <field name="model_id" ref="base.model_res_users"/>


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


    <field name="domain_force">[('id', '!=', 2),('id', '!=', user.id)]</field>


</record>


Regards

0
Avatar
Zrušit
Imran ahmed
Autor

<record id="action_res_users_hr" model="ir.actions.act_window">
<field name="name">Users</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_id" ref="base.view_users_tree"/>
<field name="search_view_id" ref="base.view_users_search"/>
<field name="domain">[('id', '!=', 2),('id', '!=', user.id)]</field>
<field name="context">{'search_default_no_share': 1}</field>

</record>

<menuitem
id="menu_hr_user_inherit"
name="Users"
action="action_res_users_hr"
parent="hr.menu_hr_employee_payroll"
groups="hr.group_hr_manager"
sequence="6"/>

I have tried this domain [('id', '!=', 2),('id', '!=', user.id)] both in security.xml and in an action, but it's not working!
The objective of this domain is not to show user with id=2 and his own user in the Users list. but can be able to create and read other users from user model

but when I click on the Users menu as an user of group_hr_manager it gives the below error:
EvaluationError: Name 'user' is not defined
And, when I try this in security.xml file the of this group group_hr_manager can't login saying it doesn't have permission, contact your administrator.

Thanks for your Reply.

Avatar
Marcelo Pereira
Nejlepší odpověď
Try to use 

[('id', '!=', 2),('id', '!=', user)]


0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Leaves Approval through hierarchical manner
record_rules
Avatar
1
dub 26
4536
RPC-ERROR
ServerError
Avatar
0
kvě 24
3731
How Can I Use Record Rules to Restrict Speacific Record To Users? Vyřešeno
record_rules
Avatar
Avatar
2
led 24
5321
Suggest Record Rule
record_rules
Avatar
0
led 24
2882
Odoo Server Error in Most Things
ServerError
Avatar
0
úno 22
3562
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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