智能工厂API接口创建销售订单
This commit is contained in:
28
sf_bpm_api/models/models.py
Normal file
28
sf_bpm_api/models/models.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
import uuid
|
||||
import string
|
||||
import random
|
||||
|
||||
|
||||
from odoo import fields, models, api
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
# 获取token,token自动生成且唯一
|
||||
def get_token(self):
|
||||
return uuid.uuid1()
|
||||
|
||||
# 获取密钥(大小字母+数字随机)
|
||||
def get_secret(self):
|
||||
ran_str = ''.join(random.sample(string.ascii_letters + string.digits, 16))
|
||||
return ran_str
|
||||
|
||||
sf_token = fields.Char(u'Token', default=get_token)
|
||||
sf_secret_key = fields.Char(u'密钥', default=get_secret)
|
||||
Reference in New Issue
Block a user