中国本土应用
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
659B

  1. # -*- coding: utf-8 -*-
  2. from . import models
  3. import os.path
  4. from odoo import api, SUPERUSER_ID, _
  5. from odoo.exceptions import UserError
  6. def pre_init_hook(cr):
  7. env = api.Environment(cr, SUPERUSER_ID, {})
  8. path = env["ir.config_parameter"].get_param("wecom.resources_path")
  9. if path:
  10. if not os.path.exists(path):
  11. try:
  12. os.makedirs(path)
  13. except BaseException as e:
  14. raise UserError(
  15. _("Unable to create WeCom image storage path! Error:%s") % (repr(e))
  16. )
  17. else:
  18. raise UserError(_("WeCom image storage path has not been configured yet!"))
上海开阖软件有限公司 沪ICP备12045867号-1