|
- <?xml version="1.0" encoding="UTF-8"?>
- <odoo>
- <data>
- <record id="view_wecom_apps_filter" model="ir.ui.view">
- <field name="name">wecom.apps.search</field>
- <field name="model">wecom.apps</field>
- <field name="arch" type="xml">
- <search>
- <field name="name" />
- <!-- <field name="company_id"/> -->
- <group expand="0" string="Group By">
- <filter name="group_company" string="Company" domain="[]" context="{'group_by': 'company_id'}"/>
- </group>
- </search>
-
- </field>
- </record>
-
- <record id="view_wecom_apps_kanban" model="ir.ui.view">
- <field name="name">wecom.apps.kanban</field>
- <field name="model">wecom.apps</field>
- <field name="arch" type="xml">
- <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">
- <field name="app_name"/>
- <field name="company_id"/>
- <field name="square_logo_url"/>
- <field name="close"/>
- <templates>
- <!-- class="o_kanban_image_fill_left" -->
- <t t-name="kanban-box">
- <div class="oe_kanban_global_click">
- <div class="o_kanban_image">
- <field name="square_logo_url" widget="image_url" options='{"size": [60, 60]}'/>
- </div>
- <div class="oe_kanban_details">
- <ul>
- <li class="text-success float-end mb4" t-if="!record.close.raw_value">
- <i class="fa fa-circle" role="img" aria-label="Enable" title="Enable"></i>
- </li>
- <li class="text-danger float-end mb4" t-if="record.close.raw_value">
- <i class="fa fa-circle" role="img" aria-label="Disabled" title="Disabled"></i>
- </li>
- <li class="mb4">
- <strong>
- <field name="app_name"/>
- </strong>
- </li>
- <li class="float-end mb4">
- <field name="type" widget="badge" decoration-success="type == 'manage'" decoration-info="type == 'base'" decoration-warning="type == 'self'" decoration-secondary="type == 'third'"/>
- </li>
- <li class="mb4">
- <strong>
- <field name="agentid" widget="integer" options="{'format': false}"/>
- </strong>
- </li>
- <li class="mb4">
- <field name="description" class="text-muted"/>
- </li>
- </ul>
- </div>
- </div>
- </t>
- </templates>
- </kanban>
- </field>
- </record>
-
- <record id="view_wecom_apps_form" model="ir.ui.view">
- <field name="name">wecom.apps.form</field>
- <field name="model">wecom.apps</field>
- <field name="arch" type="xml">
- <!-- js_class="wecom_apps_form" -->
- <form >
- <header></header>
- <sheet>
- <div name="button_box" class="oe_button_box">
- <button class="oe_stat_button" name="get_app_info" string="Get application" type="object" icon="fa-cloud-download" attrs="{'invisible': ['|',('agentid','=',0),('type','=','manage')]}"/>
- <!-- <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'),]}"/> -->
- <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')]}"/>
- <!-- <button class="oe_stat_button" name="get_type_code" string="Get Type Code" type="object" icon="fa-key" /> -->
- <button class="oe_stat_button" name="get_app_jsapi_ticket" string="Get JSAPI Ticket" type="object" icon="fa-ticket" attrs="{'invisible': [('company_id','=', False)]}"/>
- </div>
-
- <field name="square_logo_url" widget="image_url" options='{"size": [80, 80]}' class="oe_right"/>
- <div class="oe_title">
- <label for="app_name" class="oe_edit_only"/>
- <h1>
- <field name="app_name" attrs="{'readonly': [('type','=','manage')]}" />
- </h1>
- <!-- <group>
- <field name="model_ids" widget="many2many_tags" options="{'no_create': True}"/>
- </group> -->
- </div>
- <group>
- <group>
- <field name="company_id" widget="selection" required="1"/>
- </group>
- <group>
- <field name="close" attrs="{'readonly': ['|',('type','=','manage'),('type', '=', 'base')]}"/>
- </group>
- </group>
- <group>
- <group>
- <field name="type" required="1"/>
- <field name="type_id" readonly="1" invisible="1" force_save="1" />
- <field name="subtype_ids" required="1" widget="many2many_checkboxes" domain="[('parent_id', '=', type_id)]"/>
- </group>
- <!-- many2many_checkboxes many2many_tags-->
- <group>
- <field name="type_code" force_save="1" readonly="1"/>
- </group>
- </group>
- <group>
- <field name="description" attrs="{'readonly': ['|',('type','=','manage'),('type', '=', 'base')]}"/>
- </group>
-
- <group>
- <group>
- <field name="agentid" widget="integer" options="{'format': false}" attrs="{'readonly': [('type','=','manage')]}"/>
- </group>
- <group>
- <field name="secret" widget="DisplayPasswordChar" require_encryption="True"/>
- </group>
- </group>
- <group>
- <field name="allow_userinfos" attrs="{'readonly': [('type','=','manage')]}"/>
- <field name="allow_partys" attrs="{'readonly': [('type','=','manage')]}"/>
- <field name="allow_tags" attrs="{'readonly': [('type','=','manage')]}"/>
- </group>
- <notebook>
- <page name="option" string="Option" attrs="{'invisible': [('type','!=','self')]}">
- <group>
- <group>
- <field name="report_location_flag"/>
- <field name="isreportenter"/>
- </group>
- <group>
- <field name="redirect_domain"/>
- <field name="home_url"/>
- </group>
- </group>
- </page>
- <page name="access_token" string="Access Token">
- <p class="text-info">
- 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.
- </p>
- <p class="text-info">
- Therefore, developers should identify the source of the issuance of access_token and use the correct access_token before using the business interface.
- </p>
- <p class="text-info">
- 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
- </p>
- <p class="text-warning">
- 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.
- </p>
- <div class="o_row">
- <label for="access_token"/>
- <field name="access_token" widget="CopyClipboardText" force_save="1"/>
- </div>
- <div class="o_row">
- <label for="token_expiration_time"/>
- <field name="token_expiration_time" force_save="1"/>
- </div>
- </page>
- <page name="jsapi_ticket" string="JSAPI Ticket">
- <p class="text-info">
- 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.
- </p>
-
- <div class="o_row">
- <label for="jsapi_ticket"/>
- <field name="jsapi_ticket" widget="CopyClipboardText" force_save="1" class="w-100"/>
- </div>
- <div class="o_row">
- <label for="jsapi_ticket_expiration_time"/>
- <field name="jsapi_ticket_expiration_time" force_save="1" />
- </div>
- </page>
- <page name="parameter" string="Parameter">
- <form>
- <field name="app_config_ids" widget="one2many_config" mode="tree" help="description" nolabel="1" t-translation="off">
- <tree create="0" edit="1" delete="0" nolabel="1" editable="bottom">
- <field name="name" readonly="1"/>
- <field name="key" readonly="1"/>
- <field name="value" force_save="1" need_format="true" required="1"/>
- <field name="description" invisible="1" />
- </tree>
- </field>
- <div class="btn-group float-right" role="group" aria-label="Button group">
- <button class="oe_highlight" name="generate_parameters" string="Generate parameters" type="object" icon="fa-cogs"/>
- </div>
- </form>
- </page>
- <page name="callback" string="Callback service settings">
- <form>
- <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">
- <tree create="0" edit="1" delete="0" nolabel="1" editable="bottom">
- <field name="name" readonly="1" />
- <field name="callback_url" readonly="1" widget="CopyClipboardChar"/>
- <field name="callback_url_token" required="1"/>
- <field name="callback_aeskey" required="1"/>
- <field name="active" widget="boolean_toggle"/>
- <field name="description" invisible="1"/>
- </tree>
- </field>
- <div class="btn-group float-right" role="group" aria-label="Button group">
- <button class="oe_highlight" name="generate_service" string="Generate service" type="object" icon="fa-server" />
- </div>
- </form>
- <hr></hr>
- <h3>Setting method</h3>
- <ul class="text-info">
- <li class="text-danger">
- <b>Controller:</b> Make sure the "Callback Service Name" exists in your controller code.
- </li>
- <li>
- <b>Callback URL:</b> Copy the automatically generated callback URL to the URL in the "event receiving server" of the enterprise wechat application.
- </li>
- <li>
- <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.
- </li>
- <li>
- <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.
- </li>
- <li class="text-danger">
- <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.
- </li>
- </ul>
- </page>
- </notebook>
- </sheet>
- </form>
- </field>
- </record>
-
- <record id="view_wecom_apps_tree" model="ir.ui.view">
- <field name="name">wecom.apps.tree</field>
- <field name="model">wecom.apps</field>
- <field name="arch" type="xml">
- <tree expand="1" sample="1">
- <!-- <field name="display_name" /> -->
- <field name="name" />
- <field name="company_id" />
- <!-- <field name="type" /> -->
- <field name="agentid" widget="integer" options="{'format': false}" />
- <field name="close"/>
- </tree>
- </field>
- </record>
-
-
-
- <record id="action_view_wecom_apps_list" model="ir.actions.act_window">
- <field name="name">Application</field>
- <field name="res_model">wecom.apps</field>
- <field name="view_mode">kanban,tree,form</field>
- <field name="context">{'group_by':['company_id']}</field>
- <field name="search_view_id" ref="view_wecom_apps_filter"/>
- <field name="help" type="html">
- <p class="o_view_nocontent_smiling_face"></p>
- </field>
- </record>
- </data>
- </odoo>
|