import clr
clr.AddReference("Kingdee.BOS.Core")
clr.AddReference("Kingdee.BOS")
clr.AddReference('Kingdee.BOS.App')
#添加对cloud插件开发的常用组件的引用
from Kingdee.BOS.Core.Bill.PlugIn import *
from Kingdee.BOS.Core.Bill.PlugIn.Args import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
from Kingdee.BOS.App.Data import *
def OnLoad(e):
status = this.Model.GetValue("FDocumentStatus")
if(status == "Z"):
billObj = this.View.Model.DataObject
entity = billObj["DetailEntity"]
for obj in entity:
obj['StockID_Id']=0
obj['StockID']=None
this.Model.SetValue('FOwnerID', "",obj['Seq']-1)
this.Model.SetValue('FOwnerTypeId', "",obj['Seq']-1)
entity = billObj["SUMEntity"]
for obj in entity:
#基础资料赋值
obj['StockID_Id']=0
obj['StockID']=None
#多类别基础资料赋值
this.Model.SetValue('FSumOwnerId', "",obj['Seq']-1)
this.Model.SetValue('FSumOwnerTypeId', "",obj['Seq']-1)
推荐阅读