Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

user access to customed res.users fields

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
res.usersaccessrights
2 Replies
15941 Rodiniai
Portretas
LaLibreRie

Hello,

I added some customed fields by classic inheritance in the res.users model, as follows :

class TrelloUsers(models.Model):
    _inherit='res.users'

    trello_api_key=fields.Char('Trello API Key')
    trello_secret_token=fields.Char('Trello Secret Token')

Then, I modified the "Preferences" view to add those fields :

<record id="trello_view_preference_form" model="ir.ui.view">
    <field name="model">res.users</field>
    <field name="inherit_id" ref="base.view_users_form_simple_modif" />
    <field name="arch" type="xml">
      <xpath expr="//group[3]" position="after">
        <group string="Trello Settings">
          <field string="API Key" name="trello_api_key" readonly="0" />
          <field string="Secret Token" name="trello_secret_token" readonly="0" />
        </group>
      </xpath>
    </field>
</record>

It aims at allowing the concerned user to specify the data in those fields. But when I try to modify those data as an employee user, instead of admin user, I get an access error stating that only admins can modify these fields.

Odoo Server Error - Access Error
    Sorry, you are not allowed to modify this document. Only users with 
the following access level are currently allowed to do that:
- Administration/Access Rights(Document model: res.users)

I can’t find information about how to give a user the necessary rights to modify some fields in the res.users model, but still make sure they can’t modify data of other users.

Thanks.

Cyrille (La LibreRie)

0
Portretas
Atmesti
Portretas
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

As the logged in user if you are able to read those values, it means that you have got the read access to the model res.users, as you are getting the access right issue, it means that currently logged in user group have to no access/permission to write to the model res.users.


For currently logged in user group(if anything particular), else for the employee group, allow the write access to the model res.users.

Normally user have rights to edit their own data, make sure that there is no issue in changing the other values in the preference form. To adjust the access right issue, activate the developer mode and navigate to Settings -> Technical -> Security -> Access Control List / Record Rules and adjust the existing rule or add new one for your case.

 

Thanks

0
Portretas
Atmesti
LaLibreRie
Autorius

The users can change the other values, but not the customed fields I added. I added a rule to give the employee group access to res.users. I does work now. Thanks for answer.

Portretas
Andrey
Best Answer

In odoo16 you must add your custom field in res.users to 

@property
def SELF_WRITEABLE_FIELDS(self):
""" The list of fields a user can write on their own user record.
In order to add fields, please override this property on model extensions.
"""
return ['signature', 'action_id', 'company_id', 'email', 'name', 'image_1920', 'lang', 'tz']

In your case, it should look like this

class Users(models.Model):
_inherit='res.users'

@property
def SELF_WRITEABLE_FIELDS(self):
return super().SELF_WRITEABLE_FIELDS + ['trello_api_key','trello_secret_token']

trello_api_key=fields.Char('Trello API Key')
    trello_secret_token=fields.Char('Trello Secret Token')
0
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
What will happen if I remove a multi-company role from a res.users record?
res.users multi-company accessrights
Portretas
0
spal. 24
1689
Missing field string information for the field 'karma' from the 'res.users' model
res.users
Portretas
Portretas
Portretas
2
rugs. 23
3368
Problems with User Access
accessrights
Portretas
0
vas. 22
3397
Access Right for Sales Teams
accessrights
Portretas
Portretas
1
saus. 22
2326
Odoo v14 CE - Access Rights screen disappears after update of Base App
accessrights
Portretas
0
bal. 21
2619
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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