Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Trí tuệ nhân tạo (AI)
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

Adding a field to the res.users form view

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
settingsusersodoo18
4 Trả lời
469 Lượt xem
Ảnh đại diện
samual

Hello odooers.
i added a field to the res.users model/table in python and then extended the res.users form view to add that field to the view.
but when i access the users form view via settings the field is no where to be found is there a different way of adding fields to the user form view in odo?

its not the first time i extend view and add fields to them i did this alot before but here it doesnt seem to work.

i am trying to add the new field inside the access_rights tab

0
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
samual
Tác giả Câu trả lời hay nhất

Well somehow someway adding this arguement to the field definition made it appear in the user form
website_form_blacklisted=False

0
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Zehntech Technologies Inc.
Câu trả lời hay nhất

Hello, 

Yes, it is possible to add custom fields to the res.users form view in Odoo.

The first thing to verify is that you are inheriting the correct User form view, as res.users has multiple inherited views and some sections (including Access Rights) may be modified by other modules. Also check:

  • The field is added to the res.users model (not res.partner by mistake).
  • The inherited view is applied successfully without XML errors.
  • The field is inserted at the correct XPath location within the Access Rights tab.
  • Any groups, attrs, or visibility conditions are not hiding the field.

A good troubleshooting step is to activate Developer Mode and inspect the final combined form view to confirm whether your field is being injected into the view architecture.

Hope this works for you! If you need any help implementing this or want a more optimized approach, feel free to reach out for further discussion.

Regards,

Zehntech Technologies Inc.

santosh.sekwadia@zehntech.com

0
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Cybrosys Techno Solutions Pvt.Ltd
Câu trả lời hay nhất
Hi,

If the field is correctly added to res.users but does not appear in the Access Rights tab, you may be inheriting the wrong view. The user form displayed under Settings → Users & Companies → Users is usually based on the view base.view_users_form. Also, some sections of the user form are restricted by groups, so ensure your user has sufficient access rights.

For example, you can add a custom field as follows:

Python

from odoo import models, fields

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

employee_code = fields.Char(string="Employee Code")

XML

<record id="view_users_form_inherit" model="ir.ui.view">
<field name="name">res.users.form.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">

<xpath expr="//page[@name='access_rights']/group" position="inside">
<field name="employee_code"/>
</xpath>

</field>
</record>


After adding the field, upgrade your module and activate Developer Mode. Then go to Settings → Technical → User Interface → Views and verify that your inherited view is applied correctly.

If the field still does not appear, inspect the final generated view using Developer Mode → Edit View: Form and confirm that:

    The field exists in res.users.
    Your inherited view is active.
    The XPath matches an element that exists in your Odoo version.
    No groups or attrs conditions are hiding the field.

The exact XPath may vary depending on the Odoo version, so checking the structure of base.view_users_form in Developer Mode is often the quickest way to identify the correct insertion point.

Hope it helps

0
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Muhammad Farooq Iqbal
Câu trả lời hay nhất

Hi,

Yes, res.users is a bit special compared to normal models.

The user form opened from Settings > Users & Companies > Users is usually not a simple single form view. Odoo has different inherited views for users, especially for access rights/preferences, and the Access Rights tab is dynamically handled with groups/security-related content.

So if your field is added to res.users correctly but does not appear, check these points:

  1. Make sure you are inheriting the correct user form view, usually:

base.view_users_form
  1. Make sure your module depends on base and any module that adds the tab you are trying to inherit.

  2. The access_rights tab may be modified dynamically, so try adding your field to another stable place first, such as after the login/email field, to confirm the field and view inheritance are working.

Example:

<record id="view_users_form_inherit_custom" model="ir.ui.view">
    <field name="name">res.users.form.inherit.custom</field>
    <field name="model">res.users</field>
    <field name="inherit_id" ref="base.view_users_form"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='login']" position="after">
            <field name="your_field_name"/>
        </xpath>
    </field>
</record>
  1. If you specifically want to place it inside the Access Rights tab, inspect the final view in developer mode and confirm the exact XPath. The page name may not be the same as what you expect.

  2. Also make sure the field has proper access rights. Since res.users is security-sensitive, visibility can be affected by groups.

  3. Upgrade your custom module after changing Python/XML:

./odoo-bin -d your_db -u your_module

In short, adding fields to res.users is possible, but the Access Rights tab is special. First confirm the field appears in a stable location, then use developer mode to inspect the final inherited view and target the correct XPath inside the access rights page.

0
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
Technical User Settings > Odoo V14
settings users v14
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
2
thg 2 24
4705
Configure user's rights to modify General setting
settings users v7
Ảnh đại diện
Ảnh đại diện
2
thg 12 19
13885
Administrator rights, User editing rights
settings users v7
Ảnh đại diện
Ảnh đại diện
1
thg 9 16
16388
Odoo user error how to fix? Đã xử lý
settings users odoo8
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
3
thg 5 16
6210
Creating a Readonly User Group in Odoo Without Code Modifications Đã xử lý
settings users groups access rights
Ảnh đại diện
Ảnh đại diện
2
thg 1 25
4200
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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