Skip to Content
Menu
This question has been flagged
1 Reply
1796 Views

def new_program_batch_wizard(self):

     form_id = self.env.ref('my_module.view_program_batch_wizard', False

    return { 'name': 'New batch in this session'

    'view_type': 'form', 'view_mode': 'form',

     'res_model': 'new.program.batch.wizard',

     'view_id' : form_id.id,

      'type': 'ir.actions.act_window',

     'target': 'new',

     'context' :{ 'default_program_session_id': self.id, 'default_program_batch_semester_id': '',                 'default_call_from': 'session',

     'domain': {'default_program_template_id': [('program_level','=',self.program_level_id.id)]},

 }}

Avatar
Discard
Best Answer

in order to apply domain in action. domain would be key of action and value would list of tuples.

please check following

 'domain': [('program_level','=',self.program_level_id.id)]


final action would be:

return { 'name': 'New batch in this session', 

    'view_type': 'form', 'view_mode': 'form',

     'res_model': 'new.program.batch.wizard',

     'view_id' : form_id.id,

      'type': 'ir.actions.act_window',

     'target': 'new',

     'context' :{ 'default_program_session_id': self.id, 'default_program_batch_semester_id': '',                 'default_call_from': 'session',

     'domain': [('program_level','=',self.program_level_id.id)]

 }}


Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat

Avatar
Discard