Skip to Content
Menu
This question has been flagged
1939 Views

i am trying to do  getting the values from one menu item of tree view into another menuitem of tree view.but didnot get that can anybody help me

py file:


    @api.multi
    @api.onchange('regulation')
    def onchange_get_faileddata(self):
       
        stud_list = []
        stud_obj = self.env['regulardata.form']
        for rec in self:
            if rec.regulation:
                stud_list = [{'subject_code': stu.sub_code,'subject_name': stu.name,'subject_type':stu.sub_type}
                             for stu in stud_obj.search([('course_id','=',rec.course_id),('year', '=',rec.year),('semester_id','=', rec.semester_id),                                                         ])]
            rec.regular_data = stud_list     #its not working

class regularregistration(models.Model):
    _name='page.regular'
    _description='Regular registration'
    _inherit = 'regular.single'


    subject_code = fields.Char('Subject Code')
    subject_name = fields.Char('Subject Name')
    subject_type = fields.Char('Subject Type')  
    regular_data1=fields.Many2one('regular.single','regulardata')



 

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
18020
1
Sep 23
1206
3
May 23
4095
7
Apr 23
47097
1
Dec 22
6437