需要在服务器上运行脚本,在表单插件,注册python脚本
脚本如下:
import clr
clr.AddReference('System')
clr.AddReference('System.Data')
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.App')
clr.AddReference('Kingdee.BOS.ServiceHelper')
from Kingdee.BOS import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.Bill import *
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
from System import *
from System.Data import *
from Kingdee.BOS.App.Data import *
from System.Collections.Generic import List
from Kingdee.BOS.ServiceHelper import *
def BeforeSetItemValueByNumber(e):
key = str(e.BaseDataFieldKey.ToUpper());
if (key == "FSUPPLIERID"):#字段标识大写,多个字段可在后面拼接:"or key=="FXXX",可在此添加前提条件用"and"连接
e.IsShowUsed = False;#允许选择禁用的数据
e.IsShowApproved = False;#允许选择未审核的数据
e.Filter = "";
def BeforeF7Select(e):
key = str(e.FieldKey.ToUpper());
if (key == "FSUPPLIERID"):#字段标识大写
e.IsShowUsed = False;#允许选择禁用的数据
e.IsShowApproved = False;#允许选择未审核的数据
如何选择禁用、未审核的供应商或物料.docx(13.44KB)
本文转载自:Python放开单据字段允许选择禁用/未审核的基础资料
作者:CQ周玉立
原文链接:https://vip.kingdee.com/article/157167808605429248
推荐阅读