Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Strange behavior of record rule

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
userscreaterulerecord
1 Odpowiedz
6927 Widoki
Awatar
Tomas Parnarauskas

I encountered strange behavior of custom access rule and it happens at only one database (don't know how it is different from others). So I created this record rule (on res.partner object for read, write, create and delete):

['|',('user_id','=',user.id),('user_id','=',False)]

When I create new user and give it group with this rule it gives me error when I try to create new partner (or when I try to open that users window, for example through salesperson field (it looks like that user don't have access to himself..)):

image description

The stranger thing is that this error does not show up with old users. When I give them same access rights, it creates new partners without problems. Also if I duplicate old user it also bypasses this error. So it seems something is wrong with creating new users.

I also tried to backup and restore that database to another server where are no such problems, but it gives this error there too. So it seems modules are fine. Something has to be with configuration in database, but I don't know what could be wrong. Any ideas?

EDIT: I managed to pinpoint why this rule was behaving so strange with newly created users. The problems seems to be with module I created. That module sets default salesman on partner when it presses create button in partners view. For example if John Doe presses button to create new partner he will be automatically assigned as salesman to that partner. Somehow this module blocks new users as being default ones for salesman on any partner. With old users (before installing that module) it works even when that module is installed.

My module is very simple, but I don't see it why it corrupts newly created users (and only when record rule that I talked earlier about is applied). Code looks like this:

from openerp.osv import osv

class res_partner(osv.osv):
    _name = 'res.partner'
    _inherit = 'res.partner'
    _defaults = {
        'user_id': lambda obj, cr, uid, context: uid,
    }

res_partner()

Should such module have to be defined somehow differently? Or did I miss something?

0
Awatar
Odrzuć
Awatar
ClueLogics Technologies Pvt. Ltd.
Najlepsza odpowiedź

Hi

this problem happen many time because, there is a security rule already added for this case

for solved it you have to do one thing

  1.  your user company should be false (means no company selected )  or the main company  in ` user record`
   or
  2 . you will have to create a complete rule for that company if company is change and you want to select new company for this user

then there will be no error's

even you can check it, just inactive that rule (a default rule) from settings - --> technical --> security --> records rules menu , then you will see that this error never happen

Thanks
Sandeep

2
Awatar
Odrzuć
Tomas Parnarauskas
Autor

I tried to make inactive 'user rule'. But problem is still here (I tried to disable default company rule too). Also in my database there is only one company. And it seems strange that old users don't get this error, when they are added to the same company as new users. Am I doing something wrong?

ClueLogics Technologies Pvt. Ltd.

must check res.partner company rule , for same company there should not be any problem

Tomas Parnarauskas
Autor

I disabled that rule, but still getting this error. Don't understand what's wrong. Also it does not happen in any other database (record rules are the same) with or wthout checking res.partner company rule.

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Record rule doesn´t remove Form Edit Button Rozwiązane
rule record
Awatar
Awatar
1
paź 22
7152
Private Address option when I create a new user
users create
Awatar
Awatar
1
wrz 20
6089
Allow a user to access only records that were created by him Rozwiązane
users create record_rules
Awatar
Awatar
1
cze 20
12424
Create co-record on create(self,vals) model
create mrp record
Awatar
Awatar
1
sty 20
6242
how to change the order who one2many create new records with editable=“bottom”?
one2many create record
Awatar
0
wrz 15
4648
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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