コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3430 ビュー

I've been raking my head around this for the better part of the day and i just can't seem to get it right.

I'm trying to add a new field to the res_users form but whatever I do it just won't show. No errors, everything seems normal but the field just isn't showing in the form.

manifest.py:

{
    'name': "Extended User",
    'version': '1.0',
    'depends': ['base'],
    'author': "blake_won",
    'category': 'custom',
    'description': """
    Description text
    """,
    # data files always loaded at installation
    'data': [
        'views/extended_views.xml',
    ],
}

views file:

    
        res.users.form.inherit
        res.users
        
        
            
                
                
                
            
        
    

extendeduser.py:

from odoo import models, fields

class ilexiusUser(models.Model):
    _inherit = 'res.users' 
    extended_variable = fields.Char(string="EXTENDED VARIABLE",default="NA")

console log:

2021-09-08 15:35:14,386 55731 INFO mydb odoo.modules.loading: Loading module extended_user (2/8) 
2021-09-08 15:35:14,411 55731 INFO mydb odoo.modules.registry: module extended_user: creating or updating database tables 
2021-09-08 15:35:14,484 55731 INFO mydb odoo.modules.loading: loading extended_user/views/extended_views.xml```


Please help me, i'm at my wit's end

アバター
破棄
著作者

just realized the view file wasnt showing
<record id="res_users_form_view" 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="//field[@name='partner_id']" position="after">
<group>
<field name="extended_variable"></field>
</group>
</xpath>
</field>
</record>

最善の回答

the question is old, but I answer it can be useful, you have to check if you have imported the model in the init file of your models folder



アバター
破棄
関連投稿 返信 ビュー 活動
1
10月 17
15805
2
10月 17
7055
2
12月 16
11798
1
5月 16
5685
4
2月 25
2448