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

How to hide Edit button for specific user in form issue?It's Urgent..Somebody Help me?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
userv7hideeditissue
3 Odpowiedzi
16308 Widoki
Awatar
alvin

I want to hide edit button in form issue for specific user. In this case , I want user only can create issue but can't edit any recorded issue. Only admin and project manager that able to Edit recorded issue. I have tried change in access control list and record rules but it's not working. I also have tried change access rights in models project.issue and unchecked write access for user. Then , user can't edit but also can't create. Any one can help me for this case?thank you.

Note : Sorry for asking same question, because this problem isn't solved yet since 4 days ago..

1
Awatar
Odrzuć
Awatar
Nishant Kashyap
Najlepsza odpowiedź

You can make your record in two states :-1.)State="OPEN",2.)State="Submitted". Once you submitted the record then the creator of the record cannot edit it , then only Project Manager or the Admin can edit the record. Make a new Group "Can_Edit_Group" in the settings-->Users-->Groups.And add the project manager into it.

You need to add state and edit_group field in your _columns in your .py file.

_columns={
     'state':fields.selection([('open', 'Open'), ('submitted','Submitted'),],'Status', readonly=True),
     'edit_group':fields.many2one('res.groups', string='HR Manager Group'),
}

def _get_edit_group(self, cr, uid, context=None):
        all_groups=self.pool.get('res.groups')
        edit_group = all_groups.browse(cr, uid, all_groups.search(cr,uid,[('name','=','Can_Edit_Group')])[0]).id
        return edit_group

_defaults = {
    'edit_group':lambda self, cr, uid, context:self._get_edit_group( cr, uid, context=None)
}

def change_state(self, cr, uid, ids, context=None):
        self.write(cr, uid, ids, { 'state' : 'submitted' })
        return True

In XML add a button to change the record state on click. Put the button inside the header tag. If you are inheriting the View then do it using the Xpath else, put the header tag after you open the form tag.

<header>
<group attrs="{'invisible':[('state','=','submitted' )]}">
       <button name="change_state" string="Submit" type="object" states="open" class="oe_highlight"/>
</group>
      <field name="state" widget="statusbar" statusbar_visible="open,submitted"/>
<header>

In the record rule you can enter this rule: This will check if the state="submitted" and edit_group i.e the id of the group of whom users can edit the record are "in" the logged in user group.If this condition satisfy then the logged in user can edit the record else not.

['&',('state','=','submitted'),('edit_group','in',[g.id for g in user.groups_id])]

Give them all the access i.e check the boolean field read,write,create,delete and add the group into it i.e. add the Can_Edit_Group And don forget to add the your object and give record a name. And check the Active field.

I hope this is what you were looking for.

0
Awatar
Odrzuć
Awatar
Simplify it!
Najlepsza odpowiedź

I've seen this question for a few days I though that you already have a solution.

I don't have so much time but this is going to help you. I hope that you know how to code.

def write(self, cr, uid, ids, datas = {}, context = {} ):
          if uid not in self.pool.get('res.users').search(cr, uid, [('login','in',['admin','grover'])]):
             return super(class_name, self).write(cr, uid, ids, datas, context)
      else:
             raise osv.except_osv('Error','You are not allowed to make changes!')

Right now admin and grover can't make changes. You can have 1 or more users on that list ['username1','username2','username3']

It's the easiest way. there are other ways to check groups but as I told you I don't have so much time right now.

0
Awatar
Odrzuć
Simplify it!

Oh. this you have to do it inside your module, or if it's a native module inside the inherited module.

alvin
Autor

By the way sorry for I asked this question in this 4 days , because it's true..I'm not solve this problem yet.. I am a beginner in openerp..If you don't mind to help me again,. can you tell me how to code in function "if uid .....#check if user belongs to a certain group" above..in this case project user can't edit form issue..thank you for helping me

Simplify it!

I hope that can help you.

alvin
Autor

Big thanks Mr.Grover..hmm I copy your code and follow your instruction above..but it become can't connect to open erp..it's written "No Handler Found"..sorry for distrub you again..if you don't mind would you help me again?which file that I have to code?I already do in file project_issue.py Thank you very much mr Grover

alvin
Autor

Hai Mr.Grover..sorry for disturbing you again..hmmm if you don't mind to help me again..please response my comment above...because this project deadline in next tuesday so that I really need your help..thank you sir

Simplify it!

No Handler found happens when you can't connect to the server. Maybe you modified something that you shouldn't modify. The code above only can produce errors but in the server if has something wrong.

alvin
Autor

hmmm okei, but when the code above is removed my server is working again..hahaha..btw , thank you for helping me..:)

alvin
Autor

Can you help me where should i post that code? Is it in project_issue.py ?

Simplify it!

Yes, inside that file, inside the class that you want to modify

Awatar
alvin
Autor Najlepsza odpowiedź

any1 can help me?

-2
Awatar
Odrzuć
Nishant Kashyap

Hey, If you want , you can make your edit button disable for some group of users, without hiding them .Will that will work for you ..?

alvin
Autor

yes, its ok.. can you help me?

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ść
How to hide edit button in form issue for specific user??Really Need Help
user v7 hide button edit
Awatar
Awatar
Awatar
3
lut 18
9956
Please Help Me! It's Urgent (hide Edit button for specific user in form issue)
user v7 hide button
Awatar
Awatar
1
mar 15
5850
How to complete this python code?
python code user v7 issue
Awatar
0
mar 15
4541
template user
user v7
Awatar
Awatar
1
mar 15
13945
How to activate a created user? Rozwiązane
user v7
Awatar
Awatar
Awatar
2
sty 24
13837
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