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

Hello , I would like to delete a model from Odoo Interface ( Database Structure -> Models )

But when i try to delete the model, i see the following message : 

Model 'affichage2.wizard_client' contains module data and cannot be removed! 

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

Hi,

I think you cannot delete the models from the User interface ,

see the unlink function that raises the the above warning.

@api.multi
def unlink(self):
# Prevent manual deletion of module tables
if not self._context.get(MODULE_UNINSTALL_FLAG):
for model in self:
if model.state != 'manual':
raise UserError(_("Model '%s' contains module data and cannot be removed!") % model.name)

self._drop_table()

Thanks


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

Thank you bro ! So i should delete this raises from the python file ? in which file i will find this function ?

@Zakaria: yes.please check ir_model.py. You can find above code there

ผู้เขียน

Thank you Acha