Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
17510 Visualizzazioni

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
Abbandona

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.

Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona