mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-04 22:18:27 +00:00
[webshop] Place Order - submits Quotation, creates Customer if required, creates and submits Sales Order
This commit is contained in:
@@ -6,7 +6,6 @@ from __future__ import unicode_literals
|
||||
import webnotes
|
||||
import home
|
||||
|
||||
|
||||
def on_login_post_session(login_manager):
|
||||
"""
|
||||
called after login
|
||||
@@ -30,7 +29,14 @@ def on_login_post_session(login_manager):
|
||||
'%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()),
|
||||
login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')
|
||||
webnotes.conn.commit()
|
||||
|
||||
|
||||
if webnotes.cookies.get("full_name"):
|
||||
from website.helpers.cart import set_cart_count
|
||||
set_cart_count()
|
||||
|
||||
def on_logout(login_manager):
|
||||
webnotes.add_cookies["cart_count"] = ""
|
||||
|
||||
def check_if_expired():
|
||||
"""check if account is expired. If expired, do not allow login"""
|
||||
import conf
|
||||
|
||||
@@ -62,6 +62,30 @@ def update_template_args(page_name, args):
|
||||
|
||||
args.url = quote(str(get_request_site_address(full_address=True)), str(""))
|
||||
args.encoded_title = quote(encode(args.title or ""), str(""))
|
||||
args.shopping_cart_enabled = cint(webnotes.conn.get_default("shopping_cart_enabled"))
|
||||
|
||||
return args
|
||||
|
||||
|
||||
@webnotes.whitelist()
|
||||
def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
|
||||
from website.helpers.cart import update_party
|
||||
update_party(fullname, company_name, mobile_no, phone)
|
||||
|
||||
from core.doctype.profile import profile
|
||||
return profile.update_profile(fullname, password)
|
||||
|
||||
def get_profile_args():
|
||||
from website.helpers.cart import get_lead_or_customer
|
||||
party = get_lead_or_customer()
|
||||
if party.doctype == "Lead":
|
||||
mobile_no = party.mobile_no
|
||||
phone = party.phone
|
||||
else:
|
||||
mobile_no, phone = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user,
|
||||
"customer": party.name})
|
||||
|
||||
return {
|
||||
"company_name": party.customer_name if party.doctype == "Customer" else party.company_name,
|
||||
"mobile_no": mobile_no,
|
||||
"phone": phone
|
||||
}
|
||||
Reference in New Issue
Block a user