Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

unable to add column in res.users table

Subscriure's

Get notified when there's activity on this post

This question has been flagged
_inherits
17 Respostes
25733 Vistes
Avatar
Prakash

In OpenERP 7.0-20131109-002558 added the below code:-

class res_users(osv.osv): 
      _inherit = "res.users" 

      _columns = {
            'fieldname_id'  : fields.many2one("master.table",  "Data"),
      }

res_users()

Depends added in __openerp__.py

"depends" :  ["base", "master_module"],

xml Code

<?xml version="1.0"?>
<openerp>
    <data>
    <record model="ir.ui.view" id="view_resuser_field_form">
        <field name="name">resusers_field_form</field>
        <field name="model">res.users</field>
        <field name="inherit_id" ref="base.view_users_form"/>
        <field name="type">form</field>
        <field name="arch" type="xml">
        <xpath expr="//notebook" position="inside">
            <page string="Exta Details">
               <group col="4">
                  <field name="fieldname_id"/>
                </group>
             </page>
        </xpath>
        </field>
    </record>
    </data>
</openerp>

After restarting the server its shows blank white page in the log file below error shows:-

File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\openerp\addons\base\res\res_users.py", line 363, in context_get
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\.\openerp\osv\orm.py", line 486, in __getattr__
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\.\openerp\osv\orm.py", line 401, in __getitem__
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\openerp\addons\base\res\res_users.py", line 810, in read
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\openerp\addons\base\res\res_users.py", line 272, in read
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\.\openerp\osv\orm.py", line 3612, in read
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\.\openerp\osv\orm.py", line 3664, in _read_flat
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\.\openerp\sql_db.py", line 161, in wrapper
  File "D:\Program Files\OpenERP 7.0-20131109-002558\Server\server\.\openerp\sql_db.py", line 226, in execute
ProgrammingError: column res_users.fieldname_id does not exist
LINE 1: ...",res_users."gmail_password",res_users."alias_id",res_users....
                                                             ^

2014-04-08 09:40:41,312 2544 INFO cvw_new werkzeug: 127.0.0.1 - - [08/Apr/2014 09:40:41] "POST /web/session/get_session_info HTTP/1.1" 200 -

Note: using inherit able to add column in other table

1
Avatar
Descartar
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

In this case, when you add fields to res.partner model or res.users model, try to upgrade the corresponding module from the command line as the user interface wont be accessible due to the internal server error.

To upgrade the module from the command line / terminal:

odoo-bin -c odoo.conf -d database_name -u module_name


See an example here:  How To Upgrade Module From Terminal in Odoo


Another trick way you can follow is that, before restarting the service, open the corresponding apps page, open the app to upgrade in apps menu, immediately after restarting the service click the upgrade button.


Thanks
4
Avatar
Descartar
Avatar
Brett Lehrer
Best Answer

This is caused by an OpenERP bug modifying res.users or res.partner in an already installed module. Before the module is upgraded, new fields are found on startup since the module itself has already been installed, and it's trying to run a flat query on them before you get a chance to upgrade! Try manually starting the server:

./openerp-server -c server_config_file.conf -d mydatabase -u this_modified_module

This will upgrade the module this_modified_module in your database "mydatabase" as the server starts itself up, which gets around this bug.

3
Avatar
Descartar
Prakash
Autor

Thanks for giving information. I am using windows i already fixed issues by adding column in pg_admin directly and updating the module.

Avatar
Med Said BARA
Best Answer

Is the master_module, the module you are trying to install or a module already installed ?

0
Avatar
Descartar
Avatar
Jagdish Panchal
Best Answer

Hi,

Try this code

class res_users(osv.Model):
    _inherit = 'res.users'
    _columns = {
            'fieldname_id'  : fields.many2one("master.table",  "Data"),
      }
res_users()

<openerp>
    <data>


        <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="type">form</field>
            <field name="inherit_id" ref="base.view_users_form"/>
            <field name="arch" type="xml">
            <xpath expr="//notebook" position="inside">
                <page string="Exta Details">
                   <group col="4">
                      <field name="manager_id" invisible='1'/>
                    </group>
                 </page>
            </xpath>

            </field>
        </record>

    </data>
</openerp>
0
Avatar
Descartar
Prakash
Autor

i already tried its shows same error

Jagdish Panchal

Can u give your xml file ?

Prakash
Autor

Hi jack updated xml file.

Jagdish Panchal

Update ans pls check

Prakash
Autor

updated your source code and checked it shows same error.

Jagdish Panchal

pls upgrade your module with my code because its woking at my end.

Prakash
Autor

In my case after restarting server its shows blank page. At the log file shows same error.

Jagdish Panchal

its shows blank page ? means its add Page "Exta Details" on User Form ?

Prakash
Autor

After typing http://localhost:8069 its shows blank white page unable to create field in res_users table using python file. I fixed the issue by created the field using pgadmin tools.

Jagdish Panchal

Nice, but this code is working at my end

Serge

You do a --update on your module ?

where you added :"depends" : ["base", "master_module"], ??????

Avatar
Mihir Dave
Best Answer

Try updating the module from command line itself. using

python openerp-server  -c config_file.conf -u <module name>

You can even select database using -d <db_name>

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
how to change default digits of precision?
_inherits
Avatar
Avatar
1
de des. 18
20390
Reg - _inherits OpenERP
_inherits
Avatar
Avatar
1
de jul. 15
7797
TypeError: The model "fleet.vehicle" specifies an unexisting parent class "fleet.vehicle"
_inherits
Avatar
Avatar
Avatar
2
de març 15
9640
aading a new menuitem in fleet module
_inherits
Avatar
Avatar
2
de març 15
6163
inherited view from base_calendar view
_inherits
Avatar
Avatar
2
de març 15
11464
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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