当前位置: 首页>>代码示例>>Python>>正文


Python Document.fields[d]方法代码示例

本文整理汇总了Python中webnotes.model.doc.Document.fields[d]方法的典型用法代码示例。如果您正苦于以下问题:Python Document.fields[d]方法的具体用法?Python Document.fields[d]怎么用?Python Document.fields[d]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webnotes.model.doc.Document的用法示例。


在下文中一共展示了Document.fields[d]方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_acc

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import fields[d] [as 别名]
	def add_acc(self,lst):
		ac = Document('Account')
		for d in self.fld_dict.keys():
			ac.fields[d] = (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.doc.abbr or lst[self.fld_dict[d]]
		ac_obj = get_obj(doc=ac)
		ac_obj.doc.freeze_account='No'
		ac_obj.doc.master_type = ''
		ac_obj.validate()
		ac_obj.doc.save(1)
		ac_obj.on_update()
开发者ID:AidHamza,项目名称:erpnext,代码行数:12,代码来源:company.py

示例2: add_acc

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import fields[d] [as 别名]
 def add_acc(self,lst):
   ac = Document('Account')
   for d in self.fld_dict.keys():
     ac.fields[d] = (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.doc.abbr or lst[self.fld_dict[d]]
   ac.old_parent = ''
   ac_obj = get_obj(doc=ac)
   ac_obj.validate()
   ac_obj.doc.save(1)
   ac_obj.on_update()
   sql("commit")
   sql("start transaction")
开发者ID:ravidey,项目名称:erpnext,代码行数:13,代码来源:company.py

示例3: add_ac

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import fields[d] [as 别名]
	def add_ac(self,arg):
		arg = eval(arg)
		ac = Document('Account')
		for d in arg.keys():
			ac.fields[d] = arg[d]
		ac.old_parent = ''
		ac_obj = get_obj(doc=ac)
		ac_obj.validate()
		ac_obj.doc.save(1)
		ac_obj.on_update()

		return ac_obj.doc.name
开发者ID:Coalas,项目名称:erpnext,代码行数:14,代码来源:gl_control.py

示例4: add_acc

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import fields[d] [as 别名]
 def add_acc(self, lst):
     ac = Document("Account")
     for d in self.fld_dict.keys():
         ac.fields[d] = (
             (d == "parent_account" and lst[self.fld_dict[d]])
             and lst[self.fld_dict[d]] + " - " + self.doc.abbr
             or lst[self.fld_dict[d]]
         )
     ac_obj = get_obj(doc=ac)
     ac_obj.doc.freeze_account = "No"
     ac_obj.doc.master_type = ""
     ac_obj.validate()
     ac_obj.doc.save(1)
     ac_obj.on_update()
开发者ID:BillTheBest,项目名称:erpnext,代码行数:16,代码来源:company.py

示例5: add_cc

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import fields[d] [as 别名]
	def add_cc(self,arg):
		arg = eval(arg)
		cc = Document('Cost Center')
		# map fields
		for d in arg.keys():
			cc.fields[d] = arg[d]
		# map company abbr
		other_info = webnotes.conn.sql("select company_abbr from `tabCost Center` where name='%s'"%arg['parent_cost_center'])
		cc.company_abbr = other_info and other_info[0][0] or arg['company_abbr']

		cc_obj = get_obj(doc=cc)
		cc_obj.validate()
		cc_obj.doc.save(1)
		cc_obj.on_update()

		return cc_obj.doc.name
开发者ID:Coalas,项目名称:erpnext,代码行数:18,代码来源:gl_control.py

示例6: add_node

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import fields[d] [as 别名]
  def add_node(self,arg):
    arg = eval(arg)
    node_title = arg['node_title']
    n = Document(node_title)
    for d in arg.keys():
      if d != 'node_title':
        n.fields[d]=arg[d]
    n.old_parent = ''      
    n_obj = get_obj(doc=n)

    n_obj.validate()

    n_obj.doc.save(1)

    n_obj.on_update()

    return n_obj.doc.name
开发者ID:trycatcher,项目名称:erpnext,代码行数:19,代码来源:sales_browser_control.py

示例7: add_profile

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import fields[d] [as 别名]
 def add_profile(self,arg):
   
   # Check credit balance
   get_obj('WN ERP Client Control').check_credit_balance()
   
   arg=eval(arg)
   pr=Document('Profile')
   for d in arg.keys():
     if d!='role':
       pr.fields[d] = arg[d]
  
   pr.enabled=0
   pr.user_type='System User'
   pr.save(1)
   pr_obj = get_obj('Profile',pr.name)
   if (pr.name):
     msg="New member is added"
     pr_obj.on_update()
   else:
     msg="Profile not created"
   
   return cstr(msg)
开发者ID:Morphnus-IT-Solutions,项目名称:trimos,代码行数:24,代码来源:profile_control.py


注:本文中的webnotes.model.doc.Document.fields[d]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。