中国本土应用
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

51 linhas
1.7KB

  1. # -*- coding: utf-8 -*-
  2. import json
  3. from odoo import api, models
  4. from odoo.http import request
  5. from odoo.tools import ustr
  6. class Http(models.AbstractModel):
  7. _inherit = "ir.http"
  8. def session_info(self):
  9. """
  10. 系统信息
  11. """
  12. session_info = super(Http, self).session_info()
  13. del session_info["support_url"]
  14. ICP = self.env["ir.config_parameter"].sudo()
  15. system_name = ICP.get_param("oec.system_name", default="China ERP")
  16. display_company_name = bool(ICP.get_param("oec.display_company_name", default=True))
  17. #用户菜单项
  18. current_conpany = self.env.user.company_id
  19. enable_odoo_account = current_conpany.enable_odoo_account
  20. enable_lock_screen = current_conpany.enable_lock_screen
  21. enable_developer_tool = current_conpany.enable_developer_tool
  22. enable_documentation = current_conpany.enable_documentation
  23. documentation_url = current_conpany.documentation_url
  24. enable_support = current_conpany.enable_support
  25. support_url = current_conpany.support_url
  26. session_info.update({
  27. "system_name": system_name,
  28. "enable_odoo_account": enable_odoo_account,
  29. "enable_lock_screen": enable_lock_screen,
  30. "enable_developer_tool": enable_developer_tool,
  31. "support": {
  32. "support_url": support_url,
  33. "hide": enable_support,
  34. },
  35. "documentation": {
  36. "documentation_url": documentation_url,
  37. "hide": enable_documentation,
  38. },
  39. })
  40. if display_company_name:
  41. session_info.update({"display_company_name": display_company_name})
  42. return session_info
上海开阖软件有限公司 沪ICP备12045867号-1