Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
17515 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

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.

Câu trả lời hay nhất

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>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.


Ảnh đại diện
Huỷ bỏ