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

  1. # -*- coding: utf-8 -*-
  2. from odoo import models
  3. from odoo.http import request
  4. class Http(models.AbstractModel):
  5. _inherit = 'ir.http'
  6. def session_info(self):
  7. session_info = super(Http, self).session_info()
  8. user = request.env.user
  9. if self.env.user.has_group('base.group_user'):
  10. allowed_companies = session_info["user_companies"]["allowed_companies"]
  11. allowed_companies = {
  12. comp.id: {
  13. 'id': comp.id,
  14. 'name': comp.name,
  15. 'is_wecom_organization': comp.is_wecom_organization,
  16. 'sequence': comp.sequence,
  17. } for comp in user.company_ids
  18. }
  19. session_info["user_companies"]["allowed_companies"] = allowed_companies
  20. return session_info
上海开阖软件有限公司 沪ICP备12045867号-1