新增企业微信模块

This commit is contained in:
jinling.yang
2023-05-30 11:26:03 +08:00
parent c913973936
commit 9ae2ff1a2b
21 changed files with 1098 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, fields, models, _
_logger = logging.getLogger(__name__)
class WxWorkConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
wxwork_corp_id = fields.Char(string='企业微信CorpID')
wxwork_secret = fields.Char(string='企业微信Secret')
@api.model
def get_values(self):
"""
重载获取参数的方法,参数都存在系统参数中
:return:
"""
values = super(WxWorkConfigSettings, self).get_values()
config = self.env['ir.config_parameter'].sudo()
wxwork_corp_id = config.get_param('wxwork_corp_id', default='')
wxwork_secret = config.get_param('wxwork_secret', default='')
values.update(
wxwork_corp_id=wxwork_corp_id,
wxwork_secret=wxwork_secret,
)
return values
def set_values(self):
super(WxWorkConfigSettings, self).set_values()
ir_config = self.env['ir.config_parameter'].sudo()
ir_config.set_param("wxwork_corp_id", self.wxwork_corp_id or "")
ir_config.set_param("wxwork_secret", self.wxwork_secret or "")