Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
368 Weergaven

I've inherited the res.users model and am trying to add a character field to it. However, it's throwing an internal server error on the server. Upgrading the module isn't working because the UI isn't loading. Additionally, on the live server, I don't have access to the command line to upgrade the module.(following is my code)


from odoo import models, fields


class ResUsers(models.Model):

    _inherit = 'res.users'


    clerk_id = fields.Char(string="Clerk User ID", index=True)



Avatar
Annuleer
Dear Mallika, Your request Re: Creating a field in res.user is throwing internal server error has been received and is being reviewed by our Customer Care team. The reference for your [...] ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​
Your Helpdesk Ticket
Re: Creating a field in res.user is throwing internal server error (#53)
SOUL FOODS RETAIL PVT. LTD.

Dear Mallika,

Your request Re: Creating a field in res.user is throwing internal server error has been received and is being reviewed by our Customer Care team.

The reference for your ticket is 53.

To provide any additional information, simply reply to this email.

Best regards,

Customer Care Team

SOUL FOODS RETAIL PVT. LTD.
Powered by Odoo
Beste antwoord

Hi,


If you're unable to access the UI (due to a 500 error) and can't use the CLI to upgrade your module on Odoo.sh, one effective workaround is to create a minimal custom module that defines your new field and sets it to auto-install. This ensures it gets automatically installed without manual upgrades.


Here’s how you do it:

    Create a new module, for example: user_clerk_field

    Add the following __manifest__.py:

{

    'name': 'User Clerk Field',

    'version': '1.0',

    'depends': ['base'],

    'author': 'Your Name',

    'installable': True,

    'auto_install': True,  # <-- This makes it install automatically

}


Inside the module folder, add a models/ directory with an __init__.py and res_users.py file:

models/__init__.py:

from . import res_users

models/res_users.py:

from odoo import models, fields

class ResUsers(models.Model):

    _inherit = 'res.users'

    clerk_id = fields.Char(string="Clerk User ID", index=True)

Once you push this module to Odoo.sh, it will install automatically due to auto_install=True, and your new field will be created without needing to manually upgrade via UI or CLI.

This approach is safe, reliable, and avoids crashes caused by views referencing a field that hasn't been created yet.


Hope it helps.

Avatar
Annuleer
Beste antwoord

Hi Mallika,

Try to upgrade the module trought CLI(through backend)

Hope this helps.


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 25
398
2
mei 25
537
2
mrt. 25
1198
0
jan. 25
1200
2
jul. 25
809