def inter_call(self, data): cr, uid, context = self.env.args context = dict(context) context.update({'depends': {}}) self.env.args = cr, uid, frozendict(context) res = base_module_save._create_module(self, self._cr, self.env.user.id, data, context=context) mod_obj = self.env['ir.model.data'] model_data_ids = mod_obj.search([('model', '=', 'ir.ui.view'), ('name', '=', 'module_create_form_view')]) resource_id = model_data_ids.read(fields=['res_id'])[0]['res_id'] context.update(res) return { 'name': _('Module Recording'), 'context': { 'default_module_filename': ustr(res['module_filename']), 'default_module_file': ustr(res['module_file']), }, 'view_type': 'form', 'view_mode': 'form', 'res_model': 'base.module.record.objects', 'views': [(resource_id, 'form')], 'type': 'ir.actions.act_window', 'target': 'new', }
def inter_call(self, cr, uid, data, context=None): res = base_module_save._create_module(self, cr, uid, data, context) mod_obj = self.pool.get('ir.model.data') model_data_ids = mod_obj.search( cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'module_create_form_view')], context=context) resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] context.update(res) return { 'name': _('Message'), 'context': { 'default_module_filename': tools.ustr(res['module_filename']), 'default_module_file': tools.ustr(res['module_file']), }, 'view_type': 'form', 'view_mode': 'form', 'res_model': 'base.module.record.objects', 'views': [(resource_id, 'form')], 'type': 'ir.actions.act_window', 'target': 'new', }
def inter_call(self, data): cr, uid, context = self.env.args context = dict(context) context.update({'depends': {}}) self.env.args = cr, uid, frozendict(context) res = base_module_save._create_module(self, self._cr, self.env.user.id, data, context=context) mod_obj = self.env['ir.model.data'] model_data_ids = mod_obj.search([('model', '=', 'ir.ui.view'), ('name', '=', 'module_create_form_view')]) resource_id = model_data_ids.read(fields=['res_id'])[0]['res_id'] context.update(res) module_rec = self.env['base.module.record.objects'].create({ 'module_filename': ustr(res['module_filename']), 'module_file': ustr(res['module_file'])}) return { 'name': _('Module Recording'), 'res_id' : module_rec.id, 'view_type': 'form', 'view_mode': 'form', 'res_model': 'base.module.record.objects', 'views': [(resource_id, 'form')], 'type': 'ir.actions.act_window', 'target': 'new', }
def inter_call(self,cr,uid,data,context=None): res=base_module_save._create_module(self, cr, uid, data, context) mod_obj = self.pool.get('ir.model.data') model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'module_create_form_view')], context=context) resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] context.update(res) return { 'name': _('Message'), 'context': { 'default_module_filename': tools.ustr(res['module_filename']), 'default_module_file': tools.ustr(res['module_file']), }, 'view_type': 'form', 'view_mode': 'form', 'res_model': 'base.module.record.objects', 'views': [(resource_id, 'form')], 'type': 'ir.actions.act_window', 'target': 'new', }
def inter_call(self, cr, uid, data, context): res = base_module_save._create_module(self, cr, uid, data, context) return res