0

Related Error But Different Case

These two questions are related to computed field. My case below have nothing to do with computed field.

Impacted Versions

13

Steps to Reproduce

Open database selector.

We have Odoo just previously deployed. We are using Buildkite to Kubernetes pod.

Current Behavior

  1. Open database selector
  2. Odoo is loading indefinitely.
  3. kubectl logs <pod-name>
  4. Errors:
2020-08-10 10:37:18,715 34 ERROR commece-2020-08-10-08-27-07 odoo.addons.base.models.ir_cron: Unexpected exception while processing cron job {'id': 4, 'ir_actions_server_id': 118, 'cron_name': 'Mail: Notify channel moderators', 'user_id': 1, 'active': True, 'interval_number': 1, 'interval_type': 'days', 'numbercall': -1, 'doall': False, 'nextcall': datetime.datetime(2020, 8, 10, 8, 21, 37), 'lastcall': datetime.datetime(2020, 8, 9, 8, 21, 51), 'priority': 1000, 'create_uid': 1, 'create_date': datetime.datetime(2020, 8, 6, 8, 21, 32, 42803), 'write_uid': 1, 'write_date': datetime.datetime(2020, 8, 6, 8, 21, 32, 42803)} 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 753, in get
    value = self._data[field][record._ids[0]]
KeyError: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 978, in __get__
    value = env.cache.get(record, self)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('res.users(1,).tz', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 753, in get
    value = self._data[field][record._ids[0]]
KeyError: 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 978, in __get__
    value = env.cache.get(record, self)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('res.partner(2,).tz', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_cron.py", line 230, in _process_jobs
    registry[cls._name]._process_job(job_cr, job, lock_cr)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_cron.py", line 131, in _process_job
    now = fields.Datetime.context_timestamp(cron, datetime.now())
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1737, in context_timestamp
    tz_name = record._context.get('tz') or record.env.user.tz
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1002, in __get__
    self.compute_value(recs)
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1083, in compute_value
    records._compute_field_value(self)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3897, in _compute_field_value
    field.compute(self)
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 566, in _compute_related
    record[self.name] = self._process_related(value[self.related_field.name])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 5579, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 985, in __get__
    recs._fetch_field(self)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 2930, in _fetch_field
    self._read(fnames)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3001, in _read
    cr.execute(query_str, params)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 163, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 240, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column res_partner.x_module_connexi_store_category does not exist
LINE 1: ...r"."x_module_connexi_id" as "x_module_connexi_id","res_partn...

Tried to install the same module through Odoo command with odoo -d <db-name> -i <module-name> -p 8070 --stop-after-init the command runs successfully but the error persists.

Expected Behavior

  1. Open database selector
  2. Odoo loads the database selector.
  3. Select database
  4. Login
  5. Use Odoo

Videos/Screenshots, Links (Optional)

In codes:

    x_module_connexi_store_category = Char(
        string='Connexi Store Category',
        help=((
            'This field store the connexi store category.'
        ))
    )

In database:

enter image description here

notalentgeek
  • 4,939
  • 11
  • 34
  • 53
  • Weird problem. Did you try to update Odoo to the newest code? Neither the column error makes sense nor the `tz` CacheMiss because that field is a `Selection` field. – CZoellner Aug 10 '20 at 13:39
  • You got `UndefinedColumn` error, you have just to update database (`commece-2020-08-10-08-27-07`). – Kenly Aug 10 '20 at 21:30
  • What do you mean by "the newest code"? We are using Odoo 13. And what do you mean by "you have just to update database"? We are using PostgreSQL 12. – notalentgeek Aug 11 '20 at 02:04
  • The error tells you that the column is not present in database, you need to update the module on the same database – Kenly Aug 13 '20 at 15:31
  • Look at the screenshot I posted there... the field is already there. – notalentgeek Aug 15 '20 at 02:39

1 Answers1

0

My unstatisfying workaround for these king of issues by updating the module containing the field: odoo-bin -u the_module_havingthisfield

and running the system cron in Backoffice named "Auto-vaccum"

sylvain
  • 853
  • 1
  • 7
  • 20