You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
650 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 - Ursa Information Systems <http://ursainfosystems.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
  4. from odoo import api, models
  5. class ResUsers(models.Model):
  6. _inherit = 'res.users'
  7. @api.model
  8. def fetch_export_models(self):
  9. accessobj = self.env['ir.model.access']
  10. accessobj_ids = accessobj.search([
  11. ('perm_export', '=', True),
  12. ('group_id', 'in', self.env.user.groups_id.ids),
  13. ])
  14. model_names = [
  15. access_obj.model_id.model for access_obj in accessobj_ids
  16. ]
  17. return list(set(model_names))