The view from the another menu data is not shown.
from odoo import models, fields, api
class TeacherSubject(models.Model):
_name = 'teacher.subject.record'
_description = 'Teacher Subject record'
_inherit = ["mail.thread"]
#ts_id = fields.Integer( string='Teacher..', tracking=True)
ts_ids = fields.Many2one('record.student')
name_teacher = fields.Many2one('record.teacher', string='Teacher')
teacher_subject = fields.Many2one('record.subject', string='Subject')
@api.onchange('name_teacher')
def onchange_name_teacher(self):
for rec in self:
return {'domain': {'teacher_subject': [('name_teacher', '=', rec.name_teacher.teacher_subject.ids)]}}
error:
raise ValueError("Invalid field %s.%s in leaf %s" % (model._name, path[0], str(leaf))) ValueError: Invalid field record.subject.name_teacher in leaf ('name_teacher', 'in', [6, 7])
check code for record.subject model. Make sure it contains field name_teacher.
If it have the field, try restarting your Odoo instance and upgrade the module containing record.subject model