This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from webnotes.utils import cstr, validate_email_add, extract_email_id | |
from email.utils import parseaddr | |
el = [] | |
for s in webnotes.conn.sql("""select system_managers from `tabSerial No` | |
where status in ("Active", "Trial", "Delivered")"""): | |
if s and s[0]: | |
emails = cstr(s[0]).split("\n") | |
for e in emails: | |
name, addr = parseaddr(e) | |
if addr: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from webclient import * | |
server = "http://myaccount.erpnext.com/server.py" | |
user = "your user name" | |
password = "your password" | |
login() | |
customer = get_doc("Customer", customer_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cur_frm.cscript.item_prefix = function() { | |
// will be called on change of item_prefix | |
// note: it is important to specifiy tablename.fieldname | |
// in query as permissions are evaluated on this basis | |
// and sql keywords must be in CAPS | |
wn.call({ | |
method: "webnotes.widgets.query_builder.runquery", | |
args: { | |
"query":"SELECT `tabItem`.name \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webnotes, json | |
webnotes.connect() | |
source = "Quotation" | |
target = "Sales Order" | |
doclist = webnotes.bean("DocType Mapper", "Quotation-Sales Order").doclist | |
map_id = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("para1.txt", "r") as pfile: | |
ptxt = pfile.read() | |
with open("para1-1.txt", "r") as ufile: | |
utxt = ufile.read() | |
pwords = ptxt.split() | |
uwords = utxt.split() | |
my_map = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
my_map = { | |
"B": u"\u0901", | |
"Q": u"\u0948\u0902", | |
"R": u"\u0940\u0902", | |
"W": u"\u0902", | |
"b": u"\u0902", | |
"D": u"\u0905", | |
"F": u"\u0907", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
शहर काr अाेर जा रही हैं। बजट काr केहनी जाता हैं, वह बंद केरकेे, सभी दजx केे याित्रयों सो केइ& जयाद हैं | |
त्र+<भ मोहता | |
इस हफ्तो हमारे िवò मंत्री श्री िचदंबरम नो 2013-14 का केंõीय बजट पोश िकेया। बजट केे बारे मैं बहुत लाेगों नो अपनी रय रखी। िवरोधी दल नो िवरोध िकेया, शासके दल नो पसंद िकेया। पर अाम जनता पर इसका क्या असर होता हैं? भारत जwसो िवशाल देश काr अL&वयवसLा एके मशीन काr तरह बहुत ही जाfटल मामला हैं। मानाे यह एके रेल गा[ी हैं, जाे तो]जी सो चल रही हैं। ऐसी रेल गा[ी मw अाप जाे बदलाव केर सकेतो हैं बस Gतना ही देश काr अL&वयवसLा मं बदलाव हो सकेता हैं। | |
इस अL&वयवसLा काr रेल गा[ी काे लगता हैं काr हमारे िवò मंत्री चला रहे हैं। पर यह सच नहीं हैं। इसकाे चला रहे हैं पलािनंग केमीशन केे Gपाअधय# श्री मोंटेके िसंह अहलुवािलया। िवò मंत्री ताे केेवल यह तय केरतो हैं िके काेयलो केे िलए पwसो केहB सो अायंगो? पर यह गा[ी अा केहB सो रही हैं अाwर जा केहB रही हैं? | |
यह गा[ी 1947 नाम केे एके गाBव सो अा रही हैं, अाwर भाfव<य केे | |
यह गा[ी जहB सो शु¤ हुइ&, वहं बहुत Úोटे Úोटे गाBव Lो, अाwर शहर केम Lो। जयाद लाेग गरीब Lो अाwर लाेगों केे पास सामन भी के |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def custom_on_update(self): | |
parent = self.get_parent_bean() | |
if not parent: | |
return | |
parent.ignore_permissions = True | |
if parent.doc.doctype=="Lead" and parent.doc.status != "Trial Approved": | |
if "via demo.erpnext.com" in self.doc.content: | |
parent.doc.source="Demo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def custom_validate(self): | |
webnotes.msgprint('I got called') | |
company_count = 1 | |
if company_count >=0 : | |
webnotes.msgprint('Error: Test') | |
raise Exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cur_frm.cscript.custom_validate = function(doc) { | |
var items = wn.model.get("Delivery Note Item", {parent: doc.name}) | |
var items_against_sales_order = $.map(items, function(d) { return d.against_sales_order ? d : null }) | |
if(items.length > items_against_sales_order.length && user_roles.indexOf(["Allowed Role"])===-1) { | |
wn.msgprint("Please make against sales order"); | |
throw "Not allowed"; | |
} | |
} |