本文整理汇总了Python中webnotes.model.doc.Document.customer_name方法的典型用法代码示例。如果您正苦于以下问题:Python Document.customer_name方法的具体用法?Python Document.customer_name怎么用?Python Document.customer_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webnotes.model.doc.Document
的用法示例。
在下文中一共展示了Document.customer_name方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_lead_address_contact
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_lead_address_contact(self):
if self.doc.lead_name:
details = sql("select name, lead_name, address_line1, address_line2, city, country, state, pincode, phone, mobile_no, fax, email_id from `tabLead` where name = '%s'" %(self.doc.lead_name), as_dict = 1)
d = Document('Address')
d.address_line1 = details[0]['address_line1']
d.address_line2 = details[0]['address_line2']
d.city = details[0]['city']
d.country = details[0]['country']
d.pincode = details[0]['pincode']
d.state = details[0]['state']
d.fax = details[0]['fax']
d.email_id = details[0]['email_id']
d.phone = details[0]['phone']
d.customer = self.doc.name
d.customer_name = self.doc.customer_name
d.is_primary_address = 1
d.address_type = 'Office'
try:
d.save(1)
except NameError, e:
pass
c = Document('Contact')
c.first_name = details[0]['lead_name']
c.email_id = details[0]['email_id']
c.phone = details[0]['phone']
c.mobile_no = details[0]['mobile_no']
c.customer = self.doc.name
c.customer_name = self.doc.customer_name
c.is_primary_contact = 1
try:
c.save(1)
except NameError, e:
pass
示例2: get_installation_note
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def get_installation_note(customer,emp_id,_type='POST'):
#return "hello "+customer
qr="select customer_name from `tabCustomer` where customer_name="+customer+" "
res=webnotes.conn.sql(qr)
#return res
from webnotes.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate
today = nowdate()
qry="select name from `tabFiscal Year` where is_fiscal_year_closed='No'"
res1=webnotes.conn.sql(qry)
#return res1[0][0]
from webnotes.model.doc import Document
import time
if res :
d= Document('Installation Note')
d.customer=customer[1:-1]
d.customer_name=customer[1:-1]
d.inst_time=time.strftime("%H:%M:%S")
d.inst_date=today
d.employee_id=emp_id[1:-1]
return d.employee_id
d.fiscal_year=res1[0][0]
d.company='medsynaptic'
d.territory='India'
d.customer_group='Individual'
#return d.fiscal_year
d.save()
webnotes.conn.commit()
return d.name
else:
d= Document('Customer')
d.customer_name=customer[1:-1]
d.customer_type='Individual'
d.customer_group='Individual'
d.territory='India'
d.save()
webnotes.conn.commit()
c= Document('Installation Note')
c.customer=customer[1:-1]
c.inst_time=time.strftime("%H:%M:%S")
c.inst_date=today
c.fiscal_year=res1[0][0]
c.employee_id=emp_id[1:-1]
c.company='Medsynaptic'
c.territory='India'
c.customer_group='Individual'
c.save()
webnotes.conn.commit()
return c.name
示例3: make_patient
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def make_patient(self):
d = Document('Patient Register')
d.customer_name = self.doc.first_name + ' ' + self.doc.last_name
d.mobile = self.doc.phone_number
d.company=self.doc.company
d.save()
return d.name
示例4: create_customer
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_customer(self):
# webnotes.errprint('customer creation starts')
from webnotes.model.doc import Document
d = Document('Customer')
d.customer_name = self.doc.name
d.gender = self.doc.gender
d.full_name = self.doc.customer_name
d.save()
示例5: create_contact
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_contact(self,name,args):
c=Document('Contact')
c.customer_name=args['Customer Name']
c.first_name=name
c.customer=name
c.email_id=args['Email Id']
c.phone=args['Phone Number']
c.is_primary_contact=1
c.save()
示例6: create_customer
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_customer(self):
webnotes.errprint("customer creation starts")
from webnotes.model.doc import Document
d = Document("Customer")
d.customer_name = self.doc.name
d.gender = self.doc.gender
d.full_name = self.doc.customer_name
d.save()
webnotes.errprint(d.name)
示例7: create_customer
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_customer(self,args):
d = Document('Customer')
d.customer_name = args['Customer Name']
d.innoworth_id=args['Id']
d.customer_type='Individual'
d.customer_group='Commercial'
d.territory='India'
d.company='InnoWorth'
d.save()
return d.name
示例8: create_lead_address_contact
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_lead_address_contact(self):
if self.doc.lead_name:
details = sql(
"select name, lead_name, address_line1, address_line2, city, country, state, pincode, phone, mobile_no, fax, email_id from `tabLead` where name = '%s'"
% (self.doc.lead_name),
as_dict=1,
)
d = Document("Address")
d.address_line1 = details[0]["address_line1"]
d.address_line2 = details[0]["address_line2"]
d.city = details[0]["city"]
d.country = details[0]["country"]
d.pincode = details[0]["pincode"]
d.state = details[0]["state"]
d.fax = details[0]["fax"]
d.email_id = details[0]["email_id"]
d.phone = details[0]["phone"]
d.customer = self.doc.name
d.customer_name = self.doc.customer_name
d.is_primary_address = 1
d.address_type = "Office"
try:
d.save(1)
except NameError, e:
pass
c = Document("Contact")
c.first_name = details[0]["lead_name"]
c.email_id = details[0]["email_id"]
c.phone = details[0]["phone"]
c.mobile_no = details[0]["mobile_no"]
c.customer = self.doc.name
c.customer_name = self.doc.customer_name
c.is_primary_contact = 1
try:
c.save(1)
except NameError, e:
pass
示例9: create_address
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_address(self,name,args):
c=Document('Address')
c.address_line1=args['Address']
c.address_type='Shipping'
c.customer=name
c.customer_name=args['Customer Name']
c.address_title=name
c.city=args['City']
c.phone=args['Phone Number']
c.state=args['State']
c.country=args['Country']
c.pincode=args['Pincode']
c.is_primary_address=1
c.save()
示例10: set_delivery_serial_no_values
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def set_delivery_serial_no_values(self, obj, serial_no):
s = Document('Serial No', serial_no)
s.delivery_document_type = obj.doc.doctype
s.delivery_document_no = obj.doc.name
s.delivery_date = obj.doc.posting_date
s.delivery_time = obj.doc.posting_time
s.customer = obj.doc.customer
s.customer_name = obj.doc.customer_name
s.delivery_address = obj.doc.address_display
s.territory = obj.doc.territory
s.warranty_expiry_date = s.warranty_period and add_days(cstr(obj.doc.posting_date), s.warranty_period) or ''
s.docstatus = 1
s.status = 'Delivered'
s.modified = nowdate()
s.modified_by = session['user']
s.save()
示例11: create_p_contact
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_p_contact(self,nm,phn_no,email_id,mob_no,fax,cont_addr):
c1 = Document('Contact')
c1.first_name = nm
c1.contact_name = nm
c1.contact_no = phn_no
c1.email_id = email_id
c1.mobile_no = mob_no
c1.fax = fax
c1.contact_address = cont_addr
c1.is_primary_contact = 'Yes'
c1.is_customer =1
c1.customer = self.doc.name
c1.customer_name = self.doc.customer_name
c1.customer_address = self.doc.address
c1.customer_group = self.doc.customer_group
c1.save(1)
示例12: on_update
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def on_update(self):
#res="select account_id from `tabFranchise` where region='"+self.doc.region+"'"
#rs=webnotes.conn.sql(res)
#webnotes.errprint(rs)
#self.doc.account_id=rs[0][0]
#webnotes.errprint(self.doc.account_id)
#self.doc.save()
s=webnotes.conn.sql("select customer_name from `tabCustomer` where territory='"+cstr(self.doc.region)+"' and name='"+self.doc.name+"'")
#webnotes.errprint(s)
if not s:
d = Document('Customer')
d.customer_name=self.doc.sf_name
d.territory=self.doc.region
d.account_id=self.doc.account_id
d.sf_name=self.doc.sf_name
d.customer_type='Company'
d.customer_group='Commercial'
示例13: create_lead_address_contact
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_lead_address_contact(self):
if self.doc.lead_name:
if not webnotes.conn.get_value("Address", {"lead": self.doc.lead_name, "customer": self.doc.customer}):
webnotes.conn.sql("""update `tabAddress` set customer=%s, customer_name=%s where lead=%s""",
(self.doc.name, self.doc.customer_name, self.doc.lead_name))
lead = webnotes.conn.get_value("Lead", self.doc.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True)
c = Document('Contact')
c.first_name = lead.lead_name
c.email_id = lead.email_id
c.phone = lead.phone
c.mobile_no = lead.mobile_no
c.customer = self.doc.name
c.customer_name = self.doc.customer_name
c.is_primary_contact = 1
try:
c.save(1)
except NameError, e:
pass
示例14: make_address_from_customer
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def make_address_from_customer():
for c in webnotes.conn.sql("select * from tabCustomer", as_dict=1):
d = Document('Address')
d.address_line1 = c['address_line1']
d.address_line2 = c['address_line2']
d.city = c['city']
d.country = c['country']
d.pincode = c['pincode']
d.state = c['state']
d.fax = c['fax_1']
d.email_id = c['email_id']
d.phone = c['phone_1']
d.customer = c['name']
d.customer_name = c['customer_name']
d.is_primary_address = 1
d.address_type = 'Office'
try:
d.save(1)
except NameError, e:
pass
示例15: create_customer
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import customer_name [as 别名]
def create_customer(auth_key,name,mobile_number,email_id,datetime,version,_type='POST'):
login =[]
loginObj = {}
qr="select name from `tabauth keys` where auth_key="+auth_key
res=webnotes.conn.sql(qr)
if res:
qr1="select name from `tabCustomer Details` where customer_name="+name+" and phone_number="+mobile_number
rs=webnotes.conn.sql(qr1)
rgn=webnotes.conn.sql("select region from `tabFranchise` where contact_email='"+res[0][0]+"'")
if rs :
key={}
key['customer_id']=rs[0][0]
login.append(key)
loginObj['status']='200'
loginObj['customer']=login
return loginObj
else :
from webnotes.model.doc import Document
d = Document('Customer Details')
if len(name)>3:
d.customer_name=name[1:-1]
if len(email_id)>3:
d.customer_email=email_id[1:-1]
if len(mobile_number)>3:
d.phone_number=mobile_number[1:-1]
d.region=rgn[0][0]
d.save()
webnotes.conn.commit()
key={}
key['customer_id']=d.name
login.append(key)
loginObj['status']='200'
loginObj['customer']=login
return loginObj
else:
loginObj['status']='401'
return loginObj