跳至内容
菜单
此问题已终结
3 回复
23463 查看

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...

^

形象
丢弃
最佳答案

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.

形象
丢弃

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)

最佳答案

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

形象
丢弃
最佳答案

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

形象
丢弃