跳至內容
選單
此問題已被標幟
6 回覆
21664 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
7月 22
9155
1
6月 21
2448
2
2月 21
299
5
9月 20
14346
4
6月 20
49736