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.

21 lines
626 B

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