Files
jikimo_sf/sf_sale/models/auto_quatotion_common.py
jinling.yang ef47597cf9 1.强制必填字段
(1)【客户名称】、【税ID】、【Email】、【销售员】、【标签】为强制必填
(2)【电话】、【手机】两个字段控制为二选一强制必填
2.客户校验规则:
(1)【客户名称】+【税ID】两个字段分别与已经创建客户的档案信息进行校验,任意一项100%吻合则不允许创建客户
3.强制必填字段
(1)【名称】、【Email】、【销售员】为强制必填
(2)【电话】、【手机】两个字段控制为二选一强制必填
4.个人校验规则:
(1)【名称】+【Email】两个字段分别与已经创建客户的档案信息进行校验,两项一起100%吻合则不允许创建个人
5.下拉仅显示销售人员的账户用户名(非相关用户及姓名不显示),字段为强制必填
(1)创建人的权限为销售经理,则【销售员】字段自动默认为当前账号的用户姓名,且不可修改
(2)创建人的权限为销售总监,则【销售员】字段自动默认为当前账号的用户姓名,可下拉选择,修改销售人员姓名
2023-12-19 17:48:30 +08:00

38 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
import logging
from odoo.modules import get_resource_path
from odoo import fields, models, api
# from quatotion import readSql, feature_recognize, auto_quatotion
__author__ = 'jinling.yang'
_logger = logging.getLogger(__name__)
class AutoQuatotion(models.Model):
_name = 'sf.auto_quatotion.common'
_description = u'自动报价公用类'
# 获取feature.sqlite的地址
def get_feature_full_path(self):
return get_resource_path('sf_sale', 'models', 'feature.sqlite')
# 获取price.sqlite的地址
def get_price_full_path(self):
return get_resource_path('sf_sale', 'models', 'price.sqlite')
# 获取price.sqlite的地址
def get_process_time_db_path(self):
return get_resource_path('sf_sale', 'models', 'process_time.db')
def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
'''
通过打包好的.so库
以调用autoQuatotion库中Quatotion类
初始化后调用类的analyseShape方法对模型文件进行价格预测
'''
# 初始化自动报价类(输入特征数据库和加工时间数据库)
reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
# 获取价格、加工时间、尺寸、XYZ、翻面次数
feature_info = reader.analyseShape(stp_url, InfoJson={})
return feature_info