Skip to Content
Menu
This question has been flagged
1 Reply
1875 Views

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

Avatar
Discard
Author

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>

Best Answer

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



Avatar
Discard
Related Posts Replies Views Activity
1
Oct 17
14385
2
Oct 17
5659
2
Dec 16
10511
1
May 16
4275
1
Aug 24
430