Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
17509 Prikazi

psycopg2.ProgrammingError: column ailsaodoo_session.color does not exist

LINE 2: ...ailsaodoo_session".id) AS "course_id_count" , sum("ailsaodoo...

^




actually I have define the color in .py file and use it in xml file

.py:

color = fields.Integer()

.xml

<kanban default_group_by="course_id">    
    <field name="color"/>
    ...
</kanban>

However, I fixed the problem by manually adding the column to database. I still want to know how to solve this by coding.

Avatar
Opusti

Make sure that in the code, you have added the field color in the same model and also check whether the file is called in init.

Best Answer

That is because the model is load after the inherit model, you can force load before and the database update use the next script:

odoo-bin -c <odoo.config.file> -d <database.name> -u <your.model.name>

Avatar
Opusti
Best Answer

I had the same problem and doing as follow fix the issue:

  1. Stop your server
  2. Run this command at first:  python3 odoo-bin --update=purchase_request
  3. Reload your localhost in browser
  4. Upgrade your module
  5. Stop server again
  6. Now, using the old command (The command you use always) start server again
  7. Upgrade your module again
  8. Done.


Avatar
Opusti