mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
[fix] merge conflict
This commit is contained in:
@@ -40,8 +40,7 @@ class DocType(TransactionBase):
|
||||
|
||||
def validate_values(self):
|
||||
if webnotes.defaults.get_global_default('cust_master_name') == 'Naming Series' and not self.doc.naming_series:
|
||||
msgprint("Series is Mandatory.")
|
||||
raise Exception
|
||||
webnotes.throw("Series is Mandatory.", webnotes.MandatoryError)
|
||||
|
||||
def validate(self):
|
||||
self.validate_values()
|
||||
|
||||
@@ -14,12 +14,12 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
|
||||
onload: function() {
|
||||
if(cur_frm.fields_dict.lead_owner.df.options.match(/^Profile/)) {
|
||||
cur_frm.fields_dict.lead_owner.get_query = function(doc,cdt,cdn) {
|
||||
return { query:"controllers.queries.profile_query" } }
|
||||
return { query:"core.doctype.profile.profile.profile_query" } }
|
||||
}
|
||||
|
||||
if(cur_frm.fields_dict.contact_by.df.options.match(/^Profile/)) {
|
||||
cur_frm.fields_dict.contact_by.get_query = function(doc,cdt,cdn) {
|
||||
return { query:"controllers.queries.profile_query" } }
|
||||
return { query:"core.doctype.profile.profile.profile_query" } }
|
||||
}
|
||||
|
||||
if(in_list(user_roles,'System Manager')) {
|
||||
@@ -51,7 +51,7 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
|
||||
}
|
||||
|
||||
cur_frm.communication_view = new wn.views.CommunicationList({
|
||||
list: wn.model.get("Communication", {"lead": this.frm.doc.name}),
|
||||
list: wn.model.get("Communication", {"parenttype": "Lead", "parent":this.frm.doc.name}),
|
||||
parent: this.frm.fields_dict.communication_html.wrapper,
|
||||
doc: this.frm.doc,
|
||||
recipients: this.frm.doc.email_id
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes import _
|
||||
from webnotes.utils import cstr, validate_email_add, cint
|
||||
from webnotes.utils import cstr, validate_email_add, cint, extract_email_id
|
||||
from webnotes import session, msgprint
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
@@ -28,8 +28,14 @@ class DocType(SellingController):
|
||||
if customer:
|
||||
self.doc.fields["__is_customer"] = customer
|
||||
|
||||
def on_communication_sent(self, comm):
|
||||
webnotes.conn.set(self.doc, 'status', 'Replied')
|
||||
def on_communication(self, comm):
|
||||
if comm.sender == self.get_sender(comm) or \
|
||||
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 check_status(self):
|
||||
chk = sql("select status from `tabLead` where name=%s", self.doc.name)
|
||||
|
||||
@@ -62,11 +62,11 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
||||
|
||||
if (!doc.__islocal) {
|
||||
cur_frm.communication_view = new wn.views.CommunicationList({
|
||||
list: wn.model.get("Communication", {"quotation": doc.name}),
|
||||
list: wn.model.get("Communication", {"parent": doc.name, "parenttype": "Quotation"}),
|
||||
parent: cur_frm.fields_dict.communication_html.wrapper,
|
||||
doc: doc,
|
||||
recipients: doc.contact_email
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.quotation_to();
|
||||
|
||||
@@ -7,7 +7,7 @@ import webnotes
|
||||
from webnotes.utils import cstr, getdate
|
||||
from webnotes.model.bean import getlist
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes import msgprint
|
||||
from webnotes import _, msgprint
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
@@ -278,3 +278,7 @@ def _make_customer(source_name, ignore_permissions=False):
|
||||
return customer
|
||||
else:
|
||||
raise e
|
||||
except webnotes.MandatoryError:
|
||||
from webnotes.utils import get_url_to_form
|
||||
webnotes.throw(_("Before proceeding, please create Customer from Lead") + \
|
||||
(" - %s" % get_url_to_form("Lead", lead_name)))
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
import webnotes.utils
|
||||
import json
|
||||
|
||||
from webnotes.utils import cstr, flt, getdate
|
||||
from webnotes.model.bean import getlist
|
||||
@@ -287,55 +286,6 @@ class DocType(SellingController):
|
||||
def on_update(self):
|
||||
pass
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_orders():
|
||||
# find customer id
|
||||
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
||||
"customer")
|
||||
|
||||
if customer:
|
||||
orders = webnotes.conn.sql("""select
|
||||
name, creation, currency from `tabSales Order`
|
||||
where customer=%s
|
||||
and docstatus=1
|
||||
order by creation desc
|
||||
limit 20
|
||||
""", customer, as_dict=1)
|
||||
for order in orders:
|
||||
order.items = webnotes.conn.sql("""select
|
||||
item_name, qty, export_rate, export_amount, delivered_qty, stock_uom
|
||||
from `tabSales Order Item`
|
||||
where parent=%s
|
||||
order by idx""", order.name, as_dict=1)
|
||||
|
||||
return orders
|
||||
else:
|
||||
return []
|
||||
|
||||
def get_website_args():
|
||||
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
||||
"customer")
|
||||
bean = webnotes.bean("Sales Order", webnotes.form_dict.name)
|
||||
if bean.doc.customer != customer:
|
||||
return {
|
||||
"doc": {"name": "Not Allowed"}
|
||||
}
|
||||
else:
|
||||
return {
|
||||
"doc": bean.doc,
|
||||
"doclist": bean.doclist,
|
||||
"webnotes": webnotes,
|
||||
"utils": webnotes.utils
|
||||
}
|
||||
|
||||
def get_currency_and_number_format():
|
||||
return {
|
||||
"global_number_format": webnotes.conn.get_default("number_format") or "#,###.##",
|
||||
"currency": webnotes.conn.get_default("currency"),
|
||||
"currency_symbols": json.dumps(dict(webnotes.conn.sql("""select name, symbol
|
||||
from tabCurrency where ifnull(enabled,0)=1""")))
|
||||
}
|
||||
|
||||
def set_missing_values(source, target):
|
||||
bean = webnotes.bean(target)
|
||||
bean.run_method("onload_post_render")
|
||||
|
||||
@@ -161,7 +161,7 @@ def _get_item_discount(item_group, customer):
|
||||
FROM `tabItem Group` AS node, `tabItem Group` AS parent
|
||||
WHERE parent.lft <= node.lft and parent.rgt >= node.rgt and node.name = %s
|
||||
GROUP BY parent.name
|
||||
ORDER BY parent.lft desc""", item_group)]
|
||||
ORDER BY parent.lft desc""", (item_group,))]
|
||||
|
||||
discount = 0
|
||||
for d in parent_item_groups:
|
||||
|
||||
Reference in New Issue
Block a user