Merge branch 'wsgi' of https://github.com/webnotes/erpnext into i18n

Conflicts:
	accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
	accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
	public/js/complete_setup.js
	selling/doctype/opportunity/opportunity.js
	selling/doctype/quotation/quotation.js
This commit is contained in:
Bárbara Perretti
2013-10-16 15:09:18 -03:00
250 changed files with 5061 additions and 2506 deletions

View File

@@ -1,13 +1,16 @@
from __future__ import unicode_literals
import webnotes
def on_login(self):
from webnotes.utils import validate_email_add
import conf
if hasattr(conf, "demo_notify_url"):
if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
import requests
response = requests.post(conf.demo_notify_url, data={
"cmd":"portal.utils.send_message",
"subject":"Logged into Demo",
"sender": webnotes.form_dict.lead_email,
"message": "via demo.erpnext.com"
})
class CustomDocType(DocType):
def on_login(self):
from webnotes.utils import validate_email_add
from webnotes import conf
if "demo_notify_url" in conf:
if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
import requests
response = requests.post(conf.demo_notify_url, data={
"cmd":"portal.utils.send_message",
"subject":"Logged into Demo",
"sender": webnotes.form_dict.lead_email,
"message": "via demo.erpnext.com"
})

View File

@@ -1,68 +1,68 @@
Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,
Table:,Lead,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,
Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,
First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,
Column Labels,ID,Contact Name,Status,Naming Series,Company Name,Email Id,Source,From Customer,Campaign Name,Remark,Phone,Mobile No.,Fax,Website,Territory,Lead Type,Lead Owner,Market Segment,Industry,Request Type,Lost Reason,Next Contact By,Next Contact Date,Last Contact Date,Company,Unsubscribed,Blog Subscriber
Column Name:,name,lead_name,status,naming_series,company_name,email_id,source,customer,campaign_name,remark,phone,mobile_no,fax,website,territory,type,lead_owner,market_segment,industry,request_type,order_lost_reason,contact_by,contact_date,last_contact_date,company,unsubscribed,blog_subscriber
Mandatory:,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No
Type:,Data (text),Data,Select,Select,Data,Data,Select,Link,Link,Small Text,Data,Data,Data,Data,Link,Select,Link,Select,Link,Select,Link,Link,Date,Date,Link,Check,Check
Info:,,,"One of: Open, Replied, Attempted to Contact, Contact in Future, Contacted, Interested, Not interested, Lead Lost, Converted","One of: LEAD, LEAD/10-11/, LEAD/MUMBAI/",,,"One of: Advertisement, Blog Post, Campaign, Call, Customer, Exhibition, Supplier, Website, Email",Valid Customer,Valid Campaign,,,,,,Valid Territory,"One of: Client, Channel Partner, Consultant",Valid Profile,"One of: Lower Income, Middle Income, Upper Income",Valid Industry Type,"One of: Product Enquiry, Request for Information, Suggestions, Other",Valid Quotation Lost Reason,Valid Profile,,,Valid Company,0 or 1,0 or 1
Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,Mart Lakeman,Passive,,Zany Brainy,MartLakeman@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Saga Lundqvist,Passive,,Patterson-Fletcher,SagaLundqvist@dayrep.com,,,,,,,,,,,,,,,,,,,,,
,,Adna Sjöberg,Passive,,Griff's Hamburgers,AdnaSjoberg@gustr.com,,,,,,,,,,,,,,,,,,,,,
,,Ida Svendsen,Passive,,Rhodes Furniture,IdaDSvendsen@superrito.com,,,,,,,,,,,,,,,,,,,,,
,,Emppu Hämeenniemi,Passive,,Burger Chef,EmppuHameenniemi@teleworm.us,,,,,,,,,,,,,,,,,,,,,
,,Eugenio Pisano,Passive,,Stratabiz,EugenioPisano@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Semhar Hagos,Passive,,Home Quarters Warehouse,SemharHagos@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Branimira Ivanković,Passive,,Enviro Architectural Designs,BranimiraIvankovic@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Shelly Fields,Passive,,Ideal Garden Management,ShellyLFields@superrito.com,,,,,,,,,,,,,,,,,,,,,
,,Leo Mikulić,Passive,,Listen Up,LeoMikulic@gustr.com,,,,,,,,,,,,,,,,,,,,,
,,Denisa Jarošová,Passive,,I. Magnin,DenisaJarosova@teleworm.us,,,,,,,,,,,,,,,,,,,,,
,,Janek Rutkowski,Passive,,First Rate Choice,JanekRutkowski@dayrep.com,,,,,,,,,,,,,,,,,,,,,
,,美月 宇藤,Passive,,Multi Tech Development,mm@gustr.com,,,,,,,,,,,,,,,,,,,,,
,,Даниил Афанасьев,Passive,,National Auto Parts,dd@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Zorislav Petković,Passive,,Integra Investment Plan,ZorislavPetkovic@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Nanao Niwa,Passive,,The Lawn Guru,NanaoNiwa@superrito.com,,,,,,,,,,,,,,,,,,,,,
,,Hreiðar Jörundsson,Passive,,Buena Vista Realty Service,HreiarJorundsson@armyspy.com,,,,,,,,,,,,,,,,,,,,,
,,Lai Chu,Passive,,Bountiful Harvest Health Food Store,ChuThiBichLai@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Victor Aksakov,Passive,,P. Samuels Men's Clothiers,VictorAksakov@dayrep.com,,,,,,,,,,,,,,,,,,,,,
,,Saidalim Bisliev,Passive,,Vinyl Fever,SaidalimBisliev@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Totte Jakobsson,Passive,,Garden Master,TotteJakobsson@armyspy.com,,,,,,,,,,,,,,,,,,,,,
,,Naná Armas,Passive,,Big Apple,NanaArmasRobles@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Walerian Duda,Passive,,Monk House Sales,WalerianDuda@dayrep.com,,,,,,,,,,,,,,,,,,,,,
,,Moarimikashi ,Passive,,ManCharm,Moarimikashi@teleworm.us,,,,,,,,,,,,,,,,,,,,,
,,Dobromił Dąbrowski ,Passive,,Custom Lawn Care,DobromilDabrowski@dayrep.com,,,,,,,,,,,,,,,,,,,,,
,,Teigan Sinclair,Passive,,The Serendipity Dip,TeiganSinclair@gustr.com,,,,,,,,,,,,,,,,,,,,,
,,Fahad Guirguis,Passive,,Cavages,FahadSaidGuirguis@gustr.com,,,,,,,,,,,,,,,,,,,,,
,,Morten Olsen,Passive,,Gallenkamp,MortenJOlsen@armyspy.com,,,,,,,,,,,,,,,,,,,,,
,,Christian Baecker,Passive,,Webcom Business Services,ChristianBaecker@armyspy.com,,,,,,,,,,,,,,,,,,,,,
,,Sebastianus Dohmen,Passive,,Accord Investments,SebastianusDohmen@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Eero Koskinen,Passive,,American Appliance,EeroKoskinen@superrito.com,,,,,,,,,,,,,,,,,,,,,
,,富奎 盧,Passive,,Bettendorf's,LuFuKui@teleworm.us,,,,,,,,,,,,,,,,,,,,,
,,Milica Jelić,Passive,,House Of Denmark,MilicaJelic@dayrep.com,,,,,,,,,,,,,,,,,,,,,
,,Barbora Holubová,Passive,,10000 Auto Parts,BarboraHolubova@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Marta Kos,Passive,,Mages,MartaKos@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Simret Zula,Passive,,CSK Auto,SimretZula@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Kamil Chlubna,Passive,,Eagle Hardware & Garden,KamilChlubna@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Aceline Bolduc,Passive,,Rustler Steak House,AcelineBolduc@armyspy.com,,,,,,,,,,,,,,,,,,,,,
,,Lucie Stupková,Passive,,ABCO Foods,LucieStupkova@gustr.com,,,,,,,,,,,,,,,,,,,,,
,,Roland Solvik,Passive,,Trak Auto,RolandSolvik@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Mekirinzukushitakufu ,Passive,,Choices,Mekirinzukushitakufu@teleworm.us,,,,,,,,,,,,,,,,,,,,,
,,Mukharbek Sultanovich,Passive,,Megatronic,MukharbekSultanovich@cuvox.de,,,,,,,,,,,,,,,,,,,,,
,,Osman Amanuel,Passive,,Handy Dan,OsmanAmanuel@dayrep.com,,,,,,,,,,,,,,,,,,,,,
,,幸子 阪部,Passive,,Channel Home Centers,dd@armyspy.com,,,,,,,,,,,,,,,,,,,,,
,,Masakazu Kamitani,Passive,,Honest Air Group,MasakazuKamitani@superrito.com,,,,,,,,,,,,,,,,,,,,,
,,Omran Sabbagh,Passive,,Pleasures and Pasttimes,OmranNuhaidSabbagh@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Rikako Matsumura,Passive,,Lazysize,RikakoMatsumura@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Anayolisa Chukwukadibia,Passive,,Prestiga-Biz,AnayolisaChukwukadibia@einrot.com,,,,,,,,,,,,,,,,,,,,,
,,Gudmunda Hinna,Passive,,Childs Restaurants,GudmundaHinna@armyspy.com,,,,,,,,,,,,,,,,,,,,,
Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,
Table:,Lead,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,
Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,
First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,
Column Labels,ID,Contact Name,Status,Naming Series,Company Name,Email Id,Source,From Customer,Campaign Name,Remark,Phone,Mobile No.,Fax,Website,Territory,Lead Type,Lead Owner,Market Segment,Industry,Request Type,Next Contact By,Next Contact Date,Company,Unsubscribed,Blog Subscriber,
Column Name:,name,lead_name,status,naming_series,company_name,email_id,source,customer,campaign_name,remark,phone,mobile_no,fax,website,territory,type,lead_owner,market_segment,industry,request_type,contact_by,contact_date,company,unsubscribed,blog_subscriber,
Mandatory:,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,
Type:,Data (text),Data,Select,Select,Data,Data,Select,Link,Link,Small Text,Data,Data,Data,Data,Link,Select,Link,Select,Link,Select,Link,Date,Link,Check,Check,
Info:,,,"Lead, Open, Replied, Opportunity, Interested, Converted, Do Not Contact","One of: LEAD, LEAD/10-11/, LEAD/MUMBAI/",,,"One of: Advertisement, Blog Post, Campaign, Call, Customer, Exhibition, Supplier, Website, Email",Valid Customer,Valid Campaign,,,,,,Valid Territory,"One of: Client, Channel Partner, Consultant",Valid Profile,"One of: Lower Income, Middle Income, Upper Income",Valid Industry Type,"One of: Product Enquiry, Request for Information, Suggestions, Other",Valid Profile,,Valid Company,0 or 1,0 or 1,
Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,
,,Mart Lakeman,Lead,,Zany Brainy,MartLakeman@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Saga Lundqvist,Lead,,Patterson-Fletcher,SagaLundqvist@dayrep.com,,,,,,,,,,,,,,,,,,,,
,,Adna Sjöberg,Lead,,Griff's Hamburgers,AdnaSjoberg@gustr.com,,,,,,,,,,,,,,,,,,,,
,,Ida Svendsen,Lead,,Rhodes Furniture,IdaDSvendsen@superrito.com,,,,,,,,,,,,,,,,,,,,
,,Emppu Hämeenniemi,Lead,,Burger Chef,EmppuHameenniemi@teleworm.us,,,,,,,,,,,,,,,,,,,,
,,Eugenio Pisano,Lead,,Stratabiz,EugenioPisano@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Semhar Hagos,Lead,,Home Quarters Warehouse,SemharHagos@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Branimira Ivanković,Lead,,Enviro Architectural Designs,BranimiraIvankovic@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Shelly Fields,Lead,,Ideal Garden Management,ShellyLFields@superrito.com,,,,,,,,,,,,,,,,,,,,
,,Leo Mikulić,Lead,,Listen Up,LeoMikulic@gustr.com,,,,,,,,,,,,,,,,,,,,
,,Denisa Jarošová,Lead,,I. Magnin,DenisaJarosova@teleworm.us,,,,,,,,,,,,,,,,,,,,
,,Janek Rutkowski,Lead,,First Rate Choice,JanekRutkowski@dayrep.com,,,,,,,,,,,,,,,,,,,,
,,美月 宇藤,Lead,,Multi Tech Development,mm@gustr.com,,,,,,,,,,,,,,,,,,,,
,,Даниил Афанасьев,Lead,,National Auto Parts,dd@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Zorislav Petković,Lead,,Integra Investment Plan,ZorislavPetkovic@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Nanao Niwa,Lead,,The Lawn Guru,NanaoNiwa@superrito.com,,,,,,,,,,,,,,,,,,,,
,,Hreiðar Jörundsson,Lead,,Buena Vista Realty Service,HreiarJorundsson@armyspy.com,,,,,,,,,,,,,,,,,,,,
,,Lai Chu,Lead,,Bountiful Harvest Health Food Store,ChuThiBichLai@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Victor Aksakov,Lead,,P. Samuels Men's Clothiers,VictorAksakov@dayrep.com,,,,,,,,,,,,,,,,,,,,
,,Saidalim Bisliev,Lead,,Vinyl Fever,SaidalimBisliev@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Totte Jakobsson,Lead,,Garden Master,TotteJakobsson@armyspy.com,,,,,,,,,,,,,,,,,,,,
,,Naná Armas,Lead,,Big Apple,NanaArmasRobles@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Walerian Duda,Lead,,Monk House Sales,WalerianDuda@dayrep.com,,,,,,,,,,,,,,,,,,,,
,,Moarimikashi ,Lead,,ManCharm,Moarimikashi@teleworm.us,,,,,,,,,,,,,,,,,,,,
,,Dobromił Dąbrowski ,Lead,,Custom Lawn Care,DobromilDabrowski@dayrep.com,,,,,,,,,,,,,,,,,,,,
,,Teigan Sinclair,Lead,,The Serendipity Dip,TeiganSinclair@gustr.com,,,,,,,,,,,,,,,,,,,,
,,Fahad Guirguis,Lead,,Cavages,FahadSaidGuirguis@gustr.com,,,,,,,,,,,,,,,,,,,,
,,Morten Olsen,Lead,,Gallenkamp,MortenJOlsen@armyspy.com,,,,,,,,,,,,,,,,,,,,
,,Christian Baecker,Lead,,Webcom Business Services,ChristianBaecker@armyspy.com,,,,,,,,,,,,,,,,,,,,
,,Sebastianus Dohmen,Lead,,Accord Investments,SebastianusDohmen@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Eero Koskinen,Lead,,American Appliance,EeroKoskinen@superrito.com,,,,,,,,,,,,,,,,,,,,
,,富奎 盧,Lead,,Bettendorf's,LuFuKui@teleworm.us,,,,,,,,,,,,,,,,,,,,
,,Milica Jelić,Lead,,House Of Denmark,MilicaJelic@dayrep.com,,,,,,,,,,,,,,,,,,,,
,,Barbora Holubová,Lead,,10000 Auto Parts,BarboraHolubova@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Marta Kos,Lead,,Mages,MartaKos@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Simret Zula,Lead,,CSK Auto,SimretZula@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Kamil Chlubna,Lead,,Eagle Hardware & Garden,KamilChlubna@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Aceline Bolduc,Lead,,Rustler Steak House,AcelineBolduc@armyspy.com,,,,,,,,,,,,,,,,,,,,
,,Lucie Stupková,Lead,,ABCO Foods,LucieStupkova@gustr.com,,,,,,,,,,,,,,,,,,,,
,,Roland Solvik,Lead,,Trak Auto,RolandSolvik@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Mekirinzukushitakufu ,Lead,,Choices,Mekirinzukushitakufu@teleworm.us,,,,,,,,,,,,,,,,,,,,
,,Mukharbek Sultanovich,Lead,,Megatronic,MukharbekSultanovich@cuvox.de,,,,,,,,,,,,,,,,,,,,
,,Osman Amanuel,Lead,,Handy Dan,OsmanAmanuel@dayrep.com,,,,,,,,,,,,,,,,,,,,
,,幸子 阪部,Lead,,Channel Home Centers,dd@armyspy.com,,,,,,,,,,,,,,,,,,,,
,,Masakazu Kamitani,Lead,,Honest Air Group,MasakazuKamitani@superrito.com,,,,,,,,,,,,,,,,,,,,
,,Omran Sabbagh,Lead,,Pleasures and Pasttimes,OmranNuhaidSabbagh@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Rikako Matsumura,Lead,,Lazysize,RikakoMatsumura@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Anayolisa Chukwukadibia,Lead,,Prestiga-Biz,AnayolisaChukwukadibia@einrot.com,,,,,,,,,,,,,,,,,,,,
,,Gudmunda Hinna,Lead,,Childs Restaurants,GudmundaHinna@armyspy.com,,,,,,,,,,,,,,,,,,,,
1 Data Import Template
2 Table: Lead
3
4
5 Notes:
6 Please do not change the template headings.
7 First data column must be blank.
8 Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.
9 For updating, you can update only selective columns.
10 If you are uploading new records, leave the "name" (ID) column blank.
11 If you are uploading new records, "Naming Series" becomes mandatory, if present.
12 You can only upload upto 5000 records in one go. (may be less in some cases)
13
14 Column Labels ID Contact Name Status Naming Series Company Name Email Id Source From Customer Campaign Name Remark Phone Mobile No. Fax Website Territory Lead Type Lead Owner Market Segment Industry Request Type Lost Reason Next Contact By Next Contact By Next Contact Date Next Contact Date Company Last Contact Date Unsubscribed Company Blog Subscriber Unsubscribed Blog Subscriber
15 Column Name: name lead_name status naming_series company_name email_id source customer campaign_name remark phone mobile_no fax website territory type lead_owner market_segment industry request_type order_lost_reason contact_by contact_by contact_date contact_date company last_contact_date unsubscribed company blog_subscriber unsubscribed blog_subscriber
16 Mandatory: Yes Yes Yes No No No No No No No No No No No No No No No No No No No No No No No No
17 Type: Data (text) Data Select Select Data Data Select Link Link Small Text Data Data Data Data Link Select Link Select Link Select Link Link Date Date Link Date Check Link Check Check Check
18 Info: One of: Open, Replied, Attempted to Contact, Contact in Future, Contacted, Interested, Not interested, Lead Lost, Converted Lead, Open, Replied, Opportunity, Interested, Converted, Do Not Contact One of: LEAD, LEAD/10-11/, LEAD/MUMBAI/ One of: Advertisement, Blog Post, Campaign, Call, Customer, Exhibition, Supplier, Website, Email Valid Customer Valid Campaign Valid Territory One of: Client, Channel Partner, Consultant Valid Profile One of: Lower Income, Middle Income, Upper Income Valid Industry Type One of: Product Enquiry, Request for Information, Suggestions, Other Valid Quotation Lost Reason Valid Profile Valid Profile Valid Company 0 or 1 Valid Company 0 or 1 0 or 1 0 or 1
19 Start entering data below this line
20 Mart Lakeman Passive Lead Zany Brainy MartLakeman@einrot.com
21 Saga Lundqvist Passive Lead Patterson-Fletcher SagaLundqvist@dayrep.com
22 Adna Sjöberg Passive Lead Griff's Hamburgers AdnaSjoberg@gustr.com
23 Ida Svendsen Passive Lead Rhodes Furniture IdaDSvendsen@superrito.com
24 Emppu Hämeenniemi Passive Lead Burger Chef EmppuHameenniemi@teleworm.us
25 Eugenio Pisano Passive Lead Stratabiz EugenioPisano@cuvox.de
26 Semhar Hagos Passive Lead Home Quarters Warehouse SemharHagos@einrot.com
27 Branimira Ivanković Passive Lead Enviro Architectural Designs BranimiraIvankovic@einrot.com
28 Shelly Fields Passive Lead Ideal Garden Management ShellyLFields@superrito.com
29 Leo Mikulić Passive Lead Listen Up LeoMikulic@gustr.com
30 Denisa Jarošová Passive Lead I. Magnin DenisaJarosova@teleworm.us
31 Janek Rutkowski Passive Lead First Rate Choice JanekRutkowski@dayrep.com
32 美月 宇藤 Passive Lead Multi Tech Development mm@gustr.com
33 Даниил Афанасьев Passive Lead National Auto Parts dd@einrot.com
34 Zorislav Petković Passive Lead Integra Investment Plan ZorislavPetkovic@cuvox.de
35 Nanao Niwa Passive Lead The Lawn Guru NanaoNiwa@superrito.com
36 Hreiðar Jörundsson Passive Lead Buena Vista Realty Service HreiarJorundsson@armyspy.com
37 Lai Chu Passive Lead Bountiful Harvest Health Food Store ChuThiBichLai@einrot.com
38 Victor Aksakov Passive Lead P. Samuels Men's Clothiers VictorAksakov@dayrep.com
39 Saidalim Bisliev Passive Lead Vinyl Fever SaidalimBisliev@cuvox.de
40 Totte Jakobsson Passive Lead Garden Master TotteJakobsson@armyspy.com
41 Naná Armas Passive Lead Big Apple NanaArmasRobles@cuvox.de
42 Walerian Duda Passive Lead Monk House Sales WalerianDuda@dayrep.com
43 Moarimikashi Passive Lead ManCharm Moarimikashi@teleworm.us
44 Dobromił Dąbrowski Passive Lead Custom Lawn Care DobromilDabrowski@dayrep.com
45 Teigan Sinclair Passive Lead The Serendipity Dip TeiganSinclair@gustr.com
46 Fahad Guirguis Passive Lead Cavages FahadSaidGuirguis@gustr.com
47 Morten Olsen Passive Lead Gallenkamp MortenJOlsen@armyspy.com
48 Christian Baecker Passive Lead Webcom Business Services ChristianBaecker@armyspy.com
49 Sebastianus Dohmen Passive Lead Accord Investments SebastianusDohmen@cuvox.de
50 Eero Koskinen Passive Lead American Appliance EeroKoskinen@superrito.com
51 富奎 盧 Passive Lead Bettendorf's LuFuKui@teleworm.us
52 Milica Jelić Passive Lead House Of Denmark MilicaJelic@dayrep.com
53 Barbora Holubová Passive Lead 10000 Auto Parts BarboraHolubova@cuvox.de
54 Marta Kos Passive Lead Mages MartaKos@einrot.com
55 Simret Zula Passive Lead CSK Auto SimretZula@cuvox.de
56 Kamil Chlubna Passive Lead Eagle Hardware & Garden KamilChlubna@einrot.com
57 Aceline Bolduc Passive Lead Rustler Steak House AcelineBolduc@armyspy.com
58 Lucie Stupková Passive Lead ABCO Foods LucieStupkova@gustr.com
59 Roland Solvik Passive Lead Trak Auto RolandSolvik@cuvox.de
60 Mekirinzukushitakufu Passive Lead Choices Mekirinzukushitakufu@teleworm.us
61 Mukharbek Sultanovich Passive Lead Megatronic MukharbekSultanovich@cuvox.de
62 Osman Amanuel Passive Lead Handy Dan OsmanAmanuel@dayrep.com
63 幸子 阪部 Passive Lead Channel Home Centers dd@armyspy.com
64 Masakazu Kamitani Passive Lead Honest Air Group MasakazuKamitani@superrito.com
65 Omran Sabbagh Passive Lead Pleasures and Pasttimes OmranNuhaidSabbagh@einrot.com
66 Rikako Matsumura Passive Lead Lazysize RikakoMatsumura@einrot.com
67 Anayolisa Chukwukadibia Passive Lead Prestiga-Biz AnayolisaChukwukadibia@einrot.com
68 Gudmunda Hinna Passive Lead Childs Restaurants GudmundaHinna@armyspy.com

View File

@@ -1,40 +1,40 @@
Data Import Template,,,,,,,,,,,,,,,,,,,,,
Table:,Profile,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,
Notes:,,,,,,,,,,,,,,,,,,,,,
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,
First data column must be blank.,,,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,
DocType:,Profile,,,,,,,,,,,,,,,,,,,,
Column Labels:,ID,Email,First Name,User Type,Enabled,Middle Name (Optional),Last Name,Send Invite Email,Language,Birth Date,Gender,New Password,User Image,Background Image,Bio,Email Signature,Login After,Login Before,Restrict IP,Last Login,Last IP
Column Name:,name,email,first_name,user_type,enabled,middle_name,last_name,send_invite_email,language,birth_date,gender,new_password,user_image,background_image,bio,email_signature,login_after,login_before,restrict_ip,last_login,last_ip
Mandatory:,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No
Type:,Data (text),Data,Data,Select,Check,Data,Data,Check,Select,Date,Select,Password,Select,Select,Small Text,Small Text,Int,Int,Data,Read Only,Read Only
Info:,,,,"One of: System User, Website User",0 or 1,,,0 or 1,"One of: العربية, Deutsch, english, español, français, हिंदी, Hrvatski, nederlands, português, português brasileiro, српски, தமிழ், ไทย",,"One of: Male, Female, Other",,One of: attach_files:,One of: attach_files:,,,Integer,Integer,,,
Start entering data below this line,,,,,,,,,,,,,,,,,,,,,
,,DikmanShervashidze@armyspy.com,Dikman,System User,1,V,Shervashidze,0,,,,testpass,,,,,,,,,
,,Zukutakitoteka@teleworm.us,Zukutakitoteka,System User,1,,,0,,,,testpass,,,,,,,,,
,,HatsueKashiwagi@cuvox.de,Hatsue,System User,1,H,Kashiwagi,0,,,,testpass,,,,,,,,,
,,NuranVerkleij@einrot.com,Nuran,System User,1,T,Verkleij,0,,,,testpass,,,,,,,,,
,,aromn@armyspy.com,Дмитрий,System User,1,З,Пирогов,0,,,,testpass,,,,,,,,,
,,TildeLindqvist@cuvox.de,Tilde,System User,1,T,Lindqvist,0,,,,testpass,,,,,,,,,
,,MichalSobczak@teleworm.us,Michał,System User,1,S,Sobczak,0,,,,testpass,,,,,,,,,
,,GabrielleLoftus@superrito.com,Gabrielle,System User,1,J,Loftus,0,,,,testpass,,,,,,,,,
,,VakhitaRyzaev@teleworm.us,Vakhita,System User,1,A,Ryzaev,0,,,,testpass,,,,,,,,,
,,CharmaineGaudreau@cuvox.de,Charmaine,System User,1,D,Gaudreau,0,,,,testpass,,,,,,,,,
,,RafaelaMaartens@cuvox.de,Rafaëla,System User,1,Z,Maartens,0,,,,testpass,,,,,,,,,
,,NuguseYohannes@dayrep.com,Nuguse,System User,0,S,Yohannes,0,,,,testpass,,,,,,,,,
,,panca@armyspy.com,Раиса,System User,0,В,Белякова,0,,,,testpass,,,,,,,,,
,,CaYinLong@gustr.com,胤隆,System User,1,,,0,,,,testpass,,,,,,,,,
,,FreddieScott@armyspy.com,Freddie,System User,1,A,Scott,0,,,,testpass,,,,,,,,,
,,BergoraVigfusdottir@superrito.com,Bergþóra,System User,1,Ö,Vigfúsdóttir,0,,,,testpass,,,,,,,,,
,,WardNajmalDinKalb@cuvox.de,Ward,System User,1,N,Kalb,0,,,,testpass,,,,,,,,,
,,WanMai@teleworm.us,Wan,System User,1,A,Mai,0,,,,testpass,,,,,,,,,
,,LeonAbdulov@superrito.com,Leon,System User,1,A,Abdulov,0,,,,testpass,,,,,,,,,
,,SabinaNovotna@superrito.com,Sabina,System User,1,J,Novotná,0,,,,testpass,,,,,,,,,
Data Import Template,,,,,,,,,,,,,,,,,,,,
Table:,Profile,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,
Notes:,,,,,,,,,,,,,,,,,,,,
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,
First data column must be blank.,,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,
DocType:,Profile,,,,,,,,,,,,,,,,,,,
Column Labels:,ID,Email,First Name,User Type,Enabled,Middle Name (Optional),Last Name,Language,Birth Date,Gender,New Password,User Image,Background Image,Bio,Email Signature,Login After,Login Before,Restrict IP,Last Login,Last IP
Column Name:,name,email,first_name,user_type,enabled,middle_name,last_name,language,birth_date,gender,new_password,user_image,background_image,bio,email_signature,login_after,login_before,restrict_ip,last_login,last_ip
Mandatory:,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No
Type:,Data (text),Data,Data,Select,Check,Data,Data,Select,Date,Select,Password,Select,Select,Small Text,Small Text,Int,Int,Data,Read Only,Read Only
Info:,,,,"One of: System User, Website User",0 or 1,,,"One of: العربية, Deutsch, english, español, français, हिंदी, Hrvatski, nederlands, português, português brasileiro, српски, தமிழ், ไทย",,"One of: Male, Female, Other",,One of: attach_files:,One of: attach_files:,,,Integer,Integer,,,
Start entering data below this line,,,,,,,,,,,,,,,,,,,,
,,DikmanShervashidze@armyspy.com,Dikman,System User,1,V,Shervashidze,,,,testpass,,,,,,,,,
,,Zukutakitoteka@teleworm.us,Zukutakitoteka,System User,1,,,,,,testpass,,,,,,,,,
,,HatsueKashiwagi@cuvox.de,Hatsue,System User,1,H,Kashiwagi,,,,testpass,,,,,,,,,
,,NuranVerkleij@einrot.com,Nuran,System User,1,T,Verkleij,,,,testpass,,,,,,,,,
,,aromn@armyspy.com,Дмитрий,System User,1,З,Пирогов,,,,testpass,,,,,,,,,
,,TildeLindqvist@cuvox.de,Tilde,System User,1,T,Lindqvist,,,,testpass,,,,,,,,,
,,MichalSobczak@teleworm.us,Michał,System User,1,S,Sobczak,,,,testpass,,,,,,,,,
,,GabrielleLoftus@superrito.com,Gabrielle,System User,1,J,Loftus,,,,testpass,,,,,,,,,
,,VakhitaRyzaev@teleworm.us,Vakhita,System User,1,A,Ryzaev,,,,testpass,,,,,,,,,
,,CharmaineGaudreau@cuvox.de,Charmaine,System User,1,D,Gaudreau,,,,testpass,,,,,,,,,
,,RafaelaMaartens@cuvox.de,Rafaëla,System User,1,Z,Maartens,,,,testpass,,,,,,,,,
,,NuguseYohannes@dayrep.com,Nuguse,System User,0,S,Yohannes,,,,testpass,,,,,,,,,
,,panca@armyspy.com,Раиса,System User,0,В,Белякова,,,,testpass,,,,,,,,,
,,CaYinLong@gustr.com,胤隆,System User,1,,,,,,testpass,,,,,,,,,
,,FreddieScott@armyspy.com,Freddie,System User,1,A,Scott,,,,testpass,,,,,,,,,
,,BergoraVigfusdottir@superrito.com,Bergþóra,System User,1,Ö,Vigfúsdóttir,,,,testpass,,,,,,,,,
,,WardNajmalDinKalb@cuvox.de,Ward,System User,1,N,Kalb,,,,testpass,,,,,,,,,
,,WanMai@teleworm.us,Wan,System User,1,A,Mai,,,,testpass,,,,,,,,,
,,LeonAbdulov@superrito.com,Leon,System User,1,A,Abdulov,,,,testpass,,,,,,,,,
,,SabinaNovotna@superrito.com,Sabina,System User,1,J,Novotná,,,,testpass,,,,,,,,,
1 Data Import Template
2 Table: Profile
3
4
5 Notes:
6 Please do not change the template headings.
7 First data column must be blank.
8 If you are uploading new records, leave the "name" (ID) column blank.
9 If you are uploading new records, "Naming Series" becomes mandatory, if present.
10 Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.
11 For updating, you can update only selective columns.
12 You can only upload upto 5000 records in one go. (may be less in some cases)
13
14 DocType: Profile
15 Column Labels: ID Email First Name User Type Enabled Middle Name (Optional) Last Name Send Invite Email Language Language Birth Date Birth Date Gender Gender New Password New Password User Image User Image Background Image Background Image Bio Bio Email Signature Email Signature Login After Login After Login Before Login Before Restrict IP Restrict IP Last Login Last Login Last IP Last IP
16 Column Name: name email first_name user_type enabled middle_name last_name send_invite_email language language birth_date birth_date gender gender new_password new_password user_image user_image background_image background_image bio bio email_signature email_signature login_after login_after login_before login_before restrict_ip restrict_ip last_login last_login last_ip last_ip
17 Mandatory: Yes Yes Yes Yes No No No No No No No No No No No No No No No No No
18 Type: Data (text) Data Data Select Check Data Data Check Select Select Date Date Select Select Password Password Select Select Select Small Text Small Text Small Text Int Int Int Data Data Read Only Read Only Read Only
19 Info: One of: System User, Website User 0 or 1 0 or 1 One of: العربية, Deutsch, english, español, français, हिंदी, Hrvatski, nederlands, português, português brasileiro, српски, தமிழ், ไทย One of: العربية, Deutsch, english, español, français, हिंदी, Hrvatski, nederlands, português, português brasileiro, српски, தமிழ், ไทย One of: Male, Female, Other One of: Male, Female, Other One of: attach_files: One of: attach_files: One of: attach_files: Integer Integer Integer
20 Start entering data below this line
21 DikmanShervashidze@armyspy.com Dikman System User 1 V Shervashidze 0 testpass testpass
22 Zukutakitoteka@teleworm.us Zukutakitoteka System User 1 0 testpass testpass
23 HatsueKashiwagi@cuvox.de Hatsue System User 1 H Kashiwagi 0 testpass testpass
24 NuranVerkleij@einrot.com Nuran System User 1 T Verkleij 0 testpass testpass
25 aromn@armyspy.com Дмитрий System User 1 З Пирогов 0 testpass testpass
26 TildeLindqvist@cuvox.de Tilde System User 1 T Lindqvist 0 testpass testpass
27 MichalSobczak@teleworm.us Michał System User 1 S Sobczak 0 testpass testpass
28 GabrielleLoftus@superrito.com Gabrielle System User 1 J Loftus 0 testpass testpass
29 VakhitaRyzaev@teleworm.us Vakhita System User 1 A Ryzaev 0 testpass testpass
30 CharmaineGaudreau@cuvox.de Charmaine System User 1 D Gaudreau 0 testpass testpass
31 RafaelaMaartens@cuvox.de Rafaëla System User 1 Z Maartens 0 testpass testpass
32 NuguseYohannes@dayrep.com Nuguse System User 0 S Yohannes 0 testpass testpass
33 panca@armyspy.com Раиса System User 0 В Белякова 0 testpass testpass
34 CaYinLong@gustr.com 胤隆 System User 1 0 testpass testpass
35 FreddieScott@armyspy.com Freddie System User 1 A Scott 0 testpass testpass
36 BergoraVigfusdottir@superrito.com Bergþóra System User 1 Ö Vigfúsdóttir 0 testpass testpass
37 WardNajmalDinKalb@cuvox.de Ward System User 1 N Kalb 0 testpass testpass
38 WanMai@teleworm.us Wan System User 1 A Mai 0 testpass testpass
39 LeonAbdulov@superrito.com Leon System User 1 A Abdulov 0 testpass testpass
40 SabinaNovotna@superrito.com Sabina System User 1 J Novotná 0 testpass testpass

View File

@@ -30,17 +30,27 @@ prob = {
}
def make(reset=False, simulate=True):
#webnotes.print_messages = True
webnotes.mute_emails = True
webnotes.rollback_on_exception = True
#webnotes.flags.print_messages = True
webnotes.flags.mute_emails = True
webnotes.flags.rollback_on_exception = True
if not webnotes.conf.demo_db_name:
raise Exception("conf.py does not have demo_db_name")
if reset:
setup()
else:
if webnotes.conn:
webnotes.conn.close()
webnotes.connect(db_name=webnotes.conf.demo_db_name)
if simulate:
_simulate()
def setup():
install()
webnotes.connect(db_name=webnotes.conf.demo_db_name)
complete_setup()
make_customers_suppliers_contacts()
make_items()
@@ -65,7 +75,7 @@ def _simulate():
for i in xrange(runs_for):
print current_date.strftime("%Y-%m-%d")
webnotes.utils.current_date = current_date
webnotes.local.current_date = current_date
if current_date.weekday() in (5, 6):
current_date = webnotes.utils.add_days(current_date, 1)
@@ -138,20 +148,23 @@ def run_stock(current_date):
# make purchase requests
if can_make("Purchase Receipt"):
from buying.doctype.purchase_order.purchase_order import make_purchase_receipt
from stock.stock_ledger import NegativeStockError
report = "Purchase Order Items To Be Received"
for po in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Purchase Receipt")]:
pr = webnotes.bean(make_purchase_receipt(po))
pr.doc.posting_date = current_date
pr.doc.fiscal_year = "2013"
pr.insert()
pr.submit()
webnotes.conn.commit()
try:
pr.submit()
webnotes.conn.commit()
except NegativeStockError: pass
# make delivery notes (if possible)
if can_make("Delivery Note"):
from selling.doctype.sales_order.sales_order import make_delivery_note
from stock.stock_ledger import NegativeStockError
from stock.doctype.stock_ledger_entry.stock_ledger_entry import SerialNoRequiredError, SerialNoQtyError
from stock.doctype.serial_no.serial_no import SerialNoRequiredError, SerialNoQtyError
report = "Ordered Items To Be Delivered"
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Delivery Note")]:
dn = webnotes.bean(make_delivery_note(so))
@@ -357,13 +370,14 @@ def how_many(doctype):
def install():
print "Creating Fresh Database..."
from webnotes.install_lib.install import Installer
import conf
from webnotes import conf
inst = Installer('root')
inst.import_from_db(conf.demo_db_name, verbose = 1)
inst.install(conf.demo_db_name, verbose=1, force=1)
def complete_setup():
print "Complete Setup..."
webnotes.get_obj("Setup Control").setup_account({
from setup.page.setup_wizard.setup_wizard import setup_account
setup_account({
"first_name": "Test",
"last_name": "User",
"fy_start": "1st Jan",
@@ -412,7 +426,7 @@ def import_data(dt, submit=False, overwrite=False):
for doctype in dt:
print "Importing", doctype.replace("_", " "), "..."
webnotes.form_dict = webnotes._dict()
webnotes.local.form_dict = webnotes._dict()
if submit:
webnotes.form_dict["params"] = json.dumps({"_submit": 1})
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv")

View File

@@ -5,17 +5,21 @@ if __name__=="__main__":
import webnotes, os
import utilities.demo.make_demo
def make_demo_app():
webnotes.mute_emails = 1
webnotes.connect()
def make_demo_app(site=None):
webnotes.init(site=site)
webnotes.flags.mute_emails = 1
utilities.demo.make_demo.make(reset=True, simulate=False)
# setup demo user etc so that the site it up faster, while the data loads
make_demo_user()
make_demo_login_page()
make_demo_on_login_script()
utilities.demo.make_demo.make(reset=False, simulate=True)
webnotes.destroy()
def make_demo_user():
from webnotes.auth import _update_password
roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User",
"Leave Approver", "Blogger", "Customer", "Sales Manager", "Employee", "Support Manager",
"HR Manager", "HR User", "Maintenance Manager", "Maintenance User", "Material Manager",
@@ -42,11 +46,10 @@ def make_demo_user():
p.doc.last_name = "User"
p.doc.enabled = 1
p.doc.user_type = "ERPNext Demo"
p.doc.send_invite_email = 0
p.doc.new_password = "demo"
p.insert()
add_roles(p)
p.save()
_update_password("demo@erpnext.com", "demo")
# make system manager user
if webnotes.conn.exists("Profile", "admin@erpnext.com"):
@@ -58,12 +61,11 @@ def make_demo_user():
p.doc.last_name = "User"
p.doc.enabled = 1
p.doc.user_type = "System User"
p.doc.send_invite_email = 0
p.doc.new_password = "admin010123"
p.insert()
roles.append("System Manager")
add_roles(p)
p.save()
_update_password("admin@erpnext.com", "admin010123")
# only read for newsletter
webnotes.conn.sql("""update `tabDocPerm` set `write`=0, `create`=0, `cancel`=0
@@ -103,13 +105,12 @@ def make_demo_login_page():
webnotes.conn.commit()
def make_demo_on_login_script():
webnotes.conn.sql("""delete from `tabCustom Script` where dt='Control Panel'""")
s = webnotes.new_bean("Custom Script")
s.doc.dt = "Control Panel"
s.doc.script_type = "Server"
with open(os.path.join(os.path.dirname(__file__), "demo_control_panel.py"), "r") as dfile:
s.doc.script = dfile.read()
s.insert()
import shutil
from core.doctype.custom_script.custom_script import get_custom_server_script_path
custom_script_path = get_custom_server_script_path("Control Panel")
webnotes.create_folder(os.path.dirname(custom_script_path))
shutil.copyfile(os.path.join(os.path.dirname(__file__), "demo_control_panel.py"), custom_script_path)
cp = webnotes.bean("Control Panel")
cp.doc.custom_startup_code = """wn.ui.toolbar.show_banner('You are using ERPNext Demo. To start your own ERPNext Trial, <a href="https://erpnext.com/pricing-and-signup" target="_blank">click here</a>')"""
@@ -118,4 +119,6 @@ def make_demo_on_login_script():
webnotes.conn.commit()
if __name__=="__main__":
make_demo_app()
import sys
site = sys.argv[1:]
make_demo_app(site=site and site[0] or None)

View File

@@ -12,14 +12,6 @@ class DocType(TransactionBase):
self.doc = doc
self.doclist = doclist
def on_communication(self, comm):
if webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
status = "Replied"
else:
status = "Open"
webnotes.conn.set(self.doc, 'status', status)
def autoname(self):
# concat first and last name
self.doc.name = " ".join(filter(None,
@@ -32,28 +24,28 @@ class DocType(TransactionBase):
break
def validate(self):
self.set_status()
self.validate_primary_contact()
def validate_primary_contact(self):
sql = webnotes.conn.sql
if self.doc.is_primary_contact == 1:
if self.doc.customer:
sql("update tabContact set is_primary_contact=0 where customer = '%s'" % (self.doc.customer))
webnotes.conn.sql("update tabContact set is_primary_contact=0 where customer = '%s'" % (self.doc.customer))
elif self.doc.supplier:
sql("update tabContact set is_primary_contact=0 where supplier = '%s'" % (self.doc.supplier))
webnotes.conn.sql("update tabContact set is_primary_contact=0 where supplier = '%s'" % (self.doc.supplier))
elif self.doc.sales_partner:
sql("update tabContact set is_primary_contact=0 where sales_partner = '%s'" % (self.doc.sales_partner))
webnotes.conn.sql("update tabContact set is_primary_contact=0 where sales_partner = '%s'" % (self.doc.sales_partner))
else:
if self.doc.customer:
if not sql("select name from tabContact where is_primary_contact=1 and customer = '%s'" % (self.doc.customer)):
if not webnotes.conn.sql("select name from tabContact where is_primary_contact=1 and customer = '%s'" % (self.doc.customer)):
self.doc.is_primary_contact = 1
elif self.doc.supplier:
if not sql("select name from tabContact where is_primary_contact=1 and supplier = '%s'" % (self.doc.supplier)):
if not webnotes.conn.sql("select name from tabContact where is_primary_contact=1 and supplier = '%s'" % (self.doc.supplier)):
self.doc.is_primary_contact = 1
elif self.doc.sales_partner:
if not sql("select name from tabContact where is_primary_contact=1 and sales_partner = '%s'" % (self.doc.sales_partner)):
if not webnotes.conn.sql("select name from tabContact where is_primary_contact=1 and sales_partner = '%s'" % (self.doc.sales_partner)):
self.doc.is_primary_contact = 1
def on_trash(self):
webnotes.conn.sql("""update `tabSupport Ticket` set contact='' where contact=%s""",
self.doc.name)
self.doc.name)

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:32",
"docstatus": 0,
"modified": "2013-09-10 10:50:27",
"modified": "2013-10-08 16:48:50",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -70,11 +70,12 @@
"fieldtype": "Column Break"
},
{
"default": "Passive",
"doctype": "DocField",
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "\nOpen\nReplied"
"options": "Passive\nOpen\nReplied"
},
{
"doctype": "DocField",
@@ -84,7 +85,7 @@
"label": "Email Id",
"oldfieldname": "email_id",
"oldfieldtype": "Data",
"reqd": 1,
"reqd": 0,
"search_index": 1
},
{
@@ -94,7 +95,7 @@
"label": "Phone",
"oldfieldname": "contact_no",
"oldfieldtype": "Data",
"reqd": 1
"reqd": 0
},
{
"doctype": "DocField",

View File

@@ -10,8 +10,6 @@ from webnotes.model.doc import Document
from webnotes import msgprint
from webnotes.model.bean import getlist, copy_doclist
sql = webnotes.conn.sql
class DocType:
def __init__(self, doc, doclist=[]):
self.doc = doc
@@ -50,7 +48,7 @@ class DocType:
def get_contact_number(self, arg):
"returns mobile number of the contact"
args = load_json(arg)
number = sql("""select mobile_no, phone from tabContact where name=%s and %s=%s""" %
number = webnotes.conn.sql("""select mobile_no, phone from tabContact where name=%s and %s=%s""" %
('%s', args['key'], '%s'), (args['contact_name'], args['value']))
return number and (number[0][0] or number[0][1]) or ''
@@ -119,4 +117,4 @@ class DocType:
sl.message = arg['message']
sl.no_of_requested_sms = len(arg['receiver_list'])
sl.no_of_sent_sms = sent_sms
sl.save(new=1)
sl.save(new=1)

119
utilities/repost_stock.py Normal file
View File

@@ -0,0 +1,119 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
def repost():
"""
Repost everything!
"""
webnotes.conn.auto_commit_on_many_writes = 1
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
repost_stock(d[0], d[1])
webnotes.conn.auto_commit_on_many_writes = 0
def repost_stock(item_code, warehouse):
repost_actual_qty(item_code, warehouse)
if item_code and warehouse:
update_bin(item_code, warehouse, {
"reserved_qty": get_reserved_qty(item_code, warehouse),
"indented_qty": get_indented_qty(item_code, warehouse),
"ordered_qty": get_ordered_qty(item_code, warehouse),
"planned_qty": get_planned_qty(item_code, warehouse)
})
def repost_actual_qty(item_code, warehouse):
from stock.stock_ledger import update_entries_after
update_entries_after({ "item_code": item_code, "warehouse": warehouse })
def get_reserved_qty(item_code, warehouse):
reserved_qty = webnotes.conn.sql("""
select
sum((dnpi_qty / so_item_qty) * (so_item_qty - so_item_delivered_qty))
from
(
(select
qty as dnpi_qty,
(
select qty from `tabSales Order Item`
where name = dnpi.parent_detail_docname
) as so_item_qty,
(
select ifnull(delivered_qty, 0) from `tabSales Order Item`
where name = dnpi.parent_detail_docname
) as so_item_delivered_qty,
parent, name
from
(
select qty, parent_detail_docname, parent, name
from `tabDelivery Note Packing Item` dnpi_in
where item_code = %s and warehouse = %s
and parenttype="Sales Order"
and item_code != parent_item
and exists (select * from `tabSales Order` so
where name = dnpi_in.parent and docstatus = 1 and status != 'Stopped')
) dnpi)
union
(select qty as dnpi_qty, qty as so_item_qty,
ifnull(delivered_qty, 0) as so_item_delivered_qty, parent, name
from `tabSales Order Item` so_item
where item_code = %s and reserved_warehouse = %s
and exists(select * from `tabSales Order` so
where so.name = so_item.parent and so.docstatus = 1
and so.status != 'Stopped'))
) tab
where
so_item_qty >= so_item_delivered_qty
""", (item_code, warehouse, item_code, warehouse))
return flt(reserved_qty[0][0]) if reserved_qty else 0
def get_indented_qty(item_code, warehouse):
indented_qty = webnotes.conn.sql("""select sum(pr_item.qty - ifnull(pr_item.ordered_qty, 0))
from `tabMaterial Request Item` pr_item, `tabMaterial Request` pr
where pr_item.item_code=%s and pr_item.warehouse=%s
and pr_item.qty > ifnull(pr_item.ordered_qty, 0) and pr_item.parent=pr.name
and pr.status!='Stopped' and pr.docstatus=1""", (item_code, warehouse))
return flt(indented_qty[0][0]) if indented_qty else 0
def get_ordered_qty(item_code, warehouse):
ordered_qty = webnotes.conn.sql("""
select sum((po_item.qty - ifnull(po_item.received_qty, 0))*po_item.conversion_factor)
from `tabPurchase Order Item` po_item, `tabPurchase Order` po
where po_item.item_code=%s and po_item.warehouse=%s
and po_item.qty > ifnull(po_item.received_qty, 0) and po_item.parent=po.name
and po.status!='Stopped' and po.docstatus=1""", (item_code, warehouse))
return flt(ordered_qty[0][0]) if ordered_qty else 0
def get_planned_qty(item_code, warehouse):
planned_qty = webnotes.conn.sql("""
select sum(ifnull(qty, 0) - ifnull(produced_qty, 0)) from `tabProduction Order`
where production_item = %s and fg_warehouse = %s and status != "Stopped"
and docstatus=1 and ifnull(qty, 0) > ifnull(produced_qty, 0)""", (item_code, warehouse))
return flt(planned_qty[0][0]) if planned_qty else 0
def update_bin(item_code, warehouse, qty_dict=None):
from stock.utils import get_bin
bin = get_bin(item_code, warehouse)
mismatch = False
for fld, val in qty_dict.items():
if flt(bin.doc.fields.get(fld)) != flt(val):
bin.doc.fields[fld] = flt(val)
mismatch = True
if mismatch:
bin.doc.projected_qty = flt(bin.doc.actual_qty) + flt(bin.doc.ordered_qty) + \
flt(bin.doc.indented_qty) + flt(bin.doc.planned_qty) - flt(bin.doc.reserved_qty)
bin.doc.save()

View File

@@ -144,7 +144,6 @@ class TransactionBase(StatusUpdater):
def get_customer_address(self, args):
args = load_json(args)
webnotes.errprint(args)
ret = {
'customer_address' : args["address"],
'address_display' : get_address_display(args["address"]),
@@ -426,19 +425,13 @@ def get_address_territory(address_doc):
def validate_conversion_rate(currency, conversion_rate, conversion_rate_label, company):
"""common validation for currency and price list currency"""
if conversion_rate == 0:
msgprint(conversion_rate_label + _(' cannot be 0'), raise_exception=True)
company_currency = webnotes.conn.get_value("Company", company, "default_currency")
# parenthesis for 'OR' are necessary as we want it to evaluate as
# mandatory valid condition and (1st optional valid condition
# or 2nd optional valid condition)
valid_conversion_rate = (conversion_rate and
((currency == company_currency and conversion_rate == 1.00)
or (currency != company_currency and conversion_rate != 1.00)))
if not valid_conversion_rate:
if not conversion_rate:
msgprint(_('Please enter valid ') + conversion_rate_label + (': ')
+ ("1 %s = [?] %s" % (currency, company_currency)),
raise_exception=True)