Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
6 ตอบกลับ
21670 มุมมอง

in my model file I have an import statement that import models fields api from odoo but in pycharm it shows me an error, I have found some indications that suggest to add configuration for odoo to be set as a source in the project but it keep shows me an error

from odoo import models, fields, api # odoo models, fields, api are underlined red

class TodoTask(models.Model):

   _name= 'todo.task'

  _name= fields.Char('description', required=True)


@api.model

def do_clear_done(self):

 // here is my coe

 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

In pycharm open your project from the Odoo executable or packaged folder.

goto File -> Open -> Odoo Cloned or downloaded folder.[Package]

This will remove red lines, but if the red lines don't make any other interruption while running the server.

อวตาร
ละทิ้ง
ผู้เขียน

that worked for me but I had to Mark my odoo folder as Root Folder

คำตอบที่ดีที่สุด

Hi,

Please follow this link

https://stackoverflow.com/questions/45560191/how-to-run-and-debug-odoo-using-pycharm-in-ubuntu

https://www.cybrosys.com/blog/how-to-configure-pycharm-for-odoo-development-in-ubuntu

https://www.cybrosys.com/blog/configure-pycharm-odoo-development-windows



อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Configure PyCharm with odoo

Hope this will helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 22
9165
1
มิ.ย. 21
2450
[SOLVED] Get related field แก้ไขแล้ว
2
ก.พ. 21
299
5
ก.ย. 20
14350
How to install new module in Odoo 11 แก้ไขแล้ว
4
มิ.ย. 20
49741