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

264 lines
17KB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <data>
  4. <record id="view_wecom_apps_filter" model="ir.ui.view">
  5. <field name="name">wecom.apps.search</field>
  6. <field name="model">wecom.apps</field>
  7. <field name="arch" type="xml">
  8. <search>
  9. <field name="name" />
  10. <!-- <field name="company_id"/> -->
  11. <group expand="0" string="Group By">
  12. <filter name="group_company" string="Company" domain="[]" context="{'group_by': 'company_id'}"/>
  13. </group>
  14. </search>
  15. </field>
  16. </record>
  17. <record id="view_wecom_apps_kanban" model="ir.ui.view">
  18. <field name="name">wecom.apps.kanban</field>
  19. <field name="model">wecom.apps</field>
  20. <field name="arch" type="xml">
  21. <kanban sample="1" group_create="false" group_delete="false" group_edit="false" column_edit="false" create="false" edit="false" delete="false" records_draggable="0" quick_create="false" class="o_kanban_mobile">
  22. <field name="app_name"/>
  23. <field name="company_id"/>
  24. <field name="square_logo_url"/>
  25. <field name="close"/>
  26. <templates>
  27. <!-- class="o_kanban_image_fill_left" -->
  28. <t t-name="kanban-box">
  29. <div class="oe_kanban_global_click">
  30. <div class="o_kanban_image">
  31. <field name="square_logo_url" widget="image_url" options='{"size": [60, 60]}'/>
  32. </div>
  33. <div class="oe_kanban_details">
  34. <ul>
  35. <li class="text-success float-end mb4" t-if="!record.close.raw_value">
  36. <i class="fa fa-circle" role="img" aria-label="Enable" title="Enable"></i>
  37. </li>
  38. <li class="text-danger float-end mb4" t-if="record.close.raw_value">
  39. <i class="fa fa-circle" role="img" aria-label="Disabled" title="Disabled"></i>
  40. </li>
  41. <li class="mb4">
  42. <strong>
  43. <field name="app_name"/>
  44. </strong>
  45. </li>
  46. <li class="float-end mb4">
  47. <field name="type" widget="badge" decoration-success="type == 'manage'" decoration-info="type == 'base'" decoration-warning="type == 'self'" decoration-secondary="type == 'third'"/>
  48. </li>
  49. <li class="mb4">
  50. <strong>
  51. <field name="agentid" widget="integer" options="{'format': false}"/>
  52. </strong>
  53. </li>
  54. <li class="mb4">
  55. <field name="description" class="text-muted"/>
  56. </li>
  57. </ul>
  58. </div>
  59. </div>
  60. </t>
  61. </templates>
  62. </kanban>
  63. </field>
  64. </record>
  65. <record id="view_wecom_apps_form" model="ir.ui.view">
  66. <field name="name">wecom.apps.form</field>
  67. <field name="model">wecom.apps</field>
  68. <field name="arch" type="xml">
  69. <!-- js_class="wecom_apps_form" -->
  70. <form >
  71. <header></header>
  72. <sheet>
  73. <div name="button_box" class="oe_button_box">
  74. <button class="oe_stat_button" name="get_app_info" string="Get application" type="object" icon="fa-cloud-download" attrs="{'invisible': ['|',('agentid','=',0),('type','=','manage')]}"/>
  75. <!-- <button class="oe_stat_button" name="set_app_info" string="Set application" type="object" icon="fa-cloud-upload" attrs="{'invisible': ['|','|',('agentid','=',0),('type','=','manage'),('type','=','base'),]}"/> -->
  76. <button class="oe_stat_button" name="get_access_token" string="Get Access Token" type="object" icon="fa-key" attrs="{'invisible': ['|',('company_id','=', False),('type','=', 'self')]}"/>
  77. <!-- <button class="oe_stat_button" name="get_type_code" string="Get Type Code" type="object" icon="fa-key" /> -->
  78. <button class="oe_stat_button" name="get_app_jsapi_ticket" string="Get JSAPI Ticket" type="object" icon="fa-ticket" attrs="{'invisible': [('company_id','=', False)]}"/>
  79. </div>
  80. <field name="square_logo_url" widget="image_url" options='{"size": [80, 80]}' class="oe_right"/>
  81. <div class="oe_title">
  82. <label for="app_name" class="oe_edit_only"/>
  83. <h1>
  84. <field name="app_name" attrs="{'readonly': [('type','=','manage')]}" />
  85. </h1>
  86. <!-- <group>
  87. <field name="model_ids" widget="many2many_tags" options="{'no_create': True}"/>
  88. </group> -->
  89. </div>
  90. <group>
  91. <group>
  92. <field name="company_id" widget="selection" required="1"/>
  93. </group>
  94. <group>
  95. <field name="close" attrs="{'readonly': ['|',('type','=','manage'),('type', '=', 'base')]}"/>
  96. </group>
  97. </group>
  98. <group>
  99. <group>
  100. <field name="type" required="1"/>
  101. <field name="type_id" readonly="1" invisible="1" force_save="1" />
  102. <field name="subtype_ids" required="1" widget="many2many_checkboxes" domain="[('parent_id', '=', type_id)]"/>
  103. </group>
  104. <!-- many2many_checkboxes many2many_tags-->
  105. <group>
  106. <field name="type_code" force_save="1" readonly="1"/>
  107. </group>
  108. </group>
  109. <group>
  110. <field name="description" attrs="{'readonly': ['|',('type','=','manage'),('type', '=', 'base')]}"/>
  111. </group>
  112. <group>
  113. <group>
  114. <field name="agentid" widget="integer" options="{'format': false}" attrs="{'readonly': [('type','=','manage')]}"/>
  115. </group>
  116. <group>
  117. <field name="secret" widget="DisplayPasswordChar" require_encryption="True"/>
  118. </group>
  119. </group>
  120. <group>
  121. <field name="allow_userinfos" attrs="{'readonly': [('type','=','manage')]}"/>
  122. <field name="allow_partys" attrs="{'readonly': [('type','=','manage')]}"/>
  123. <field name="allow_tags" attrs="{'readonly': [('type','=','manage')]}"/>
  124. </group>
  125. <notebook>
  126. <page name="option" string="Option" attrs="{'invisible': [('type','!=','self')]}">
  127. <group>
  128. <group>
  129. <field name="report_location_flag"/>
  130. <field name="isreportenter"/>
  131. </group>
  132. <group>
  133. <field name="redirect_domain"/>
  134. <field name="home_url"/>
  135. </group>
  136. </group>
  137. </page>
  138. <page name="access_token" string="Access Token">
  139. <p class="text-info">
  140. Getting access_token is the first step in calling the enterprise WeChat API interface, which is equivalent to creating a login credential, and other business API interfaces all need to rely on access_token to authentice the caller's identity.
  141. </p>
  142. <p class="text-info">
  143. Therefore, developers should identify the source of the issuance of access_token and use the correct access_token before using the business interface.
  144. </p>
  145. <p class="text-info">
  146. Each app has a separate access_token can only be used by this app, so the access_token for each app should be obtained separately
  147. </p>
  148. <p class="text-warning">
  149. Developers need to cache access_token for subsequent interface calls (note: gettoken interfaces cannot be called frequently or are frequently blocked). When access_token expires or expires, it needs to be re-acquired.
  150. </p>
  151. <div class="o_row">
  152. <label for="access_token"/>
  153. <field name="access_token" widget="CopyClipboardText" force_save="1"/>
  154. </div>
  155. <div class="o_row">
  156. <label for="token_expiration_time"/>
  157. <field name="token_expiration_time" force_save="1"/>
  158. </div>
  159. </page>
  160. <page name="jsapi_ticket" string="JSAPI Ticket">
  161. <p class="text-info">
  162. Normally, the app's jsapi_ticket is valid for 7200 seconds and is obtained by access_token. Since the number of API calls to get jsapi_ticket is very limited (each application cannot exceed 100 times in an hour), frequent refresh jsapi_ticket will cause the API call to be limited, affecting their own business, and developers must globally cache the jsapi_ticket of the application in their own services.
  163. </p>
  164. <div class="o_row">
  165. <label for="jsapi_ticket"/>
  166. <field name="jsapi_ticket" widget="CopyClipboardText" force_save="1" class="w-100"/>
  167. </div>
  168. <div class="o_row">
  169. <label for="jsapi_ticket_expiration_time"/>
  170. <field name="jsapi_ticket_expiration_time" force_save="1" />
  171. </div>
  172. </page>
  173. <page name="parameter" string="Parameter">
  174. <form>
  175. <field name="app_config_ids" widget="one2many_config" mode="tree" help="description" nolabel="1" t-translation="off">
  176. <tree create="0" edit="1" delete="0" nolabel="1" editable="bottom">
  177. <field name="name" readonly="1"/>
  178. <field name="key" readonly="1"/>
  179. <field name="value" force_save="1" need_format="true" required="1"/>
  180. <field name="description" invisible="1" />
  181. </tree>
  182. </field>
  183. <div class="btn-group float-right" role="group" aria-label="Button group">
  184. <button class="oe_highlight" name="generate_parameters" string="Generate parameters" type="object" icon="fa-cogs"/>
  185. </div>
  186. </form>
  187. </page>
  188. <page name="callback" string="Callback service settings">
  189. <form>
  190. <field name="app_callback_service_ids" options="{'no_open': True, 'no_create': True}" widget="one2many_config" mode="tree" help="description" nolabel="1" t-translation="off">
  191. <tree create="0" edit="1" delete="0" nolabel="1" editable="bottom">
  192. <field name="name" readonly="1" />
  193. <field name="callback_url" readonly="1" widget="CopyClipboardChar"/>
  194. <field name="callback_url_token" required="1"/>
  195. <field name="callback_aeskey" required="1"/>
  196. <field name="active" widget="boolean_toggle"/>
  197. <field name="description" invisible="1"/>
  198. </tree>
  199. </field>
  200. <div class="btn-group float-right" role="group" aria-label="Button group">
  201. <button class="oe_highlight" name="generate_service" string="Generate service" type="object" icon="fa-server" />
  202. </div>
  203. </form>
  204. <hr></hr>
  205. <h3>Setting method</h3>
  206. <ul class="text-info">
  207. <li class="text-danger">
  208. <b>Controller:</b> Make sure the "Callback Service Name" exists in your controller code.
  209. </li>
  210. <li>
  211. <b>Callback URL:</b> Copy the automatically generated callback URL to the URL in the "event receiving server" of the enterprise wechat application.
  212. </li>
  213. <li>
  214. <b>Callback URL Token:</b> Copy the randomly generated "Token" in the "event receiving server" of the enterprise wechat application to the "callback URL token" input box of the current page.
  215. </li>
  216. <li>
  217. <b>Callback AES Key:</b> Copy the randomly generated "EncodingAESKey" in the "event receiving server" of the enterprise wechat application to the "callback AES key" input box on the current page.
  218. </li>
  219. <li class="text-danger">
  220. <b>Change:</b> When the value of "receiving event server" of the current page and enterprise wechat application changes, please ensure that the values at both ends are consistent.
  221. </li>
  222. </ul>
  223. </page>
  224. </notebook>
  225. </sheet>
  226. </form>
  227. </field>
  228. </record>
  229. <record id="view_wecom_apps_tree" model="ir.ui.view">
  230. <field name="name">wecom.apps.tree</field>
  231. <field name="model">wecom.apps</field>
  232. <field name="arch" type="xml">
  233. <tree expand="1" sample="1">
  234. <!-- <field name="display_name" /> -->
  235. <field name="name" />
  236. <field name="company_id" />
  237. <!-- <field name="type" /> -->
  238. <field name="agentid" widget="integer" options="{'format': false}" />
  239. <field name="close"/>
  240. </tree>
  241. </field>
  242. </record>
  243. <record id="action_view_wecom_apps_list" model="ir.actions.act_window">
  244. <field name="name">Application</field>
  245. <field name="res_model">wecom.apps</field>
  246. <field name="view_mode">kanban,tree,form</field>
  247. <field name="context">{'group_by':['company_id']}</field>
  248. <field name="search_view_id" ref="view_wecom_apps_filter"/>
  249. <field name="help" type="html">
  250. <p class="o_view_nocontent_smiling_face"></p>
  251. </field>
  252. </record>
  253. </data>
  254. </odoo>
上海开阖软件有限公司 沪ICP备12045867号-1