mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 23:19:20 +00:00
Merge branch 'responsive' of github.com:webnotes/erpnext into responsive
This commit is contained in:
@@ -52,7 +52,6 @@ class DocType(TransactionBase):
|
||||
sales_com_obj = get_obj(dt = 'Sales Common')
|
||||
sales_com_obj.check_active_sales_items(self)
|
||||
sales_com_obj.get_prevdoc_date(self)
|
||||
self.validate_reference_value()
|
||||
|
||||
def validate_prev_docname(self):
|
||||
for d in getlist(self.doclist, 'installed_item_details'):
|
||||
@@ -63,9 +62,6 @@ class DocType(TransactionBase):
|
||||
def validate_fiscal_year(self):
|
||||
get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year, self.doc.inst_date,
|
||||
'Installation Date')
|
||||
|
||||
def validate_reference_value(self):
|
||||
pass
|
||||
|
||||
def is_serial_no_added(self, item_code, serial_no):
|
||||
ar_required = webnotes.conn.get_value("Item", item_code, "has_serial_no")
|
||||
|
||||
@@ -173,6 +173,8 @@ class DocType(SellingController):
|
||||
sales_com_obj.validate_max_discount(self,'sales_order_details')
|
||||
self.doclist = sales_com_obj.make_packing_list(self,'sales_order_details')
|
||||
|
||||
self.validate_with_previous_doc()
|
||||
|
||||
if not self.doc.status:
|
||||
self.doc.status = "Draft"
|
||||
|
||||
@@ -183,6 +185,15 @@ class DocType(SellingController):
|
||||
if not self.doc.billing_status: self.doc.billing_status = 'Not Billed'
|
||||
if not self.doc.delivery_status: self.doc.delivery_status = 'Not Delivered'
|
||||
|
||||
def validate_with_previous_doc(self):
|
||||
super(DocType, self).validate_with_previous_doc(self.tname, {
|
||||
"Quotation": {
|
||||
"ref_dn_field": "prevdoc_docname",
|
||||
"compare_fields": [["customer", "="], ["company", "="], ["currency", "="]]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
def check_prev_docstatus(self):
|
||||
for d in getlist(self.doclist, 'sales_order_details'):
|
||||
cancel_quo = sql("select name from `tabQuotation` where docstatus = 2 and name = '%s'" % d.prevdoc_docname)
|
||||
|
||||
Reference in New Issue
Block a user