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

27 lines
779B

  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 IrActionsActWindow(models.Model):
  7. _inherit = "ir.actions.act_window"
  8. @api.model
  9. def get_model_name_by_action_id(self, action_id):
  10. """
  11. res_model: 模型名称
  12. """
  13. result = {}
  14. data_dic = self.env['ir.actions.act_window'].browse(action_id).read()[0]
  15. result.update({
  16. "id": data_dic.get("id"),
  17. "name": data_dic.get("name"),
  18. "type": data_dic.get("type"),
  19. "xml_id": data_dic.get("xml_id"),
  20. "context": data_dic.get("context"),
  21. "res_model": data_dic.get("res_model"),
  22. })
  23. # print(result)
  24. return result
上海开阖软件有限公司 沪ICP备12045867号-1