Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

[Odoo 10] List all records of another module in a view (or just copy it over)

Odoberať

Get notified when there's activity on this post

This question has been flagged
many2onerefreshbooleanrelated_fieldsinherit_res.partner
4 Replies
7700 Zobrazenia
Avatar
bernardo.knackfuss@gmail.com

Hello,


I'm having a little trouble on how to display a list of all my ecommerce users inside a tree view in my custom module.

Objectives:

  1. Add a boolean field associated with my ecommerce users that will dictate if they are 'authorized' or not.

  2. The backend user should have access to a list of all users and should be able to authorize or deauthorize them easily.

  3. I will later modify my website templates to check wether the current user has 'authorized' set to True or not.

                

I thought about inheriting the 'res_users' model and start from there, but i'm not sure it would work (or be the best solution).

An even worse solution would be to copy all users records to my custom module and display the copies in the backend control panel view (to modify the authorization boolean), and then in the templates check for the custom module boolean field instead of a res_users boolean directly.

What i think would be cleaner would be to 'link' all user records to my module through a related field and then display them all in the module form view to serve as the control pannel.

What i can't manage to do is to make the view display all the records automatically (when the user clicks in the control panel i want a full list of users to be displayed)

This is what i got so far:


class AuthorizedUsers(models.Model):
_name = "auth_users"

user_id = fields.Many2one('res.users')
login = fields.Char(related='user_id.login')
is_authorized = fields.Boolean(String="Usuário Autorizado", default=False)


and this is the tree view:

<record model="ir.ui.view" id="user_auth_panel_tree">
<field name="name">user_auth_panel.tree</field>
<field name="model">auth_users</field>
<field name="view_type">tree</field>
<field name="arch" type="xml">
<tree>
<field name="login"/>
<field name="is_authorized"/>
</tree>
</field>
</record>


How can i list every res.user's login automatically in my tree view and attach a boolean to them?

Thanks.


0
Avatar
Zrušiť
Ray Carnes

Are you trying to hide pages for certain users? Did you consider putting them into groups and configuring certain pages to only be visible to a specific group? <t groups="xxx.yyy" ... />

bernardo.knackfuss@gmail.com
Autor

Ray, thats exactly what i want to do. Using the Qweb groups tag did not worked for me tough. I wanted to use a solution like this so the backend user can manage the portal users permissions more easily and also so i can learn more about the API

bernardo.knackfuss@gmail.com
Autor

Also, i'm trying to hide content within the pages, and not necessarily whole pages

Avatar
bernardo.knackfuss@gmail.com
Autor Best Answer

Still need an answer

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

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Write to Record in Related Field of Many2One Relationship
many2one related_fields
Avatar
0
máj 15
7387
Send a value from context one2many
many2one related_fields odoo15
Avatar
0
máj 24
1926
Related field not found while trying to set up a One2many field. Solved
many2one one2many related_fields
Avatar
Avatar
Avatar
2
okt 23
3288
Refresh a view form with many2one relation. How to achieve that?
many2one refresh odoo12.0
Avatar
Avatar
1
sep 21
6357
Product variant is also product (odoo 14) Solved
product many2one related_fields
Avatar
Avatar
1
mar 21
2873
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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