Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
338 Visualizzazioni

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
Abbandona
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
Risposta migliore

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
Abbandona
Risposta migliore

Hi Mallika,

Try to upgrade the module trought CLI(through backend)

Hope this helps.


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
giu 25
369
2
mag 25
510
2
mar 25
1170
0
gen 25
1174
2
lug 25
791