Comments (3)
def _json_response(self, result=None, error=None):
response = {
'jsonrpc': '2.0',
'id': self.jsonrequest.get('id')
}
if result and isinstance(result, dict) and result.get('msg_signature'):
print result
mime = 'application/json'
body = json.dumps(result)
print body
return Response(
body, headers=[('Content-Type', mime),
('Content-Length', len(body))])
if error is not None:
response['error'] = error
if result is not None:
response['result'] = result
if self.jsonp:
# If we use jsonp, that's mean we are called from another host
# Some browser (IE and Safari) do no allow third party cookies
# We need then to manage http sessions manually.
response['session_id'] = self.session.sid
mime = 'application/javascript'
body = "%s(%s);" % (self.jsonp, json.dumps(response),)
else:
mime = 'application/json'
body = json.dumps(response)
return Response(
body, headers=[('Content-Type', mime),
('Content-Length', len(body))])
JsonRequest._json_response = _json_response
from odoo_dingding.
多谢老哥指点😄
from odoo_dingding.
不用客气举手之劳,github消息不多没注意,这么就才回复你。。
from odoo_dingding.
Related Issues (9)
- 两大功能点实现 发消息,发起审批流程
- ParseError: "constraint 检查错误 字段`ding.ding.tree`不存在 HOT 7
- 应用ID 目前是写死了的只能用一个。 继续优化 HOT 1
- token、过期 问题继续优化,目前是用时发现过期,然后去获取,应该改成单独线程定时获取。 HOT 3
- 效果图 HOT 3
- 有计划升迁到odoo v11 python3 支持吗? HOT 3
- 钉钉扫码效果图(这是有前提的, 前提是钉钉用户信息维护好了(也就是钉钉用户和erp用户绑定好了))
- from odoo.addons.dingding.ding_api import Dingtalk
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odoo_dingding.