utils.py 436 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request
  3. '''
  4. Check if module is installed
  5. '''
  6. def is_module_installed(module_name):
  7. domain = [
  8. ('name', '=', module_name),
  9. ('state', '=', 'installed')
  10. ]
  11. module = request.env['ir.module.module'].search(domain)
  12. return len(module) != 0
  13. '''
  14. '''
  15. def is_field_exists(model_name, field_name):
  16. fields = request.env[model_name].fields_get([field_name])