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

hi, i'm trying to inherith res.users. i added tatto_artist_hours_ids and it work, but when i tried to add hour_cost and last_name field. i got error


res_user.py


from odoo import fields, models

class Users(models.Model):
_inherit = 'res.users'

tattoo_artist_hours_ids = fields.One2many("tattoo.artist.hours", "tattoo_artist_id", string="Orari di lavoro")
hour_cost = fields.Float(string="Costo orario")
last_name = fields.Char(string="Last Name")

res_user.xml






res.users.view.form.inherit.artist
res.users














i got that error:

psycopg2.ProgrammingError: column res_users.last_name does not exist
LINE 1: ..."company_id","res_users"."alias_id" as "alias_id","res_users...


Avatar
Discard
Best Answer

Hi,

You have to upgrade the module from the terminal/command line when you add new fields to the res.partner or res.users model of an installed module.

Add -u module_name -d db_name along with odoo configuration.

You can see the explanation and some tricks to over come the above here: https://www.youtube.com/watch?v=-zXnlycSXog

Thanks

Avatar
Discard