2017-09-01 24 views
0

enter image description here我創建已在odoo創造了更多的thants 10款車型,我已經tryed創建模型名稱「mealitem」,但它產生的eroor: 「模式mealitem沒有表「模式「mealitem」沒有表

class meal_list(models.Model): 
    _name="mealitem" 

    name=fields.Char("The Name") 

在這裏的怪是,當我使用相同的代碼和UNE其他名稱,如allitem

class meal_list(models.Model): 
    _name="allitem" 

    name=fields.Char("The Name") 

有任何錯誤!所以我不明白爲什麼名稱mealitem不再工作!

幫助!

回答

1

你的日誌說你創建的許多模型沒有訪問規則,它只是一個WARM而不是一個錯誤,爲了避免這個消息,你需要爲每個新模型添加適當的訪問規則,創建一個ir.model.access.csv文件在your_module_name/security/ir.model.access.csv之下,併爲v8或__manifest__.py文件添加__openerp__.py文件的聲明。看看其他模型訪問文件,如account/security/ir.model.access.csv