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.

53 lines
1.9 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright (C) 2013-2014 GRAP (http://www.grap.coop)
  3. # @author Sylvain LE GAL (https://twitter.com/legalsylvain)
  4. # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
  5. from openerp import api, fields, models
  6. class BaseConfigSettings(models.TransientModel):
  7. _inherit = 'base.config.settings'
  8. # Getter / Setter Section
  9. @api.model
  10. def get_default_auth_admin_passkey_send_to_admin(self, fields):
  11. return {
  12. 'auth_admin_passkey_send_to_admin':
  13. self.env["ir.config_parameter"].get_param(
  14. "auth_admin_passkey.send_to_admin")
  15. }
  16. @api.multi
  17. def set_auth_admin_passkey_send_to_admin(self):
  18. for config in self:
  19. self.env['ir.config_parameter'].set_param(
  20. "auth_admin_passkey.send_to_admin",
  21. config.auth_admin_passkey_send_to_admin or '')
  22. @api.model
  23. def get_default_auth_admin_passkey_send_to_user(self, fields):
  24. return {
  25. 'auth_admin_passkey_send_to_user':
  26. self.env["ir.config_parameter"].get_param(
  27. "auth_admin_passkey.send_to_user")
  28. }
  29. @api.multi
  30. def set_auth_admin_passkey_send_to_user(self):
  31. for config in self:
  32. self.env['ir.config_parameter'].set_param(
  33. "auth_admin_passkey.send_to_user",
  34. config.auth_admin_passkey_send_to_user or '')
  35. auth_admin_passkey_send_to_admin = fields.Boolean(
  36. string='Send email to admin user.',
  37. help="""When the administrator use his password to login in """
  38. """with a different account, Odoo will send an email """
  39. """to the admin user.""")
  40. auth_admin_passkey_send_to_user = fields.Boolean(
  41. string='Send email to user.',
  42. help="""When the administrator use his password to login in """
  43. """with a different account, Odoo will send an email """
  44. """to the account user.""")