简体   繁体   中英

A relation “table_name” does not exist in “Many2many relation” in Odoo 10.0

I want to do a functionality :"a student can inscript a course, or a teacher can choose a course to teach". Here is my python code: SinhVien班(学生)

KhoaHoc类(课程)

GiaoVien班(老师)

PhongHoc类(教室)

Running odoo : A teacher want to choose a course to teach 他/她必须填写姓名和ID,然后单击下面的“添加项目”以选择一门课程

选择课程

在此处输入图片说明 单击上方的蓝色按钮“保存”,它会导致错误

I don't know clearly why relation "lop_phu_trach" does not exist even though I initialized it in the model "studentmanagement.khoahoc"

Thanks for your help in advanced

我已经解决了,在模型“ studentmanagement.giaovien”中,我更改为

LopPhuTrach = fields.Many2many('studentmanagement.khoahoc', string="Chọn lớp")

You don't have lop_phu_trach in your studentmanagement.khoahoc model. What you have is LopPhuTrach .

Try changing lop_phu_trach to LopPhuTrach .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM