__init__.py 748 B

123456789101112131415161718192021
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from . import controllers
  4. from . import models
  5. from . import utils
  6. from . import wizard
  7. from odoo import api, SUPERUSER_ID
  8. import uuid
  9. def init_initiating_microsoft_uuid(cr, registry):
  10. """ Sets the company name as the default value for the initiating
  11. party name on all existing companies once the module is installed. """
  12. env = api.Environment(cr, SUPERUSER_ID, {})
  13. config_parameter = env['ir.config_parameter'].sudo()
  14. microsoft_guid = config_parameter.get_param('microsoft_calendar.microsoft_guid', False)
  15. if not microsoft_guid:
  16. config_parameter.set_param('microsoft_calendar.microsoft_guid', str(uuid.uuid4()))