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.

26 lines
883 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 LasLabs Inc.
  3. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
  4. from odoo import _, api, models
  5. from odoo.exceptions import AccessError
  6. class Base(models.AbstractModel):
  7. _inherit = 'base'
  8. @api.multi
  9. def export_data(self, fields_to_export, raw_data=False):
  10. if self.env.user.has_group('base_export_security.export_group'):
  11. field_names = map(
  12. lambda path_array: path_array[0], map(
  13. models.fix_import_export_id_paths,
  14. fields_to_export,
  15. ),
  16. )
  17. self.env['export.event'].log_export(self, field_names)
  18. return super(Base, self).export_data(fields_to_export, raw_data)
  19. else:
  20. raise AccessError(
  21. _('You do not have permission to export data'),
  22. )