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.

25 lines
853 B

  1. from odoo import api,fields,models
  2. class ResConfigSettings(models.TransientModel):
  3. _inherit = 'res.config.settings'
  4. captcha_enabled = fields.Boolean("Google Recaptcha Module active?", default=True)
  5. @api.multi
  6. def set_values(self):
  7. super(ResConfigSettings, self).set_values()
  8. ICPSudo = self.env['ir.config_parameter'].sudo()
  9. ICPSudo.set_param(
  10. 'emc_website.captcha_enabled',
  11. 'True' if self.captcha_enabled else 'False'
  12. )
  13. @api.model
  14. def get_values(self):
  15. res = super(ResConfigSettings, self).get_values()
  16. ICPSudo = self.env['ir.config_parameter'].sudo()
  17. res.update({
  18. 'captcha_enabled': (True if ICPSudo.get_param(
  19. 'emc_website.captcha_enabled', default=True) == 'True' else False)
  20. })
  21. return res