校验规则表达式在哪用import语句导入python模块?
金蝶云社区-quHongan
quHongan
0人赞赏了该文章 845次浏览 未经作者许可,禁止转载编辑于2016年01月27日 14:50:02

比如:在单据保存操作的校验规则中使用 collections.OrderedDict.fromkeys方法,但提示:name 'collections' is not defined
感觉是因为collections没有import,如果我想用语句:from collections import OrderedDict, 请问在哪里写入?
看到k3cloud安装目录下有init.py与__future__.py两个文件,不知道与此文件是否有关?

详细提示如下:

[{"operation":"SP_InStock.MBIClick.tbSplitSave"}]
发生时间:14:43:11
错误来源: Kingdee.BOS.ServiceHelper
错误信息:name 'collections' is not defined
===================================================
调用堆栈:

Server stack trace:
在 IronPython.Compiler.LookupGlobalInstruction.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
在 IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
在 IronPython.Compiler.PythonScriptCode.EvalWrapper(CodeContext ctx)
在 IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
在 Kingdee.BOS.Scripting.PyExpressionEvaluator.Run(Expression expression, ExpressionContext context)
在 Kingdee.BOS.Core.Metadata.Util.ConditionParser.VerifyExpression(VerifyExpressionParameter parameter)
在 Kingdee.BOS.App.Core.Validation.ConditionValidator.Verify(VerifyExpressionParameter verifyParam)