Merge branch 'responsive' of github.com:webnotes/erpnext into responsive

This commit is contained in:
Anand Doshi
2013-07-08 19:47:55 +05:30
21 changed files with 173 additions and 224 deletions

View File

@@ -118,11 +118,26 @@ class DocType(SellingController):
# Set actual qty for each item in selected warehouse
self.update_current_stock()
self.validate_with_previous_doc()
self.doc.status = 'Draft'
if not self.doc.billing_status: self.doc.billing_status = 'Not Billed'
if not self.doc.installation_status: self.doc.installation_status = 'Not Installed'
if not self.doc.installation_status: self.doc.installation_status = 'Not Installed'
def validate_with_previous_doc(self):
super(DocType, self).validate_with_previous_doc(self.tname, {
"Sales Order": {
"ref_dn_field": "prevdoc_docname",
"compare_fields": [["customer", "="], ["company", "="], ["project_name", "="],
["currency", "="]],
},
"Sales Order Item": {
"ref_dn_field": "prevdoc_detail_docname",
"compare_fields": [["export_rate", "="]],
"is_child_table": True
}
})
def validate_proj_cust(self):
"""check for does customer belong to same project as entered.."""

View File

@@ -102,7 +102,7 @@
"fieldname": "customer_address",
"fieldtype": "Link",
"in_filter": 1,
"label": "Select Shipping Address",
"label": "Billing Address Name",
"options": "Address",
"print_hide": 1,
"read_only": 1
@@ -112,6 +112,22 @@
"fieldname": "address_display",
"fieldtype": "Small Text",
"hidden": 1,
"label": "Billing Address",
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "shipping_address_name",
"fieldtype": "Link",
"label": "Shipping Address Name",
"options": "Address",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "shipping_address",
"fieldtype": "Small Text",
"hidden": 1,
"label": "Shipping Address",
"read_only": 1
},

View File

@@ -94,6 +94,20 @@ class DocType(BuyingController):
if exists:
webnotes.msgprint("Another Purchase Receipt using the same Challan No. already exists.\
Please enter a valid Challan No.", raise_exception=1)
def validate_with_previous_doc(self):
super(DocType, self).validate_with_previous_doc(self.tname, {
"Purchase Order": {
"ref_dn_field": "prevdoc_docname",
"compare_fields": [["supplier", "="], ["company", "="], ["currency", "="]],
},
"Purchase Order Item": {
"ref_dn_field": "prevdoc_detail_docname",
"compare_fields": [["export_rate", "="], ["project_name", "="], ["warehouse", "="],
["uom", "="], ["item_code", "="]],
"is_child_table": True
}
})
def po_required(self):
if webnotes.conn.get_single_value("Buying Settings", "po_required") == 'Yes':
@@ -114,6 +128,7 @@ class DocType(BuyingController):
import utilities
utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Cancelled"])
self.validate_with_previous_doc()
self.validate_accepted_rejected_qty()
self.validate_inspection() # Validate Inspection
get_obj('Stock Ledger').validate_serial_no(self, 'purchase_receipt_details')
@@ -122,7 +137,6 @@ class DocType(BuyingController):
pc_obj = get_obj(dt='Purchase Common')
pc_obj.validate_for_items(self)
pc_obj.get_prevdoc_date(self)
pc_obj.validate_reference_value(self)
self.check_for_stopped_status(pc_obj)
# sub-contracting