Skip to Content
Menu
This question has been flagged
3 Replies
22153 Views

Traceback (most recent call last):

File "/home/stephen/odoo/odoo11.0/odoo/addons/base/ir/ir_cron.py", line 222, in _process_jobs

registry[cls._name]._process_job(job_cr, job, lock_cr)

File "/home/stephen/odoo/odoo11.0/odoo/addons/base/ir/ir_cron.py", line 128, in _process_job

now = fields.Datetime.context_timestamp(cron, datetime.now())

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 1584, in context_timestamp

tz_name = record._context.get('tz') or record.env.user.tz

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 951, in __get__

self.determine_value(record)

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 1062, in determine_value

self.compute_value(recs)

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 1018, in compute_value

self._compute_value(records)

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 1011, in _compute_value

self.compute(records)

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 599, in _compute_related

record[self.name] = value[self.related_field.name]

File "/home/stephen/odoo/odoo11.0/odoo/models.py", line 4659, in __getitem__

return self._fields[key].__get__(self, type(self))

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 951, in __get__

self.determine_value(record)

File "/home/stephen/odoo/odoo11.0/odoo/fields.py", line 1052, in determine_value

record._prefetch_field(self)

File "/home/stephen/odoo/odoo11.0/odoo/models.py", line 2565, in _prefetch_field

result = records.read([f.name for f in fs], load='_classic_write')

File "/home/stephen/odoo/odoo11.0/odoo/models.py", line 2509, in read

self._read_from_database(stored, inherited)

File "/home/stephen/odoo/odoo11.0/odoo/models.py", line 2628, in _read_from_database

cr.execute(query_str, params)

File "/home/stephen/odoo/odoo11.0/odoo/sql_db.py", line 155, in wrapper

return f(self, *args, **kwargs)

File "/home/stephen/odoo/odoo11.0/odoo/sql_db.py", line 232, in execute

res = self._obj.execute(query, params)

psycopg2.ProgrammingError: column res_partner.instructor does not exist

LINE 1: ...tner_country_id","res_partner"."color" as "color","res_partn...

^

Avatar
Discard
Best Answer

There is a solution for this if instructor is custom field.

if you add any new fields to the res_company, res_partner, res_users tables you have to follow the following steps.

1) add new fields

2) open your custom module from the apps list

3) restart server, do immediate upgrade of custom module

Note : Here the problem is if you add any new fields to the res_company, res_partner, res_users tables every request it will check. If you upgrade after restart without any request it will work.

Avatar
Discard

In Odoo.sh environment, there is no option to restart. How to handle the same case over there? (I don't to create as custom field from UI)

Best Answer

Hi Stephen,

Your Odoo does not know the field "instructor" on the model "res.partner". Are you sure that your module inherits res.partner correctly, that you've added the field and that the module is installed? Your code should look something like this:

# -*- coding: utf-8 -*-

from odoo import api, exceptions, fields, models, _

class ResPartner(models.Model):

_inherit = 'res.partner'

instructor = fields.Char()

Don't forget to inherit the correct app in your manifest.py / __openerp__.py! You should have a dependency on the contacts app there too.

Regards,
Yenthe

Avatar
Discard
Best Answer

Again! Please use a short and concise title. A title is a title and a message body is a message body.

Avatar
Discard