brotherton-erpnext/patches/june_2012/fetch_organization_from_lead.py

7 lines
405 B
Python
Raw Normal View History

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
2012-06-08 12:32:38 +00:00
def execute():
import webnotes
2012-06-08 12:49:32 +00:00
webnotes.conn.sql("update `tabQuotation` t1, `tabLead` t2 set t1.organization = t2.company_name where ifnull(t1.lead, '') != '' and t1.quotation_to = 'Lead' and ifnull(t1.organization, '') = '' and t1.lead = t2.name")