[minor] [cleanup] Landed cost wizard

This commit is contained in:
Nabin Hait
2013-09-02 18:44:55 +05:30
31 changed files with 254 additions and 97 deletions

View File

@@ -17,10 +17,7 @@ class DocType(TransactionBase):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def onload(self):
self.add_communication_list()
def autoname(self):
cust_master_name = webnotes.defaults.get_global_default('cust_master_name')
if cust_master_name == 'Customer Name':

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-06-11 14:26:44",
"docstatus": 0,
"modified": "2013-08-08 14:22:13",
"modified": "2013-09-02 16:25:13",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -348,6 +348,15 @@
"options": "Customer Discount",
"permlevel": 0
},
{
"doctype": "DocField",
"fieldname": "communications",
"fieldtype": "Table",
"hidden": 1,
"label": "Communications",
"options": "Communication",
"permlevel": 0
},
{
"amend": 0,
"cancel": 0,

View File

@@ -12,6 +12,9 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
lead_name = webnotes.conn.get_value("Lead", {"email_id": sender})
contact_name = webnotes.conn.get_value("Contact", {"email_id": sender})
parent_doctype = "Contact" if contact_name else "Lead"
parent_name = contact_name or lead_name
if not (lead_name or contact_name):
# none, create a new Lead
lead = webnotes.bean({
@@ -26,11 +29,11 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
lead_name = lead.doc.name
message = make(content=content, sender=sender, subject=subject,
lead=lead_name, contact=contact_name, date=date)
doctype = parent_doctype, name = parent_name, date=date)
if mail:
# save attachments to parent if from mail
bean = webnotes.bean("Contact" if contact_name else "Lead", contact_name or lead_name)
bean = webnotes.bean(parent_doctype, parent_name)
mail.save_attachments_in_doc(bean.doc)
class SalesMailbox(POP3Mailbox):

View File

@@ -24,7 +24,6 @@ class DocType(SellingController):
})
def onload(self):
self.add_communication_list()
customer = webnotes.conn.get_value("Customer", {"lead_name": self.doc.name})
if customer:
self.doc.fields["__is_customer"] = customer

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-04-10 11:45:37",
"docstatus": 0,
"modified": "2013-08-08 14:22:14",
"modified": "2013-09-02 17:25:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -410,6 +410,14 @@
"fieldtype": "Check",
"label": "Blog Subscriber"
},
{
"doctype": "DocField",
"fieldname": "communications",
"fieldtype": "Table",
"hidden": 1,
"label": "Communications",
"options": "Communication"
},
{
"cancel": 1,
"doctype": "DocPerm",

View File

@@ -25,9 +25,6 @@ class DocType(TransactionBase):
"contact_by": webnotes.conn.get_value("Opportunity", self.doc.name, "contact_by") if \
(not cint(self.doc.fields.get("__islocal"))) else None,
})
def onload(self):
self.add_communication_list()
def get_item_details(self, item_code):
item = sql("""select item_name, stock_uom, description_html, description, item_group, brand

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 18:50:30",
"docstatus": 0,
"modified": "2013-08-08 14:22:15",
"modified": "2013-09-02 16:27:33",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -442,6 +442,14 @@
"read_only": 1,
"width": "150px"
},
{
"doctype": "DocField",
"fieldname": "communications",
"fieldtype": "Table",
"hidden": 1,
"label": "Communications",
"options": "Communication"
},
{
"doctype": "DocPerm",
"role": "Sales User"

View File

@@ -20,9 +20,6 @@ class DocType(SellingController):
self.doclist = doclist
self.tname = 'Quotation Item'
self.fname = 'quotation_details'
def onload(self):
self.add_communication_list()
# Get contact person details based on customer selected
# ------------------------------------------------------

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:08",
"docstatus": 0,
"modified": "2013-08-09 14:46:11",
"modified": "2013-09-02 16:25:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -835,6 +835,14 @@
"read_only": 0,
"width": "40px"
},
{
"doctype": "DocField",
"fieldname": "communications",
"fieldtype": "Table",
"hidden": 1,
"label": "Communications",
"options": "Communication"
},
{
"amend": 1,
"cancel": 1,