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

41 lines
1.3KB

  1. # -*- coding: utf-8 -*-
  2. import json
  3. from odoo import api, fields, models, tools, _
  4. from odoo.addons.base.models.res_users import check_identity
  5. class ResUserMenuItems(models.Model):
  6. _name = "res.user.menuitems"
  7. _description = "User menu items"
  8. company_id = fields.Many2one(
  9. string="Company", comodel_name="res.company", ondelete="cascade", readonly=True
  10. )
  11. enable_odoo_account = fields.Boolean(string="Enable Odoo Account", default=False)
  12. enable_lock_screen = fields.Boolean(string="Enable lock screen", default=True)
  13. enable_developer_tool = fields.Boolean(
  14. string="Enable Developer Tools", default=True
  15. )
  16. enable_documentation = fields.Boolean(string="Enable Documentation", default=True)
  17. documentation_url = fields.Char(
  18. string="Documentation URL",
  19. readonly=False,
  20. default="https://shanghaiopen.org.cn/",
  21. )
  22. enable_support = fields.Boolean(string="Enable Support", default=True)
  23. support_url = fields.Char(
  24. string="Support URL",
  25. readonly=False,
  26. default="https://shanghaiopen.org.cn/",
  27. )
  28. def _get_or_create_menuitems(self, id):
  29. domain = [("company_id", "=", id)]
  30. vals = {"company_id": id}
  31. menuitem = self.search(domain, limit=1)
  32. if not menuitem:
  33. menuitem = self.create(vals)
  34. return menuitem
上海开阖软件有限公司 沪ICP备12045867号-1