中国本土应用
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

51 lines
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