1234567891011121314151617181920 |
- # -*- coding: utf-8 -*-
- from openerp.http import request
- '''
- Check if module is installed
- '''
- def is_module_installed(module_name):
- domain = [
- ('name', '=', module_name),
- ('state', '=', 'installed')
- ]
- module = request.env['ir.module.module'].search(domain)
- return len(module) != 0
- '''
- '''
- def is_field_exists(model_name, field_name):
- fields = request.env[model_name].fields_get([field_name])
|