不要在服务器操作中这样做。您可以在OpenERP文档(我已经发送给您的链接:)中阅读以下内容The code is executed using the exec function of python, which is run in the dictionary namespace with variables: object,time,cr,uid,ids
嗯,我认为这不是完全正确的-OpenERP中的操作是通过tools.safe_eval.safe_eval()方法执行的。从该方法的doc字符串:"""safe_eval(expression[, globals[, locals[, mode[, nocopy]]]]) -> result
System-restricted Python expression evaluation
Evaluates a string that contains an expression that mostly
uses Python constants, arithmetic expressions and the
objects directly provided in context.
This can be used to e.g. evaluate
an OpenERP domain expression from an untrusted source.
Throws TypeError, SyntaxError or ValueError (not allowed) accordingly.
如果不输入细节,这是一个受限的执行。相反,请执行以下操作:创建自己的模块
创建继承自mrp.production的类。我是说,是的
_inherit = 'mrp.production'
在你班里。
在这个类中重写“Confirm Production”(不管是什么)之后执行的方法。在
在这个新方法中对rpc服务器执行所需的操作。在
别忘了打电话给super()