diff --git a/wecom_auth_oauth/__manifest__.py b/wecom_auth_oauth/__manifest__.py
index 75b826eb..4d5b4115 100644
--- a/wecom_auth_oauth/__manifest__.py
+++ b/wecom_auth_oauth/__manifest__.py
@@ -20,10 +20,8 @@
"data/wecom_apps_data.xml",
"data/wecom_app_config_data.xml",
"data/wecom_oauth_data.xml",
- # "data/auth_signup_data.xml",
"views/assets_templates.xml",
"views/res_config_settings_views.xml",
- "views/res_users_views.xml",
"views/wecom_apps_views.xml",
"views/menu_views.xml",
],
diff --git a/wecom_auth_oauth/models/res_users.py b/wecom_auth_oauth/models/res_users.py
index 6cea0b91..d0b2c990 100644
--- a/wecom_auth_oauth/models/res_users.py
+++ b/wecom_auth_oauth/models/res_users.py
@@ -1,23 +1,9 @@
# -*- coding: utf-8 -*-
-import logging
-import json
-import requests
-
-from collections import defaultdict
-from dateutil.relativedelta import relativedelta
-from odoo import models, fields, api, _
-from odoo.exceptions import UserError
-from odoo.addons.base.models.ir_mail_server import MailDeliveryException
-from odoo.addons.auth_signup.models.res_partner import SignupError, now
+from odoo import models, api, _
from odoo.exceptions import AccessDenied
-_logger = logging.getLogger(__name__)
-
-from odoo.http import request
-
-
class ResUsers(models.Model):
_inherit = "res.users"
@@ -71,137 +57,3 @@ def _check_credentials(self, password, env):
if not res:
raise
- # ---------------------
- # 发送消息
- # ---------------------
- def action_reset_password(self):
- """
- 为每个用户创建注册令牌,并通过电子邮件发送他们的注册url
- 增加判断模板对象为企业微信用户,使用企业微信发送模板消息的方法
- """
- if self.env.context.get("install_mode", False):
- return
- if self.filtered(lambda user: not user.active):
- raise UserError(_("You cannot perform this action on an archived user."))
- # prepare reset password signup
- create_mode = bool(self.env.context.get("create_user"))
-
- # no time limit for initial invitation, only for reset password
- expiration = False if create_mode else now(days=+1)
-
- self.mapped("partner_id").signup_prepare(
- signup_type="reset", expiration=expiration
- )
-
- # send email to users with their signup url
- template = False
- if create_mode:
- try:
- template = self.env.ref(
- "auth_signup.set_password_email", raise_if_not_found=False
- )
- except ValueError:
- pass
- if not template:
- template = self.env.ref("auth_signup.reset_password_email")
- assert template._name == "mail.template"
- template_values = {
- "email_to": "${object.email|safe}",
- "email_cc": False,
- "auto_delete": True,
- "partner_to": False,
- "scheduled_date": False,
- }
- template.write(template_values)
- for user in self:
- if user.wecom_userid:
- return self.action_reset_password_by_wecom(user, create_mode)
- elif not user.email:
- raise UserError(
- _("Cannot send email: user %s has no email address.", user.name)
- )
- # TDE FIXME: make this template technical (qweb)
- with self.env.cr.savepoint():
- force_send = not (self.env.context.get("import_file", False))
- template.send_mail(user.id, force_send=force_send, raise_exception=True)
- _logger.info(
- "Password reset email sent for user <%s> to <%s>",
- user.login,
- user.email,
- )
- return super(ResUsers, self).action_reset_password()
-
- def action_reset_password_by_wecom(self, user, create_mode):
- """
- 通过企业微信的方式发送模板消息
- """
- create_mode = bool(self.env.context.get("create_user"))
- if create_mode:
- template = self.env.ref("wecom_auth_oauth.set_password_message")
- else:
- template = self.env.ref("wecom_auth_oauth.reset_password_message")
- assert template._name == "wecom.message.template"
- template_values = {
- "message_to_user": "${object.wecom_userid|safe}",
- "auto_delete": True,
- "partner_to": False,
- "scheduled_date": False,
- }
- template.write(template_values)
- with self.env.cr.savepoint():
- force_send = not (self.env.context.get("import_file", False))
- template.send_message(
- user.id, force_send=force_send, raise_exception=True,
- )
- _logger.info(
- _("Password reset message sent to user: <%s>,<%s>, <%s>"),
- user.name,
- user.login,
- user.wecom_userid,
- )
-
- def send_unregistered_user_reminder(self, after_days=5):
- """
- 发送未注册的用户提醒 消息
- """
- datetime_min = fields.Datetime.today() - relativedelta(days=after_days)
- datetime_max = datetime_min + relativedelta(hours=23, minutes=59, seconds=59)
-
- res_users_with_details = self.env["res.users"].search_read(
- [
- ("share", "=", False),
- ("create_uid.email", "!=", False),
- ("create_date", ">=", datetime_min),
- ("create_date", "<=", datetime_max),
- ("log_ids", "=", False),
- ],
- ["create_uid", "name", "login"],
- )
-
- # 分组邀请
- invited_users = defaultdict(list)
- for user in res_users_with_details:
- invited_users[user.get("create_uid")[0]].append(
- "%s (%s)" % (user.get("name"), user.get("login"))
- )
-
- # 用于向所有邀请者发送有关其邀请用户的邮件
- for user in invited_users:
- if user.wecom_userid:
- return self.send_unregistered_user_reminder_by_wecom(
- user, invited_users
- )
- template = self.env.ref(
- "auth_signup.mail_template_data_unregistered_users"
- ).with_context(dbname=self._cr.dbname, invited_users=invited_users[user])
- template.send_mail(
- user, notif_layout="mail.mail_notification_light", force_send=False
- )
-
- def send_unregistered_user_reminder_by_wecom(self, user, invited_users):
- message_template = self.env.ref(
- "wecom_auth_oauth.message_template_data_unregistered_users"
- ).with_context(dbname=self._cr.dbname, invited_users=invited_users[user])
- message_template.send_message(
- user, notif_layout="mail.mail_notification_light", force_send=False
- )
diff --git a/wecom_auth_oauth/views/res_users_views.xml b/wecom_auth_oauth/views/res_users_views.xml
deleted file mode 100644
index 85828fbb..00000000
--- a/wecom_auth_oauth/views/res_users_views.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
- res.users.form.inherit
- res.users
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/wecom_contacts/__init__.py b/wecom_contacts/__init__.py
new file mode 100644
index 00000000..16f33706
--- /dev/null
+++ b/wecom_contacts/__init__.py
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+
+
+# from . import controllers
+# from . import models
+# from . import wizard
diff --git a/wecom_contacts/__manifest__.py b/wecom_contacts/__manifest__.py
new file mode 100644
index 00000000..eb5f5c25
--- /dev/null
+++ b/wecom_contacts/__manifest__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+{
+ "name": "WeCom Contacts",
+ "author": "RStudio",
+ "website": "https://gitee.com/rainbowstudio/wecom",
+ "sequence": 607,
+ "installable": True,
+ "application": True,
+ "auto_install": False,
+ "category": "WeCom/WeCom",
+ "version": "14.0.0.1",
+ "summary": """
+ WeCom Contacts
+ """,
+ "description": """
+
+
+ """,
+ "depends": ["wecom_message",],
+ "external_dependencies": {"python": [],},
+ "qweb": ["static/src/xml/*.xml",],
+}
diff --git a/wecom_contacts/static/description/icon.png b/wecom_contacts/static/description/icon.png
new file mode 100644
index 00000000..90ed3eee
Binary files /dev/null and b/wecom_contacts/static/description/icon.png differ
diff --git a/wecom_message/__manifest__.py b/wecom_message/__manifest__.py
index 798169d9..bc5357a4 100644
--- a/wecom_message/__manifest__.py
+++ b/wecom_message/__manifest__.py
@@ -5,7 +5,7 @@
"website": "https://gitee.com/rainbowstudio/wecom",
"sequence": 605,
"installable": True,
- "application": False,
+ "application": True,
"auto_install": False,
"category": "WeCom/WeCom",
"version": "14.0.0.1",
@@ -20,22 +20,23 @@
"mail",
# "digest",
"rating",
- "wecom_base",
"wecom_widget",
"wecom_material",
+ "wecom_auth_oauth",
],
"external_dependencies": {"python": ["html2text", "lxml"],},
"data": [
"security/ir.model.access.csv",
"data/wecom_apps_data.xml",
- "data/message_template_data.xml",
+ "data/auth_signup_data.xml",
+ # "data/message_template_data.xml",
# "wizard/mail_template_preview_views.xml",
"views/assets_templates.xml",
# "views/mail_message_views.xml",
- # "views/res_company_views.xml",
+ "views/res_users_views.xml",
"views/res_config_settings_views.xml",
- "views/wecom_message_template_views.xml",
- "views/wecom_message_message_views.xml",
+ "views/mail_template_views.xml",
+ # "views/wecom_message_message_views.xml",
# "views/wecom_apps_views.xml",
# "views/wecom_message_notification_views.xml",
"views/menu.xml",
diff --git a/wecom_message/data/auth_signup_data.xml b/wecom_message/data/auth_signup_data.xml
new file mode 100644
index 00000000..6bbf3cbb
--- /dev/null
+++ b/wecom_message/data/auth_signup_data.xml
@@ -0,0 +1,96 @@
+
+
+
+
+
+ template_card
+
+ ${object.wecom_userid | safe}
+ {
+ "card_type": "news_notice",
+ "source": {
+ "icon_url": "${object.get_base_url()}/wecom_message_logo.png?company=${object.company_id.id}",
+ "desc": "${object.company_id.name}"
+ },
+ "main_title": {
+ "title": "Dear ${object.name},",
+ "desc": "You requested a password reset"
+ },
+ "card_image": {
+ "url": "${object.get_base_url()}/wecom_material/static/src/img/reset_password.png",
+ "aspect_ratio": 2.25
+ },
+ "vertical_content_list": [
+ {
+ "title": "If no modification is required,ignore.",
+ "desc": "You may change your password by following this link which will remain valid during 24 hours."
+ }
+ ],
+ "horizontal_content_list": [
+ {
+ "keyname": "Sender",
+ "value": "${object.create_uid.name}"
+ },
+ {
+ "type": 1,
+ "keyname": "Change Password",
+ "value": "Click Modify",
+ "url": "${object.signup_url}"
+ }
+ ],
+ "jump_list": [
+ {
+ "type": 1,
+ "title": "Change Password",
+ "url": "${object.signup_url}"
+ }
+ ],
+ "card_action": {
+ "type": 1,
+ "url": "${object.signup_url}",
+ "appid": "",
+ "pagepath": ""
+ }
+}
+
+ 1
+
+
+ 1800
+
+
+
+
+ markdown
+
+ ${object.wecom_userid | safe}
+ ## Dear ${object.name},
+Hello! First of all, please allow me to welcome you on behalf of our company. This is an invitation message from ${object.create_uid.name} of ${object.company_id.name} to open your system account. Please click:
+> [Accept invitation](${object.signup_url})
+% set website_url = object.env['ir.config_parameter'].sudo().get_param('web.base.url')
+> The system login address is: [${website_url}](${website_url})
+> Your login account is: [${object.login}](${website_url}/web/login?login=${object.login})
+#### The loyalty of our company is strict, innovative and honest. Your participation will bring us fresh blood, bring forth new thinking and set up a good corporate image for us.
+#### I wish you a happy job in our company and realize your life value!
+## ${object.company_id.name}
+<font color=\"comment"\>Telephone:${object.company_id.phone} </font>
+% if object.company_id.email
+<font color=\"comment"\>E-mail:${object.company_id.email}</font>
+% endif
+% if object.company_id.website
+<font color=\"comment"\>Website:${object.company_id.website}</font>
+% endif
+ 1
+
+
+ 1800
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wecom_message/i18n/zh_CN.po b/wecom_message/i18n/zh_CN.po
index 8b877e98..bae6ad92 100644
--- a/wecom_message/i18n/zh_CN.po
+++ b/wecom_message/i18n/zh_CN.po
@@ -6,20 +6,42 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-12-06 07:47+0000\n"
-"PO-Revision-Date: 2021-12-06 15:53+0800\n"
+"POT-Creation-Date: 2022-01-30 10:52+0000\n"
+"PO-Revision-Date: 2022-01-30 19:09+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
+"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
-"Language: zh_CN\n"
-"X-Generator: Poedit 3.0\n"
+"X-Generator: Poedit 3.0.1\n"
#. module: wecom_message
-#: code:addons/wecom_message/models/wecom_mail_thread.py:0
-#: code:addons/wxwork/wecom_message/models/wecom_mail_thread.py:0
+#: code:addons/wecom/wecom_message/models/wecom_apps.py:0 code:addons/wecom_message/models/wecom_apps.py:0
+#, python-format
+msgid ""
+"\n"
+"In order to enable two-way communication between self built applications and enterprise wechat, enterprises can turn on the message receiving mode in the application management background.
\n"
+"\n"
+"Enterprises that enable the message receiving mode need to provide the available message receiving server URL (HTTPS is recommended).
\n"
+"\n"
+"After the receive message mode is enabled, the messages sent by users in the application will be pushed to the enterprise background. In addition, event messages such as geographical location reporting can also be "
+"configured. When the event is triggered, the enterprise wechat will push the corresponding data to the background of the enterprise.
\n"
+"\n"
+"After receiving the message, the enterprise background can bring a new message in the response package to reply to the message request, and the enterprise wechat will push the passive reply message to the user.
"
+msgstr ""
+"\n"
+"为了实现自建应用与企业微信的双向沟通,企业可以在应用管理后台开启消息接收模式。
\n"
+"\n"
+"启用消息接收模式的企业需要提供可用的消息接收服务器URL(建议使用HTTPS)。
\n"
+"\n"
+"启用接收消息模式后,应用程序中用户发送的消息将推送到企业后台。此外,还可以配置事件消息,例如地理位置报告。事件触发时,企业微信会将相应数据推送到企业后台。
\n"
+"\n"
+"当企业后台收到推送过来的普通消息或事件消息后,可以在响应里带上被动回复消息
"
+
+#. module: wecom_message
+#: code:addons/wecom/wecom_message/models/wecom_mail_thread.py:0 code:addons/wecom_message/models/wecom_mail_thread.py:0
#, python-format
msgid ""
"### %s sent you a message,You can also view it in your inbox in the system.\n"
@@ -35,57 +57,34 @@ msgstr ""
"> %s"
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.view_company_form
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
-msgid "
"
-msgstr "
"
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
+msgid "${object.partner_id.lang}"
+msgstr ""
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.view_company_form
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
msgid ""
msgstr ""
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.view_company_form
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
msgid ""
msgstr ""
#. module: wecom_message
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
-msgid ""
-"\n"
-" \n"
-" WeCom Message\n"
-" \n"
-" "
-msgstr ""
-"\n"
-" \n"
-" 企微消息\n"
-" \n"
-" "
+msgid ""
+msgstr ""
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.view_company_form
-msgid ""
-"\n"
-" \n"
-" WeCom Message\n"
-" "
-msgstr ""
-"\n"
-" \n"
-" 企微消息\n"
-" "
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
+msgid ""
+msgstr ""
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_form
-msgid "API Response"
-msgstr "API响应"
+#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__message_access_token
+msgid "Access Token"
+msgstr "访问令牌"
#. module: wecom_message
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
@@ -93,80 +92,41 @@ msgid "Advanced Settings"
msgstr "高级设置"
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.view_company_form
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
-msgid ""
-"Application Management→Application→Open the application that needs to be verified and authorized, copy "
-"'AgentId'"
-msgstr "应用程序管理→应用→打开需要验证和授权的应用程序,复制“AgentId”"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.view_company_form
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
-msgid ""
-"Application Management→Application→Open the application that needs to be verified and authorized, copy 'Secret'"
-msgstr "应用程序管理→应用→打开需要验证和授权的应用程序,复制“Secret”"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__model_id
-msgid "Applied to"
-msgstr "应用于"
+#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__message_agentid
+msgid "Agent ID"
+msgstr "应用Id"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__author_id
-msgid "Author"
-msgstr "作者"
+#: model:ir.model.fields,field_description:wecom_message.field_res_company__message_app_id model:ir.model.fields,field_description:wecom_message.field_res_config_settings__message_app_id
+msgid "Application"
+msgstr "应用"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__author_id
-msgid ""
-"Author of the message. If not set, meaasge_from may hold an message wecom user id that did not match any "
-"partner."
-msgstr "消息的作者。如果没设置,meaasge_from 可能保存一个不匹配任何合作伙伴的企业微信用户Id。"
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
+msgid "Application Management→Application→Open the application that needs to be verified and authorized, copy 'AgentId'"
+msgstr "应用程序管理→应用→打开需要验证和授权的应用程序,复制“AgentId”"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__author_avatar
-msgid "Author's avatar"
-msgstr "作者头像"
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
+msgid "Application Management→Application→Open the application that needs to be verified and authorized, copy 'Secret'"
+msgstr "应用程序管理→应用→打开需要验证和授权的应用程序,复制“Secret”"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__auto_delete
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__auto_delete
-msgid "Auto Delete"
-msgstr "自动删除"
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
+msgid "Binding application"
+msgstr "绑定应用"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__state__cancel
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_notification__notification_status__cancel
-msgid "Cancelled"
-msgstr "已取消"
+#: code:addons/wecom/wecom_message/models/res_users.py:0 code:addons/wecom_message/models/res_users.py:0
+#, python-format
+msgid "Cannot send email: user %s has no email address."
+msgstr "无法发送邮件:用户 %s 邮件地址为空。"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__safe__1
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__safe__1
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__safe__1
msgid "Cannot share and content shows watermark"
msgstr "不能分享且内容显示水印"
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__channel_ids
-msgid "Channels"
-msgstr "频道"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__code
-msgid "Code"
-msgstr "代码"
-
-#. module: wecom_message
-#: model:ir.model.constraint,message:wecom_message.constraint_wecom_message_template_code_uniq
-msgid "Code must be unique !"
-msgstr "代码必须是唯一的!"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__message_type__comment
-msgid "Comment Message"
-msgstr "备注消息"
-
#. module: wecom_message
#: model:ir.model,name:wecom_message.model_res_company
msgid "Companies"
@@ -184,621 +144,256 @@ msgstr "配置设置"
#. module: wecom_message
#. openerp-web
-#: code:addons/wecom_message/static/src/js/copy_button.js:0
-#: code:addons/wxwork/wecom_message/static/src/js/copy_button.js:0
+#: code:addons/wecom/wecom_message/static/src/js/copy_button.js:0 code:addons/wecom_message/static/src/js/copy_button.js:0
#, python-format
msgid "Copy One-click copy of email template succeeded!"
msgstr "一键复制邮件模板成功!"
#. module: wecom_message
#. openerp-web
-#: code:addons/wecom_message/static/src/js/copy_button.js:0
-#: code:addons/wxwork/wecom_message/static/src/js/copy_button.js:0
+#: code:addons/wecom/wecom_message/static/src/js/copy_button.js:0 code:addons/wecom_message/static/src/js/copy_button.js:0
#, python-format
msgid "Copy successfully!"
msgstr "复制成功!"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__create_uid
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__create_uid
-msgid "Created by"
-msgstr "创建者"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__create_date
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__create_date
-msgid "Created on"
-msgstr "创建时间"
-
-#. module: wecom_message
-#: model:ir.model.constraint,message:wecom_message.constraint_wecom_message_message_res_partner_needaction_rel_notification_partner_required
-msgid "Customer is required for inbox / email notification"
-msgstr "客户需要收件箱/电子邮件通知"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__date
-msgid "Date"
-msgstr "日期时间"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__null_value
-msgid "Default Value"
-msgstr "默认值"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__use_default_to
-msgid "Default recipients"
-msgstr "默认收件人"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__use_default_to
-msgid ""
-"Default recipients of the record:\n"
-"- partner (using id on a partner or the partner_id field) OR\n"
-"- message (using sender or wecom_userid field)"
-msgstr ""
-"记录的默认收件人: \n"
-"- 合作伙伴(使用合作伙伴的企业微信用户Id或partner_id字段)或\n"
-"- 消息(使用发件人或wecom_userid字段)"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
-msgid ""
-"Department ID list. Multiple recipients are separated by '|', with a maximum of 100 supported.This parameter "
-"is ignored when 'To Users' is '@ all'"
-msgstr "部门ID列表,多个接收者用‘|’分隔,最多支持100个。当\"发送到用户\"为”@all”时忽略本参数"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_mail_thread__display_name
-#: model:ir.model.fields,field_description:wecom_message.field_res_company__display_name
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__display_name
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__display_name
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification__display_name
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__display_name
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__display_name model:ir.model.fields,field_description:wecom_message.field_res_company__display_name
+#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__display_name model:ir.model.fields,field_description:wecom_message.field_res_users__display_name
+#: model:ir.model.fields,field_description:wecom_message.field_wecom_apps__display_name
msgid "Display Name"
msgstr "显示名称"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_notification__notification_type__email
-msgid "Email"
-msgstr "Email"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__message_type__email
-msgid "Email Message"
-msgstr "邮件消息"
-
-#. module: wecom_message
-#: model:ir.model,name:wecom_message.model_mail_thread
-msgid "Email Thread"
-msgstr "邮件主题"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__is_internal
-msgid "Employee Only"
-msgstr "员工专用"
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
+msgid "Dynamic Placeholder Generator"
+msgstr "动态定位符生成器"
#. module: wecom_message
-#: code:addons/wecom_message/models/wecom_message_api.py:0
-#: code:addons/wxwork/wecom_message/models/wecom_message_api.py:0
+#: code:addons/wecom/wecom_message/models/wecom_message_api.py:0 code:addons/wecom_message/models/wecom_message_api.py:0
#, python-format
msgid "Error sending message: %s"
msgstr "发送消息时出错:%s"
#. module: wecom_message
-#: code:addons/wecom_message/models/mail_mail.py:0 code:addons/wxwork/wecom_message/models/mail_mail.py:0
+#: code:addons/wecom/wecom_message/models/mail_mail.py:0 code:addons/wecom_message/models/mail_mail.py:0
#, python-format
-msgid ""
-"Error without exception. Probably due do concurrent access update of notification records. Please see with an "
-"administrator."
+msgid "Error without exception. Probably due do concurrent access update of notification records. Please see with an administrator."
msgstr "错误没有例外。可能由于并发访问更新通知记录。请与管理员联系。"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__failure_reason
-msgid "Failure Reason"
-msgstr "失败原因"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification__failure_reason
-msgid "Failure reason"
-msgstr "失败原因"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__failure_reason
-msgid ""
-"Failure reason. This is usually the exception thrown by the wecom api, stored to ease the debugging of message "
-"issues."
-msgstr "失败原因。这通常是企业微信api引发的异常,存储该异常是为了简化消息问题的调试。"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__model_object_field
-msgid "Field"
-msgstr "字段"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__file
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__file
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__file
msgid "File message"
msgstr "文件消息"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__copyvalue
-msgid "Final placeholder expression, to be copy-pasted in the desired template field."
-msgstr "最终的占位符表达式,可以复制粘贴到目标模版字段。"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__meaasge_from
-msgid "From"
-msgstr "从"
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
+msgid "Generate service"
+msgstr "生成服务"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__news
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__news
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__news
msgid "Graphic message"
msgstr "图文消息"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__mpnews
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__mpnews
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__mpnews
msgid "Graphic message(mpnews)"
msgstr "图文消息(mpnews)"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__is_internal
-msgid "Hide to public / portal users, independently from subtype configuration."
-msgstr "对公共/门户用户隐藏,独立于子类型配置."
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__body_html
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__body_html
-msgid "Html Body"
-msgstr "Html正文"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_form
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
msgid "Html Content"
msgstr "Html内容"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_mail_thread__id
-#: model:ir.model.fields,field_description:wecom_message.field_res_company__id
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__id
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__id
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification__id
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__id
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__id model:ir.model.fields,field_description:wecom_message.field_res_company__id
+#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__id model:ir.model.fields,field_description:wecom_message.field_res_users__id
+#: model:ir.model.fields,field_description:wecom_message.field_wecom_apps__id
msgid "ID"
msgstr ""
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__scheduled_date
-msgid ""
-"If set, the queue manager will send the email after the date. If not set, the email will be send as soon as "
-"possible. Jinja2 placeholders may be used."
-msgstr ""
-"如果设置完毕,队列管理员将在指定日期之后发送EMail。如果未设置完毕,EMail将尽快发送。可以使用 Jinja2 占位符。"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__scheduled_date
+#: model:ir.model.fields,help:wecom_message.field_mail_template__safe
msgid ""
-"If set, the queue manager will send the message after the date. If not set, the message will be send as soon "
-"as possible."
-msgstr "如果设置,队列管理器将在日期之后发送消息。如果未设置,将立即发送消息。"
+"Indicates whether it is a confidential message, 0 indicates that it can be shared externally, 1 indicates that it cannot be shared and the content displays watermark, 2 indicates that it can only be shared within "
+"the enterprise, and the default is 0; Note that only messages of mpnews type support the safe value of 2, and other message types do not"
+msgstr "表示是否是保密消息,0表示可对外分享,1表示不能分享且内容显示水印,2表示仅限在企业内分享,默认为0;注意仅mpnews类型的消息支持safe值为2,其他消息类型不支持"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_notification__notification_type__inbox
-msgid "Inbox"
-msgstr "收件箱"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__safe
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__safe
-msgid ""
-"Indicates whether it is a confidential message, 0 indicates that it can be shared externally, 1 indicates that "
-"it cannot be shared and the content displays watermark, 2 indicates that it can only be shared within the "
-"enterprise, and the default is 0; Note that only messages of mpnews type support the safe value of 2, and "
-"other message types do not"
-msgstr ""
-"表示是否是保密消息,0表示可对外分享,1表示不能分享且内容显示水印,2表示仅限在企业内分享,默认为0;注意仅mpnews"
-"类型的消息支持safe值为2,其他消息类型不支持"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__duplicate_check_interval
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__duplicate_check_interval
-msgid ""
-"Indicates whether the message check is repeated. The default is 1800s and the maximum is no more than 4 hours"
+#: model:ir.model.fields,help:wecom_message.field_mail_template__duplicate_check_interval
+msgid "Indicates whether the message check is repeated. The default is 1800s and the maximum is no more than 4 hours"
msgstr "表示是否重复消息检查的时间间隔,默认1800s,最大不超过4小时"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__enable_id_trans
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__enable_id_trans
+#: model:ir.model.fields,help:wecom_message.field_mail_template__enable_id_trans
msgid "Indicates whether to enable ID translation, 0 indicates no, 1 indicates yes, and 0 is the default"
msgstr "表示是否开启id转译,0表示否,1表示是,默认0"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__enable_duplicate_check
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__enable_duplicate_check
+#: model:ir.model.fields,help:wecom_message.field_mail_template__enable_duplicate_check
msgid "Indicates whether to enable duplicate message checking. 0 indicates no, 1 indicates yes. The default is 0"
msgstr "表示是否开启重复消息检查,0表示否,1表示是,默认0"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__use_templates
-msgid "Is template message"
-msgstr "是模板消息"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.view_company_form
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
-msgid "It is used to display the company logo for WeCom messages."
-msgstr "它用于显示企微消息的公司徽标。"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__body_json
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__body_json
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__body_json
msgid "Json Body"
msgstr "Json正文"
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_form
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
msgid "Json Content"
msgstr "Json内容"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__module_digest
-msgid "KPI Digests"
-msgstr "KPI 摘要"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__lang
-msgid "Language"
-msgstr "语言"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_mail_thread____last_update
-#: model:ir.model.fields,field_description:wecom_message.field_res_company____last_update
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings____last_update
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message____last_update
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification____last_update
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template____last_update
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template____last_update model:ir.model.fields,field_description:wecom_message.field_res_company____last_update
+#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings____last_update model:ir.model.fields,field_description:wecom_message.field_res_users____last_update
+#: model:ir.model.fields,field_description:wecom_message.field_wecom_apps____last_update
msgid "Last Modified on"
msgstr "最后修改日"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__write_uid
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__write_uid
-msgid "Last Updated by"
-msgstr "最后更新者"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__write_date
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__write_date
-msgid "Last Updated on"
-msgstr "更新时间"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__body_markdown
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__body_markdown
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__body_markdown
msgid "Markdown Body"
msgstr "Markdown正文"
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_form
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
msgid "Markdown Content"
msgstr "Markdown内容"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__markdown
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__markdown
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__markdown
msgid "Markdown message"
msgstr "Markdown消息"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__media_id
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__media_id
+#: model:ir.model.fields,help:wecom_message.field_mail_template__media_id
msgid "Media file ID, which can be obtained by calling the upload temporary material interface"
msgstr "媒体文件Id,可以调用上传临时素材接口获取"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__media_id
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__media_id
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__media_id
msgid "Media file id"
msgstr "媒体文件Id"
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
-msgid ""
-"Member ID list (multiple recipients are separated by '|', and up to 1000 are supported).Special case: if @ all "
-"is specified, it will be sent to all members of the enterprise application."
-msgstr ""
-"成员ID列表(多个接收者用‘|’分隔,最多支持1000个)。特殊情况:指定为”@all”,则向该企业应用的全部成员发送。"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification__message_message_id
-#: model:ir.ui.menu,name:wecom_message.menu_wecom_message_message
-#: model:ir.ui.menu,name:wecom_message.menu_wecom_message_root
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_form
+#: model:ir.ui.menu,name:wecom_message.menu_wecom_message_root model:wecom.app.subtype,name:wecom_message.wecom_app_subtype_message
msgid "Message"
msgstr "消息"
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_company__message_agentid
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__message_agentid
-msgid "Message Agent Id"
-msgstr "消息应用Id"
-
#. module: wecom_message
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
-msgid "Message Configuration"
-msgstr "消息配置"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__record_name
-msgid "Message Record Name"
-msgstr "消息记录名称"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_company__message_secret
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__message_secret
-msgid "Message Secret"
-msgstr "消息密钥"
+msgid "Message Options"
+msgstr "消息选项"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__description
-msgid "Message description: either the subject, or the beginning of the body"
-msgstr "消息描述:主题或正文的开始部分"
+#: model:ir.actions.act_window,name:wecom_message.action_wecom_message_template_tree_all model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_tree
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
+msgid "Message Templates"
+msgstr "消息模板"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__message_to_party
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__message_to_party
+#: model:ir.model.fields,help:wecom_message.field_mail_template__message_to_party
msgid "Message recipients (departments)"
msgstr "消息接收人(部门)"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__message_to_tag
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__message_to_tag
+#: model:ir.model.fields,help:wecom_message.field_mail_template__message_to_tag
msgid "Message recipients (tags)"
msgstr "消息接收人(标签)"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__message_to_user
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__message_to_user
+#: model:ir.model.fields,help:wecom_message.field_mail_template__message_to_user
msgid "Message recipients (users)"
msgstr "消息接收人(用户)"
#. module: wecom_message
#. openerp-web
-#: code:addons/wecom_message/static/src/xml/anchor.xml:0
-#: code:addons/wxwork/wecom_message/static/src/xml/anchor.xml:0
+#: code:addons/wecom/wecom_message/static/src/xml/wecom_settings_navigation.xml:0 code:addons/wecom_message/static/src/xml/wecom_settings_navigation.xml:0
#, python-format
msgid "Message settings"
msgstr "消息设置"
#. module: wecom_message
-#: code:addons/wecom_message/models/mail_thread.py:0 code:addons/wxwork/wecom_message/models/mail_thread.py:0
+#: code:addons/wecom/wecom_message/models/mail_thread.py:0 code:addons/wecom_message/models/mail_thread.py:0
#, python-format
msgid "Message should be a valid EmailMessage instance"
msgstr "邮件应该是有效的EmailMessage实例"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__templates_id
-msgid "Message template"
-msgstr "消息模板"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__msgtype
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__msgtype
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__msgtype
msgid "Message type"
msgstr "消息类型"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__message_type
-msgid ""
-"Message type: email for email message, notification for system message, comment for other messages such as "
-"user replies"
-msgstr "消息类型:EMail用于 邮件消息, 通知用户系统消息,评论用于其他消息,例如用户回复。"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__msgid
-msgid "Message-Id"
-msgstr "消息ID"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_tree
-msgid "Messages"
-msgstr "消息"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__miniprogram
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__miniprogram
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__miniprogram
msgid "Mini Program Notification Message"
msgstr "小程序通知消息"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__model
-msgid "Model"
-msgstr "相关的单据模型"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__module_gamification
-msgid "Module Gamification"
-msgstr "游戏化模块"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__module_purchase
-msgid "Module Purchase"
-msgstr "采购模块"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__module_stock
-msgid "Module Stock"
-msgstr "库存模块"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__name
-msgid "Name"
-msgstr "名称"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__record_name
-msgid "Name get of the related document."
-msgstr "获得相关单据的名称。"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__needaction
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__needaction
-msgid "Need Action"
-msgstr "需要行动"
-
-#. module: wecom_message
-#: code:addons/wecom_message/wizard/mail_compose_message.py:0
-#: code:addons/wxwork/wecom_message/wizard/mail_compose_message.py:0
+#: code:addons/wecom/wecom_message/wizard/mail_compose_message.py:0 code:addons/wecom_message/wizard/mail_compose_message.py:0
#, python-format
msgid "No recipient found."
msgstr "没有找到收件人。"
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_notification_view_form
-msgid "Notification"
-msgstr "通知"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification__notification_type
-msgid "Notification Type"
-msgstr "通知类型"
-
-#. module: wecom_message
-#: model:ir.actions.act_window,name:wecom_message.wecom_message_notification_action
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__notification_ids
-#: model:ir.ui.menu,name:wecom_message.menu_wecom_message_notification
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_notification_view_tree
-msgid "Notifications"
-msgstr "通知"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__safe__2
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__safe__2
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__safe__2
msgid "Only share within the company "
-msgstr "仅限在企业内分享 "
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__lang
-msgid ""
-"Optional translation language (ISO code) to select when sending out an email. If not set, the english version "
-"will be used. This should usually be a placeholder expression that provides the appropriate language, e.g. "
-"${object.partner_id.lang}."
-msgstr ""
-"在发送邮件时可选择的语言代码(ISO 代码)。如果没有设置,会使用英文版本。一般用占位符来确定合适的语言,例如:"
-"${object.partner_id.lang.code}。"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__null_value
-msgid "Optional value to use if the target field is empty"
-msgstr "如果目标字段为空则使用此可选值"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_form
-msgid "Options"
-msgstr "选项"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
-msgid "Override author's WeCom User Id"
-msgstr "覆盖作者企业微信用户Id"
+msgstr "仅限在企业内分享"
#. module: wecom_message
-#: model:wecom.message.template,name:wecom_message.message_template_partner
-msgid "Partner Mass Message"
-msgstr "合作伙伴群发消息"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__notified_partner_ids
-msgid "Partners with Need Action"
-msgstr "需要行动的业务伙伴"
+#: code:addons/wecom/wecom_message/models/res_users.py:0 code:addons/wecom_message/models/res_users.py:0
+#, python-format
+msgid "Password reset message sent to user: <%s>,<%s>, <%s>"
+msgstr "发送给用户的密码重置消息:<%s>,<%s>,<%s>"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__image
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__image
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__image
msgid "Picture message"
msgstr "图片消息"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__copyvalue
-msgid "Placeholder Expression"
-msgstr "占位符表达式"
-
-#. module: wecom_message
-#: model_terms:ir.actions.act_window,help:wecom_message.action_wecom_message_template_tree_all
-msgid "Please add a template"
-msgstr "请添加模板"
-
-#. module: wecom_message
-#: code:addons/wecom_message/models/res_company.py:0 code:addons/wecom_message/models/res_config_settings.py:0
-#: code:addons/wxwork/wecom_message/models/res_company.py:0
-#: code:addons/wxwork/wecom_message/models/res_config_settings.py:0
+#: code:addons/wecom/wecom_message/models/res_config_settings.py:0 code:addons/wecom_message/models/res_config_settings.py:0
#, python-format
-msgid "Please upload a picture of the square!"
-msgstr "请上传方形的图片!"
+msgid "Please bind contact app!"
+msgstr ""
#. module: wecom_message
-#: code:addons/wecom_message/models/wecom_message_template.py:0
-#: code:addons/wxwork/wecom_message/models/wecom_message_template.py:0
+#: code:addons/wecom/wecom_message/models/wecom_message_template.py:0 code:addons/wecom_message/models/wecom_message_template.py:0
#, python-format
msgid "QWeb template %s not found when sending template %s. Sending without layouting."
msgstr "发送模板 %s 时找不到QWeb模板 %s。未进行布局发送。"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification__res_partner_id
-msgid "Recipient"
-msgstr "收件人"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__partner_ids
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_form
-msgid "Recipients"
-msgstr "收件人"
-
-#. module: wecom_message
-#: model:ir.actions.act_window,name:wecom_message.action_view_wecom_message_message
-msgid "Message"
-msgstr "消息"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__res_id
-msgid "Related Document ID"
-msgstr "相关单据编号"
+#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__message_app_callback_service_ids
+msgid "Receive event service"
+msgstr "接收事件服务"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__model
-msgid "Related Document Model"
-msgstr "相关的单据模型"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__scheduled_date
-msgid "Scheduled Date"
-msgstr "安排的日期"
+#: code:addons/wecom/wecom_message/models/wecom_apps.py:0 code:addons/wecom_message/models/wecom_apps.py:0
+#, python-format
+msgid "Receive messages"
+msgstr "接收消息"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__scheduled_date
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
-msgid "Scheduled Send Date"
-msgstr "安排的发送日期"
+#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__message_secret
+msgid "Secret"
+msgstr "密钥"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__safe
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__safe
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__safe
msgid "Secret message"
msgstr "保密消息"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__model_object_field
-msgid ""
-"Select target field from the related document model.\n"
-"If it is a relationship field you will be able to select a target field at the destination of the relationship."
-msgstr ""
-"从相关单据模型中选择目标字段。\n"
-"如果这是个关系型字段,您可以选择关系型字段的目标字段。"
+#: model_terms:ir.ui.view,arch_db:wecom_message.res_users_view_form
+msgid "Send Password Reset Instructions"
+msgstr "发送重置密码建议"
+
+#. module: wecom_message
+#: model_terms:ir.ui.view,arch_db:wecom_message.res_users_view_form
+msgid "Send Password Reset Instructions Message"
+msgstr "发送重置密码建议消息"
#. module: wecom_message
#: model:ir.ui.menu,name:wecom_message.menu_wecom_message_records
@@ -806,282 +401,129 @@ msgid "Send Records"
msgstr "发送记录"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__state__exception
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_notification__notification_status__exception
-msgid "Send exception"
-msgstr "发送异常"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__sender
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__sender
-msgid "Sender"
-msgstr "发送者"
+#: model_terms:ir.ui.view,arch_db:wecom_message.res_users_view_form
+msgid "Send an Invitation Email"
+msgstr "发送邀请邮件"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__state__sent
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_notification__notification_status__sent
-msgid "Sent"
-msgstr "已发送"
+#: model_terms:ir.ui.view,arch_db:wecom_message.res_users_view_form
+msgid "Send an Invitation Message"
+msgstr "发送邀请消息"
#. module: wecom_message
-#: model:ir.actions.act_window,name:wecom_message.wecom_message_config_settings_action
-#: model:ir.ui.menu,name:wecom_message.menu_wecom_message_settings
+#: model:ir.actions.act_window,name:wecom_message.wecom_message_config_settings_action model:ir.ui.menu,name:wecom_message.menu_wecom_message_settings
msgid "Settings"
msgstr "设置"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__safe__0
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__safe__0
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__safe__0
msgid "Shareable"
msgstr "可对外分享"
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__description
-msgid "Short description"
-msgstr "简述"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_notification_view_form
-msgid "Source"
-msgstr "来源"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__state
-msgid "State"
-msgstr "状态"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_notification__notification_status
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_notification_view_form
-msgid "Status"
-msgstr "状态"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__sub_model_object_field
-msgid "Sub-field"
-msgstr "子字段"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__sub_object
-msgid "Sub-model"
-msgstr "子模型"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__subject
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__subject
-msgid "Subject"
-msgstr "主题"
-
#. module: wecom_message
#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
msgid "Subject (placeholders may be used here)"
msgstr "主题(可以在这里使用占位符)"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__subtype_id
-msgid "Subtype"
-msgstr "子类型"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__message_type__notification
-msgid "System Notification Message"
-msgstr "系统通知消息"
-
-#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
-msgid ""
-"Tag ID list. Multiple recipients are separated by '|', with a maximum of 100 supported.This parameter is "
-"ignored when 'To Users' is '@ all'"
-msgstr "标签ID列表,多个接收者用‘|’分隔,最多支持100个。当“发送到用户”为”@all”时忽略本参数"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__taskcard
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__taskcard
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__taskcard
msgid "Task card message"
msgstr "任务卡片消息"
#. module: wecom_message
-#: model:ir.actions.act_window,name:wecom_message.action_wecom_message_template_tree_all
#: model:ir.ui.menu,name:wecom_message.menu_wecom_message_template
msgid "Template"
msgstr "消息模板"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__template_card
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__template_card
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__template_card
msgid "Template card message"
msgstr "模板卡片消息"
#. module: wecom_message
-#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_template_view_form
-msgid "Templates"
-msgstr "模板"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__textcard
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__textcard
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__textcard
msgid "Text card message"
msgstr "文本卡片消息"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__text
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__text
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__text
msgid "Text message"
msgstr "文本消息"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__sender
-msgid ""
-"The sender's wecom_userid (placeholder can be used here). If not set, the default value will be the sender's "
-"wecom_userid"
-msgstr "发送人的企业微信用户Id(所在位置会被在这里使用),如果不设置,作者的企业微信Id就会被作为默认值"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__auto_delete
-msgid ""
-"This option permanently removes any track of message after it's been sent, in order to preserve storage space "
-"of your Odoo database."
-msgstr "此选项在发送电子邮件后会永久删除消息的任何跟踪,以便保留 Odoo 数据库的存储空间。"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__auto_delete
-msgid ""
-"This option permanently removes any track of messags after it's been sent, including from the Technical menu "
-"in the Settings, in order to preserve storage space of your Odoo database."
-msgstr ""
-"此选项在发送电子邮件后会永久删除电子邮件的任何跟踪,包括从\"设置\"中的\"技术\"菜单中删除,以便保留 Odoo 数据库"
-"的存储空间。"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__duplicate_check_interval
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__duplicate_check_interval
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__duplicate_check_interval
msgid "Time interval for repeated message checking"
msgstr "重复消息检查的时间间隔"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__partner_to
-msgid "To (Partners)"
-msgstr "至(合作伙伴)"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__message_to_party
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__message_to_party
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__message_to_party
msgid "To Departments"
msgstr "接收消息的部门"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__message_to_tag
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__message_to_tag
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__message_to_tag
msgid "To Tags"
msgstr "接收消息的标签"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__message_to_user
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__message_to_user
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__message_to_user
msgid "To Users"
msgstr "接收消息的用户"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__enable_duplicate_check
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__enable_duplicate_check
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__enable_duplicate_check
msgid "Turn on duplicate message checking"
msgstr "开启重复消息检查"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__enable_id_trans
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_template__enable_id_trans
+#: model:ir.model.fields,field_description:wecom_message.field_mail_template__enable_id_trans
msgid "Turn on id translation"
msgstr "开启id转译"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_wecom_message_message__message_type
-msgid "Type"
-msgstr "类型"
-
-#. module: wecom_message
-#: code:addons/wecom_message/models/mail_mail.py:0 code:addons/wxwork/wecom_message/models/mail_mail.py:0
+#: code:addons/wecom/wecom_message/models/mail_mail.py:0 code:addons/wecom_message/models/mail_mail.py:0
#, python-format
msgid "Unable to connect to SMTP Server"
msgstr "无法连接到 SMTP 服务器"
#. module: wecom_message
-#: code:addons/wecom_message/models/mail_thread.py:0 code:addons/wxwork/wecom_message/models/mail_thread.py:0
+#: code:addons/wecom/wecom_message/models/mail_thread.py:0 code:addons/wecom_message/models/mail_thread.py:0
#, python-format
msgid "Unable to log message, please configure the sender's email address."
msgstr "无法记录消息,请配置发件人的EMail地址。"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__msgid
-msgid "Used to recall application messages"
-msgstr "用于撤回应用消息"
-
-#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__message_type__user_notification
-msgid "User Specific Notification Message"
-msgstr "用户特定通知消息"
+#: model:ir.model,name:wecom_message.model_res_users
+msgid "Users"
+msgstr "用户"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__video
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__video
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__video
msgid "Video message"
msgstr "视频消息"
#. module: wecom_message
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_message__msgtype__voice
-#: model:ir.model.fields.selection,name:wecom_message.selection__wecom_message_template__msgtype__voice
+#: model:ir.model.fields.selection,name:wecom_message.selection__mail_template__msgtype__voice
msgid "Voice messages"
msgstr "语音消息"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__partner_to
-msgid "WeCom ID list of partners separated by '|'"
-msgstr "以“|”分隔的合作伙伴的企业微信Id列表"
+#: model:ir.model,name:wecom_message.model_mail_template
+msgid "WeCom Message Templates"
+msgstr "企微消息模板"
#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_company__wecom_message_logo
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__wecom_message_logo
-msgid "WeCom Message logo"
-msgstr "企业微信消息Logo"
+#: model:ir.model,name:wecom_message.model_wecom_apps
+msgid "Wecom Application"
+msgstr "企微应用"
#. module: wecom_message
-#: model:ir.model,name:wecom_message.model_wecom_message_template
-msgid "WeCom Messahe Templates"
-msgstr "企业微信消息模板"
-
-#. module: wecom_message
-#: model:ir.model,name:wecom_message.model_wecom_message_message
-msgid "Wecom Message"
-msgstr "企业微信消息"
-
-#. module: wecom_message
-#: model:ir.model.fields,field_description:wecom_message.field_res_company__wecom_message_logo_web
-#: model:ir.model.fields,field_description:wecom_message.field_res_config_settings__wecom_message_logo_web
-msgid "Wecom Message Logo Web"
-msgstr "企业微信消息Logo"
-
-#. module: wecom_message
-#: model:ir.model,name:wecom_message.model_wecom_message_notification
-msgid "Wecom Message Notifications"
-msgstr "企微消息通知"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_message__meaasge_from
-msgid ""
-"Wecom user id of the sender. This field is set when no matching partner is found and replaces the author_id "
-"field in the chatter."
-msgstr ""
-"发送者的企业微信用户Id。当找不到业务伙伴的匹配的邮件时候,这个字段就被设置。并且Chatter中的作者id被替换掉。"
-
-#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__sub_model_object_field
-msgid ""
-"When a relationship field is selected as first field, this field lets you select the target field within the "
-"destination document model (sub-model)."
-msgstr "如果首先选择了一个关系型字段,这个字段可用于选择目标单据模型的目标字段。"
+#: code:addons/wecom/wecom_message/models/res_users.py:0 code:addons/wecom_message/models/res_users.py:0
+#, python-format
+msgid "You cannot perform this action on an archived user."
+msgstr "不能对存档用户执行此操作。"
#. module: wecom_message
-#: model:ir.model.fields,help:wecom_message.field_wecom_message_template__sub_object
-msgid ""
-"When a relationship field is selected as first field, this field shows the document model the relationship "
-"goes to."
-msgstr "如果关系型字段被选为第一个字段,这个字段显示这个关系指向的单据模型。"
+#: model_terms:ir.ui.view,arch_db:wecom_message.wecom_message_res_config_settings_view_form
+msgid "description"
+msgstr "说明"
diff --git a/wecom_message/models/__init__.py b/wecom_message/models/__init__.py
index a56b25d4..3c8a95ad 100644
--- a/wecom_message/models/__init__.py
+++ b/wecom_message/models/__init__.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
# from . import models
+from . import res_users
from . import res_company
from . import res_config_settings
-from . import wecom_message_template
-from . import wecom_message_message
+from . import mail_template
+from . import mail_mail
+from . import mail_message
+from . import wecom_apps
-# from . import wecom_message_notification
-from . import wecom_mail_thread
-# from . import wecom_message
-from . import wecom_apps
+from . import wecom_message_api
diff --git a/wecom_message/models/mail_mail.py b/wecom_message/models/mail_mail.py
index a42416e5..8879b849 100644
--- a/wecom_message/models/mail_mail.py
+++ b/wecom_message/models/mail_mail.py
@@ -20,31 +20,47 @@
class MailMail(models.Model):
_inherit = "mail.mail"
- is_wecom_message = fields.Boolean("Is WeCom Message")
- msgtype = fields.Char(
- string="Message type",
- )
- media_id = fields.Char(
+ media_id = fields.Many2one(
string="Media file id",
+ comodel_name="wecom.material",
+ help="Media file ID, which can be obtained by calling the upload temporary material interface",
)
-
- message_to_user = fields.Char(
- string="To User",
+ body_html = fields.Text("Html Body", translate=True, sanitize=False)
+ body_json = fields.Text("Json Body", translate=True,)
+ body_markdown = fields.Text("Markdown Body", translate=True)
+ description = fields.Char(
+ "Short description",
+ compute="_compute_description",
+ help="Message description: either the subject, or the beginning of the body",
)
+
+ message_to_user = fields.Char(string="To Users", help="Message recipients (users)")
message_to_party = fields.Char(
- string="To Departments",
- )
- message_to_tag = fields.Char(
- string="To Tags",
+ string="To Departments", help="Message recipients (departments)",
)
- body_json = fields.Text(
- "Json Contents",
- )
-
- body_markdown = fields.Text(
- "Markdown Contents",
+ message_to_tag = fields.Char(string="To Tags", help="Message recipients (tags)",)
+ use_templates = fields.Boolean("Is template message", default=False)
+ templates_id = fields.Many2one("wecom.message.template", string="Message template")
+ msgtype = fields.Selection(
+ [
+ ("text", "Text message"),
+ ("image", "Picture message"),
+ ("voice", "Voice messages"),
+ ("video", "Video message"),
+ ("file", "File message"),
+ ("textcard", "Text card message"),
+ ("news", "Graphic message"),
+ ("mpnews", "Graphic message(mpnews)"),
+ ("markdown", "Markdown message"),
+ ("miniprogram", "Mini Program Notification Message"),
+ ("taskcard", "Task card message"),
+ ("template_card", "Template card message"),
+ ],
+ string="Message type",
+ default="text",
)
+ # 企业微信消息选项
safe = fields.Selection(
[
("0", "Shareable"),
@@ -54,7 +70,6 @@ class MailMail(models.Model):
string="Secret message",
required=True,
default="1",
- readonly=True,
help="Indicates whether it is a confidential message, 0 indicates that it can be shared externally, 1 indicates that it cannot be shared and the content displays watermark, 2 indicates that it can only be shared within the enterprise, and the default is 0; Note that only messages of mpnews type support the safe value of 2, and other message types do not",
)
@@ -74,197 +89,64 @@ class MailMail(models.Model):
default="1800",
)
- def _postprocess_sent_wecom_message(
- self, success_pids, failure_reason=False, failure_type=None
- ):
- """
- 成功发送``mail``后,请执行所有必要的后处理,包括如果已设置邮件的auto_delete标志,则将其及其附件完全删除。
- 被子类覆盖,以实现额外的后处理行为。
+ # 消息状态
+ # message_id = fields.Char(
+ # "Message-Id",
+ # help="Used to recall application messages",
+ # # index=True,
+ # readonly=1,
+ # copy=False,
+ # )
- :return: True
- """
- notif_mails_ids = [mail.id for mail in self if mail.notification]
- if notif_mails_ids:
- notifications = self.env["mail.notification"].search(
- [
- ("notification_type", "=", "email"),
- ("is_wecom_message", "=", True),
- ("mail_id", "in", notif_mails_ids),
- ("notification_status", "not in", ("sent", "canceled")),
- ]
- )
- if notifications:
- # 查找所有链接到失败的通知
- failed = self.env["mail.notification"]
- if failure_type:
- failed = notifications.filtered(
- lambda notif: notif.res_partner_id not in success_pids
- )
- (notifications - failed).sudo().write(
- {
- "notification_status": "sent",
- "is_wecom_message": True,
- "failure_type": "",
- "failure_reason": "",
- }
- )
- if failed:
- failed.sudo().write(
- {
- "notification_status": "exception",
- "is_wecom_message": True,
- "failure_type": failure_type,
- "failure_reason": failure_reason,
- }
- )
- messages = notifications.mapped("mail_message_id").filtered(
- lambda m: m.is_thread_message()
- )
- # TDE TODO: 通知基于消息而不是基于通知的通知,以减少通知数量可能会很棒
- messages._notify_message_notification_update() # 通知用户我们失败了
- if not failure_type or failure_type == "RECIPIENT": # 如果还有另一个错误,我们要保留邮件。
- mail_to_delete_ids = [mail.id for mail in self if mail.auto_delete]
- self.browse(mail_to_delete_ids).sudo().unlink()
-
- return True
-
- # ------------------------------------------------------
- # 消息格式、工具和发送机制
- # mail_mail formatting, tools and send mechanism
- # ------------------------------------------------------
- def _send_prepare_body_html(self):
- self.ensure_one()
- return self.body_html or ""
-
- def _send_prepare_body_json(self):
- self.ensure_one()
- return self.body_json or ""
+ state = fields.Selection(selection_add=[("wecom_exception", "Send exception")])
- def _send_prepare_body_markdown(self):
- self.ensure_one()
- return self.body_markdown or ""
-
- def send(
- self,
- auto_commit=False,
- raise_exception=False,
- company=None,
+ def send_wecom_message(
+ self, auto_commit=False, raise_exception=False, company=None,
):
- """
- 立即发送选定的电子邮件,而忽略它们的当前状态(除非已被重新发送,否则不应该传递已经发送的电子邮件)。
- 成功发送的电子邮件被标记为“已发送”,未发送成功的电子邮件被标记为“例外”,并且相应的错误邮件将输出到服务器日志中。
-
- :param bool auto_commit: 在发送每封邮件后是否强制提交邮件状态(仅用于调度程序处理);
- 在正常传递中,永远不应该为True(默认值:False)
- :param bool raise_exception: 如果电子邮件发送过程失败,将引发异常
- :param bool is_wecom_message: 标识是企业微信消息
- :param company: 公司
- :return: True
+ """
+ 立即发送所选电子邮件,忽略其当前状态(已发送的邮件不应被传递,除非它们实际上应该被重新发送)。
+ 成功发送的电子邮件被标记为“已发送”,未能发送的电子邮件被标记为“异常”,相应的错误邮件被输出到服务器日志中。
+ :param bool auto_commit: 是否在发送每封邮件后强制提交邮件状态(仅用于调度程序处理);
+ 在正常事务中不应为True(默认值:False)
+ :param bool raise_exception: 如果电子邮件发送过程失败,是否引发异常
+ :param bool is_wecom_message: 标识是企业微信消息
+ :param company: 公司
+ :return: True
"""
if not company:
company = self.env.company
- for server_id, batch_ids in self._split_by_server():
- smtp_session = None
+ for batch_ids in self.ids:
try:
- if self.is_wecom_message:
- # 标识为企业微信消息的 mail_mail 对象 pass掉
- # print("mail.mail-send()-1")
- pass
- else:
- smtp_session = self.env["ir.mail_server"].connect(
- mail_server_id=server_id
+ WeComMessageApi = self.env["wecom.message.api"].get_message_api(company)
+ except ApiException as exc:
+ if raise_exception:
+ return self.env["wecomapi.tools.action"].ApiExceptionDialog(
+ exc, raise_exception=True
)
- except Exception as exc:
- if self.is_wecom_message:
- # 标识为企业微信消息的 mail_mail 对象 pass掉
- print("mail.mail-send()-2")
- pass
-
else:
- if raise_exception:
- # 为了与 mail_mail.send() 引发的异常保持一致并向后兼容,它被封装到一个Odoo MailDeliveryException中
- raise MailDeliveryException(
- _("Unable to connect to SMTP Server"), exc
- )
- else:
- batch = self.browse(batch_ids)
- batch.write({"state": "exception", "failure_reason": exc})
- batch._postprocess_sent_message(
- success_pids=[], failure_type="SMTP"
- )
- else:
-
- if self.is_wecom_message:
- self.browse(batch_ids)._send_wecom_message(
- auto_commit=auto_commit,
- raise_exception=raise_exception,
- company=company,
+ batch = self.browse(batch_ids)
+ batch.write(
+ {"state": "wecom_exception", "failure_reason": exc.errMsg}
)
- _logger.info("Sent batch %s messages via Wecom", len(batch_ids))
- else:
- self.browse(batch_ids)._send(
- auto_commit=auto_commit,
- raise_exception=raise_exception,
- smtp_session=smtp_session,
- )
- _logger.info(
- "Sent batch %s emails via mail server ID #%s",
- len(batch_ids),
- server_id,
- )
- finally:
- if self.is_wecom_message:
- # 标识为企业微信消息的 mail_mail 对象 pass掉
- pass
- else:
- if smtp_session:
- smtp_session.quit()
-
- def _send_wecom_prepare_values(self, partner=None):
- """
- 根据合作伙伴返回有关特定电子邮件值的字典,或者对整个邮件都是通用的。对于特定电子邮件值取决于对伙伴的字典,或者对mail.email_to给出的整个收件人来说都是通用的。
-
- :param Model partner: 具体的收件人合作伙伴
- """
- self.ensure_one()
- body_html = self._send_prepare_body_html()
- body_json = self._send_prepare_body_json()
- body_markdown = self._send_prepare_body_markdown()
- # body_alternative = tools.html2plaintext(body_html)
- if partner:
- email_to = [
- tools.formataddr((partner.name or "False", partner.email or "False"))
- ]
- message_to_user = [
- tools.formataddr(
- (partner.name or "False", partner.wecom_userid or "False")
+ else:
+ self.browse(batch_ids)._send_wecom_message(
+ auto_commit=auto_commit,
+ raise_exception=raise_exception,
+ company=company,
+ WeComMessageApi=WeComMessageApi,
)
- ]
- else:
- email_to = tools.email_split_and_format(self.email_to)
- message_to_user = self.message_to_user
- res = {
- # "message_body_text": message_body_text,
- # "message_body_html": message_body_html,
- "email_to": email_to,
- "message_to_user": message_to_user,
- "body_json": body_json,
- "body_html": body_html,
- "body_markdown": body_markdown,
- }
-
- return res
-
- def send_wecom_message(self, auto_commit=False, raise_exception=False):
- """ """
+ finally:
+ pass
def _send_wecom_message(
self,
auto_commit=False,
raise_exception=False,
company=None,
+ WeComMessageApi=None,
):
"""
+ 发送企业微信消息
:param bool auto_commit: 发送每封邮件后是否强制提交邮件状态(仅用于调度程序处理);
在正常发送绝对不能为True(默认值:False)
:param bool raise_exception: 如果电子邮件发送过程失败,是否引发异常
@@ -272,92 +154,19 @@ def _send_wecom_message(
"""
if not company:
company = self.env.company
-
- IrWxWorkMessageApi = self.env["wecom.message.api"]
- IrAttachment = self.env["ir.attachment"]
+ ApiObj = self.env["wecom.message.api"]
for mail_id in self.ids:
- success_pids = []
- failure_type = None
- processing_pid = None
mail = None
- mail = self.browse(mail_id)
- mail.mail_message_id.is_wecom_message = True # 标识为企业微信消息
- mail.mail_message_id.is_internal = True # 标识为企业微信消息
-
- if mail.state != "outgoing":
- if mail.state != "exception" and mail.auto_delete:
- mail.sudo().unlink()
- continue
-
- # 如果用户发送带有访问令牌的链接,请删除附件
- body_html = mail.body_html or ""
- body_json = mail.body_json or ""
- body_markdown = mail.body_markdown or ""
- attachments = mail.attachment_ids
- for link in re.findall(r"/web/(?:content|image)/([0-9]+)", body_html):
- attachments = attachments - IrAttachment.browse(int(link))
- for link in re.findall(r"/web/(?:content|image)/([0-9]+)", body_json):
- attachments = attachments - IrAttachment.browse(int(link))
- for link in re.findall(r"/web/(?:content|image)/([0-9]+)", body_markdown):
- attachments = attachments - IrAttachment.browse(int(link))
-
- # 为通知的合作伙伴自定义发送电子邮件的特定行为
- email_list = []
- if mail.message_to_user or mail.message_to_party or mail.message_to_tag:
- email_list.append(mail._send_wecom_prepare_values())
- for partner in mail.recipient_ids:
- values = mail._send_wecom_prepare_values(partner=partner)
- values["partner_id"] = partner
- email_list.append(values)
-
- # 在邮件对象上写入可能会失败(例如锁定用户),这将在*实际发送电子邮件后触发回滚。
- # 为了避免两次发送同一封电子邮件,请尽早引发失败
+ try:
+ mail = self.browse(mail_id)
+ if mail.state != "outgoing":
+ if mail.state != "wecom_exception" and mail.auto_delete:
+ mail.sudo().unlink()
+ continue
- mail.write(
- {"is_wecom_message": True, "state": "sent", "failure_reason": ""}
- )
+ # email_list = []
- # 在临时异常状态下更新通知,以避免在发送与当前邮件记录相关的所有电子邮件时发生电子邮件反弹的情况下进行并发更新。
- notifs = self.env["mail.notification"].search(
- [
- ("notification_type", "=", "email"),
- ("is_wecom_message", "=", True),
- ("mail_id", "in", mail.ids),
- ("notification_status", "not in", ("sent", "canceled")),
- ]
- )
- if notifs:
- notif_msg = _(
- "Error without exception. Probably due do concurrent access update of notification records. Please see with an administrator."
- )
- notifs.sudo().write(
- {
- "notification_status": "exception",
- "failure_type": "UNKNOWN",
- "failure_reason": notif_msg,
- }
- )
- # `test_mail_bounce_during_send`,强制立即更新以获取锁定。
- # 见修订版。56596e5240ef920df14d99087451ce6f06ac6d36
- notifs.flush(
- fnames=["notification_status", "failure_type", "failure_reason"],
- records=notifs,
- )
- notifs.flush(
- fnames=[
- "notification_status",
- "failure_type",
- "failure_reason",
- ],
- records=notifs,
- )
-
- # 建立 email.message.message对象并在不排队的情况下发送它
- res = None
- for email in email_list:
- # print("----------1", email.get("body_json"))
- # print("----------2", mail.body_json)
- msg = IrWxWorkMessageApi.build_message(
+ msg = ApiObj.build_message(
msgtype=mail.msgtype,
touser=mail.message_to_user,
toparty=mail.message_to_party,
@@ -369,54 +178,38 @@ def _send_wecom_message(
body_html=mail.body_html,
body_json=mail.body_json,
body_markdown=mail.body_markdown,
- # body_html=email.get("body_html"),
- # body_json=email.get("body_json"),
- # body_markdown=email.get("body_markdown"),
safe=mail.safe,
enable_id_trans=mail.enable_id_trans,
enable_duplicate_check=mail.enable_duplicate_check,
duplicate_check_interval=mail.duplicate_check_interval,
company=company,
)
- processing_pid = email.pop("partner_id", None)
- try:
- # 通过API发送消息
- res = IrWxWorkMessageApi.send_by_api(msg)
- if processing_pid:
- success_pids.append(processing_pid)
- processing_pid = None
- except AssertionError as exc:
- error = self.env["wecom.service_api_error"].get_error_by_code(
- exc.errCode
- )
- mail.write(
- {
- "is_wecom_message": True,
- "state": "exception",
- "failure_reason": "%s %s"
- % (str(error["code"]), error["name"]),
- }
- )
- if raise_exception:
- return self.env["wecomapi.tools.action"].ApiExceptionDialog(
- exc, raise_exception
- )
-
- if res["errcode"] == 0: # 消息发送成功
- mail.write(
+ del msg["company"] # 删除message中的 company
+ res = WeComMessageApi.httpCall(
+ self.env["wecom.service_api_list"].get_server_api_call(
+ "MESSAGE_SEND"
+ ),
+ msg,
+ )
+ except ApiException as exc:
+ error = self.env["wecom.service_api_error"].get_error_by_code(
+ exc.errCode
+ )
+ self.write(
{
- "is_wecom_message": True,
- "state": "sent",
- "message_id": res["msgid"],
- "failure_reason": False,
+ "state": "wecom_exception",
+ "failure_reason": "%s %s" % (str(error["code"]), error["name"]),
}
)
- _logger.info(
- "Message with ID %r and Message-Id %r successfully sent",
- mail.id,
- mail.message_id,
+ if raise_exception:
+ return self.env["wecomapi.tools.action"].ApiExceptionDialog(
+ exc, raise_exception
+ )
+ else:
+ # 如果try中的程序执行过程中没有发生错误,继续执行else中的程序;
+ mail.write(
+ {"state": "outgoing", "message_id": res["msgid"],}
)
-
if auto_commit is True:
self._cr.commit()
return True
diff --git a/wecom_message/models/mail_message.py b/wecom_message/models/mail_message.py
index dacd667e..c1a79f4b 100644
--- a/wecom_message/models/mail_message.py
+++ b/wecom_message/models/mail_message.py
@@ -27,6 +27,8 @@ class Message(models.Model):
_inherit = "mail.message"
+ is_wecom_message = fields.Boolean("Is WeCom Message")
+
# ------------------------------------------------------
# CRUD / ORM
# ------------------------------------------------------
diff --git a/wecom_message/models/mail_template.py b/wecom_message/models/mail_template.py
index 4545930f..ce72aa46 100644
--- a/wecom_message/models/mail_template.py
+++ b/wecom_message/models/mail_template.py
@@ -17,18 +17,11 @@ class MailTemplate(models.Model):
_order = "name"
# recipients
- message_to_user = fields.Char(
- string="To Users",
- help="Message recipients (users)",
- )
+ message_to_user = fields.Char(string="To Users", help="Message recipients (users)",)
message_to_party = fields.Char(
- string="To Departments",
- help="Message recipients (departments)",
- )
- message_to_tag = fields.Char(
- string="To Tags",
- help="Message recipients (tags)",
+ string="To Departments", help="Message recipients (departments)",
)
+ message_to_tag = fields.Char(string="To Tags", help="Message recipients (tags)",)
# content
media_id = fields.Many2one(
@@ -36,9 +29,9 @@ class MailTemplate(models.Model):
comodel_name="wecom.material",
help="Media file ID, which can be obtained by calling the upload temporary material interface",
)
- body_json = fields.Text("Json Body", translate=True, sanitize=False)
- body_markdown = fields.Text("Markdown Body", translate=True, sanitize=False)
- code = fields.Char("Message Code")
+ body_json = fields.Text("Json Body", translate=True, default={})
+ body_markdown = fields.Text("Markdown Body", translate=True,)
+
msgtype = fields.Selection(
[
("text", "Text message"),
@@ -60,10 +53,6 @@ class MailTemplate(models.Model):
)
# options
- is_wecom_message = fields.Boolean(
- "WeCom Message",
- )
-
safe = fields.Selection(
[
("0", "Shareable"),
@@ -71,6 +60,7 @@ class MailTemplate(models.Model):
("2", "Only share within the company "),
],
string="Secret message",
+ required=True,
default="1",
help="Indicates whether it is a confidential message, 0 indicates that it can be shared externally, 1 indicates that it cannot be shared and the content displays watermark, 2 indicates that it can only be shared within the enterprise, and the default is 0; Note that only messages of mpnews type support the safe value of 2, and other message types do not",
)
@@ -174,9 +164,7 @@ def generate_message(self, res_ids, fields):
)
else:
generated_field_values = template._render_field(
- field,
- template_res_ids,
- post_process=(field == "body_json"),
+ field, template_res_ids, post_process=(field == "body_json"),
)
for res_id, field_value in generated_field_values.items():
results.setdefault(res_id, dict())[field] = field_value
@@ -222,7 +210,7 @@ def generate_message(self, res_ids, fields):
# ------------------------------------------------------------
# 发送邮件 和 企微消息
# ------------------------------------------------------------
- def send_mail(
+ def send_message(
self,
res_id,
force_send=False,
@@ -418,6 +406,9 @@ def send_mail(
if attachment_ids:
mail.write({"attachment_ids": attachment_ids})
+ if values.get("media_id"):
+ values["media_id"] = self.media_id.id # 指定对应的素材id
+
# 标识是企微消息
is_wecom_message = False
if "message_to_user" in values and values["message_to_user"]:
@@ -429,5 +420,5 @@ def send_mail(
mail.write({"is_wecom_message": is_wecom_message})
if force_send:
- mail.send(raise_exception=raise_exception, company=company)
+ mail.send_wecom_message(raise_exception=raise_exception, company=company)
return mail.id # TDE CLEANME: return mail + api.returns ?
diff --git a/wecom_message/models/res_config_settings.py b/wecom_message/models/res_config_settings.py
index ec3e76ce..98aff209 100644
--- a/wecom_message/models/res_config_settings.py
+++ b/wecom_message/models/res_config_settings.py
@@ -82,7 +82,7 @@ def generate_parameters(self):
if bool(code) and code == "message":
for record in self:
if not record.message_app_id:
- raise ValidationError(_("Please bind contact app!"))
+ raise ValidationError(_("Please bind message app!"))
else:
record.message_app_id.with_context(code=code).generate_parameters()
super(ResConfigSettings, self).generate_parameters()
@@ -96,7 +96,7 @@ def generate_service(self):
if bool(code) and code == "message":
for record in self:
if not record.message_app_id:
- raise ValidationError(_("Please bind contact app!"))
+ raise ValidationError(_("Please bind message app!"))
else:
record.message_app_id.with_context(code=code).generate_service()
super(ResConfigSettings, self).generate_service()
diff --git a/wecom_message/models/res_users.py b/wecom_message/models/res_users.py
new file mode 100644
index 00000000..d7d07bac
--- /dev/null
+++ b/wecom_message/models/res_users.py
@@ -0,0 +1,147 @@
+# -*- coding: utf-8 -*-
+
+import logging
+import json
+import requests
+
+from collections import defaultdict
+from dateutil.relativedelta import relativedelta
+from odoo import models, fields, api, _
+from odoo.exceptions import UserError
+from odoo.addons.base.models.ir_mail_server import MailDeliveryException
+from odoo.addons.auth_signup.models.res_partner import SignupError, now
+
+from odoo.exceptions import AccessDenied
+
+
+_logger = logging.getLogger(__name__)
+
+from odoo.http import request
+
+
+class ResUsers(models.Model):
+ _inherit = "res.users"
+
+ # ---------------------
+ # 发送消息
+ # ---------------------
+ def action_reset_password(self):
+ """
+ 为每个用户创建注册令牌,并通过电子邮件发送他们的注册url
+ 增加判断模板对象为企业微信用户,使用企业微信发送模板消息的方法
+ """
+ if self.env.context.get("install_mode", False):
+ return
+ if self.filtered(lambda user: not user.active):
+ raise UserError(_("You cannot perform this action on an archived user."))
+ # prepare reset password signup
+ create_mode = bool(self.env.context.get("create_user"))
+
+ # no time limit for initial invitation, only for reset password
+ expiration = False if create_mode else now(days=+1)
+
+ self.mapped("partner_id").signup_prepare(
+ signup_type="reset", expiration=expiration
+ )
+
+ # send email to users with their signup url
+ template = False
+ if create_mode:
+ try:
+ template = self.env.ref(
+ "auth_signup.set_password_email", raise_if_not_found=False
+ )
+ except ValueError:
+ pass
+ if not template:
+ template = self.env.ref("auth_signup.reset_password_email")
+ assert template._name == "mail.template"
+ template_values = {
+ "email_to": "${object.email|safe}",
+ "email_cc": False,
+ "message_to_user": "${object.wecom_userid|safe}",
+ "auto_delete": True,
+ "partner_to": False,
+ "scheduled_date": False,
+ }
+ template.write(template_values)
+ for user in self:
+ if user.wecom_userid:
+ return self.action_reset_password_by_wecom(user, template)
+ elif not user.email:
+ raise UserError(
+ _("Cannot send email: user %s has no email address.", user.name)
+ )
+ # TDE FIXME: make this template technical (qweb)
+ with self.env.cr.savepoint():
+ force_send = not (self.env.context.get("import_file", False))
+ template.send_mail(user.id, force_send=force_send, raise_exception=True)
+ _logger.info(
+ "Password reset email sent for user <%s> to <%s>",
+ user.login,
+ user.email,
+ )
+ return super(ResUsers, self).action_reset_password()
+
+ def action_reset_password_by_wecom(self, user, template):
+ """
+ 通过企业微信的方式发送模板消息
+ """
+
+ with self.env.cr.savepoint():
+ force_send = not (self.env.context.get("import_file", False))
+ template.send_message(
+ user.id, force_send=force_send, raise_exception=True,
+ )
+ _logger.info(
+ _("Password reset message sent to user: <%s>,<%s>, <%s>"),
+ user.name,
+ user.login,
+ user.wecom_userid,
+ )
+
+ def send_unregistered_user_reminder(self, after_days=5):
+ """
+ 发送未注册的用户提醒 消息
+ """
+ datetime_min = fields.Datetime.today() - relativedelta(days=after_days)
+ datetime_max = datetime_min + relativedelta(hours=23, minutes=59, seconds=59)
+
+ res_users_with_details = self.env["res.users"].search_read(
+ [
+ ("share", "=", False),
+ ("create_uid.email", "!=", False),
+ ("create_date", ">=", datetime_min),
+ ("create_date", "<=", datetime_max),
+ ("log_ids", "=", False),
+ ],
+ ["create_uid", "name", "login"],
+ )
+
+ # 分组邀请
+ invited_users = defaultdict(list)
+ for user in res_users_with_details:
+ invited_users[user.get("create_uid")[0]].append(
+ "%s (%s)" % (user.get("name"), user.get("login"))
+ )
+
+ # 用于向所有邀请者发送有关其邀请用户的邮件
+ for user in invited_users:
+ if user.wecom_userid:
+ return self.send_unregistered_user_reminder_by_wecom(
+ user, invited_users
+ )
+ template = self.env.ref(
+ "auth_signup.mail_template_data_unregistered_users"
+ ).with_context(dbname=self._cr.dbname, invited_users=invited_users[user])
+ template.send_mail(
+ user, notif_layout="mail.mail_notification_light", force_send=False
+ )
+
+ def send_unregistered_user_reminder_by_wecom(self, user, invited_users):
+ message_template = self.env.ref(
+ "wecom_auth_oauth.message_template_data_unregistered_users"
+ ).with_context(dbname=self._cr.dbname, invited_users=invited_users[user])
+ message_template.send_message(
+ user, notif_layout="mail.mail_notification_light", force_send=False
+ )
diff --git a/wecom_message/security/ir.model.access copy.csv b/wecom_message/security/ir.model.access copy.csv
index 7214fa87..a490dc39 100644
--- a/wecom_message/security/ir.model.access copy.csv
+++ b/wecom_message/security/ir.model.access copy.csv
@@ -3,3 +3,5 @@ access_wecom_message,wecom_message.access_wecom_message,wecom_message.model_weco
access_wecom_message_template,wecom_message.access_wecom_message_template,wecom_message.model_wecom_message_template,base.group_user,1,1,1,1
access_wecom.message.notification,wecom_message.access_wecom_message_notification,wecom_message.model_wecom_message_notification,base.group_erp_manager,1,1,1,1
+access_wecom_message_template,wecom_message.access_wecom_message_template,wecom_message.model_wecom_message_template,base.group_erp_manager,1,1,1,1
+access_wecom.message.message,wecom_message.access_wecom_message_message,wecom_message.model_wecom_message_message,base.group_erp_manager,1,1,1,1
\ No newline at end of file
diff --git a/wecom_message/security/ir.model.access.csv b/wecom_message/security/ir.model.access.csv
index c7467622..82af7df7 100644
--- a/wecom_message/security/ir.model.access.csv
+++ b/wecom_message/security/ir.model.access.csv
@@ -1,6 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_wecom_message_template,wecom_message.access_wecom_message_template,wecom_message.model_wecom_message_template,base.group_erp_manager,1,1,1,1
-access_wecom.message.message,wecom_message.access_wecom_message_message,wecom_message.model_wecom_message_message,base.group_erp_manager,1,1,1,1
+
diff --git a/wecom_message/views/mail_template_views copy.xml b/wecom_message/views/mail_template_views copy.xml
new file mode 100644
index 00000000..f78ed9d1
--- /dev/null
+++ b/wecom_message/views/mail_template_views copy.xml
@@ -0,0 +1,147 @@
+
+
+
+
+
+ wecom.message.template.view.form
+ mail.template
+
+
+
+
+
+
+ wecom.message.template.tree
+ mail.template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Message Templates
+ mail.template
+ tree,form
+
+
+
+
+
+
diff --git a/wecom_message/views/mail_template_views.xml b/wecom_message/views/mail_template_views.xml
index 970eaf36..a5c2d0ce 100644
--- a/wecom_message/views/mail_template_views.xml
+++ b/wecom_message/views/mail_template_views.xml
@@ -9,41 +9,28 @@