diff --git a/buying/doctype/purchase_common/purchase_common.py b/buying/doctype/purchase_common/purchase_common.py index 1d57f889100..8637e5fb43a 100644 --- a/buying/doctype/purchase_common/purchase_common.py +++ b/buying/doctype/purchase_common/purchase_common.py @@ -189,10 +189,3 @@ class DocType(BuyingController): if not submitted: msgprint(cstr(doctype) + ": " + cstr(submitted[0][0]) + _(" not submitted"), raise_exception=1) - - def get_prevdoc_date(self, obj): - for d in getlist(obj.doclist, obj.fname): - if d.prevdoc_doctype and d.prevdoc_docname: - dt = webnotes.conn.sql("select transaction_date from `tab%s` where name = %s" - % (d.prevdoc_doctype, '%s'), (d.prevdoc_docname)) - d.prevdoc_date = dt and dt[0][0].strftime('%Y-%m-%d') or '' \ No newline at end of file diff --git a/buying/doctype/purchase_order/purchase_order.js b/buying/doctype/purchase_order/purchase_order.js index 9967f15a50b..f32f11a2a6e 100644 --- a/buying/doctype/purchase_order/purchase_order.js +++ b/buying/doctype/purchase_order/purchase_order.js @@ -185,9 +185,9 @@ cur_frm.pformat.indent_no = function(doc, cdt, cdn){ if(cl[i].prevdoc_doctype == 'Material Request' && cl[i].prevdoc_docname && prevdoc_list.indexOf(cl[i].prevdoc_docname) == -1) { prevdoc_list.push(cl[i].prevdoc_docname); if(prevdoc_list.length ==1) - out += make_row(cl[i].prevdoc_doctype, cl[i].prevdoc_docname, cl[i].prevdoc_date,0); + out += make_row(cl[i].prevdoc_doctype, cl[i].prevdoc_docname, null,0); else - out += make_row('', cl[i].prevdoc_docname, cl[i].prevdoc_date,0); + out += make_row('', cl[i].prevdoc_docname,null,0); } } } diff --git a/buying/doctype/purchase_order/purchase_order.py b/buying/doctype/purchase_order/purchase_order.py index dc75466a4be..cf207bb7477 100644 --- a/buying/doctype/purchase_order/purchase_order.py +++ b/buying/doctype/purchase_order/purchase_order.py @@ -41,7 +41,6 @@ class DocType(BuyingController): pc_obj = get_obj(dt='Purchase Common') pc_obj.validate_for_items(self) - pc_obj.get_prevdoc_date(self) self.check_for_stopped_status(pc_obj) self.validate_uom_is_integer("uom", "qty") diff --git a/buying/doctype/purchase_order_item/purchase_order_item.txt b/buying/doctype/purchase_order_item/purchase_order_item.txt index 36b81d2c1fc..fade98fa980 100755 --- a/buying/doctype/purchase_order_item/purchase_order_item.txt +++ b/buying/doctype/purchase_order_item/purchase_order_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 19:29:06", "docstatus": 0, - "modified": "2013-08-07 14:44:12", + "modified": "2013-10-10 17:01:57", "modified_by": "Administrator", "owner": "Administrator" }, @@ -306,21 +306,6 @@ "search_index": 1, "width": "120px" }, - { - "doctype": "DocField", - "fieldname": "prevdoc_date", - "fieldtype": "Date", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Material Request Date", - "no_copy": 1, - "oldfieldname": "prevdoc_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 1, - "search_index": 0 - }, { "doctype": "DocField", "fieldname": "prevdoc_detail_docname", diff --git a/buying/doctype/supplier_quotation/supplier_quotation.py b/buying/doctype/supplier_quotation/supplier_quotation.py index c3d2f78451a..8c5224e30ac 100644 --- a/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/buying/doctype/supplier_quotation/supplier_quotation.py @@ -54,7 +54,6 @@ class DocType(BuyingController): def validate_common(self): pc = get_obj('Purchase Common') pc.validate_for_items(self) - pc.get_prevdoc_date(self) @webnotes.whitelist() def make_purchase_order(source_name, target_doclist=None): diff --git a/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt index 1d162915ef4..515cdb2a34f 100644 --- a/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt +++ b/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-22 12:43:10", "docstatus": 0, - "modified": "2013-08-07 14:44:18", + "modified": "2013-10-10 17:02:11", "modified_by": "Administrator", "owner": "Administrator" }, @@ -259,21 +259,6 @@ "search_index": 1, "width": "120px" }, - { - "doctype": "DocField", - "fieldname": "prevdoc_date", - "fieldtype": "Date", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Material Request Date", - "no_copy": 1, - "oldfieldname": "prevdoc_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 1, - "search_index": 0 - }, { "doctype": "DocField", "fieldname": "prevdoc_detail_docname", diff --git a/controllers/buying_controller.py b/controllers/buying_controller.py index 3de550c4c27..2e55aee1357 100644 --- a/controllers/buying_controller.py +++ b/controllers/buying_controller.py @@ -14,6 +14,7 @@ from controllers.stock_controller import StockController class WrongWarehouseCompany(Exception): pass class BuyingController(StockController): + def onload_post_render(self): # contact, address, item details self.set_missing_values() @@ -280,6 +281,3 @@ class BuyingController(StockController): (", ".join((["%s"]*len(item_codes))),), item_codes)] return self._purchase_items - - def get_bin_details(self, arg): - return {"projected_qty": webnotes.conn.get_value("Bin", json.loads(arg), "projected_qty") or 0 } diff --git a/selling/doctype/installation_note/installation_note.py b/selling/doctype/installation_note/installation_note.py index ca47043e28c..02b724719c1 100644 --- a/selling/doctype/installation_note/installation_note.py +++ b/selling/doctype/installation_note/installation_note.py @@ -38,7 +38,6 @@ class DocType(TransactionBase): self.check_item_table() sales_com_obj = get_obj(dt = 'Sales Common') sales_com_obj.check_active_sales_items(self) - sales_com_obj.get_prevdoc_date(self) def validate_fiscal_year(self): from accounts.utils import validate_fiscal_year diff --git a/selling/doctype/installation_note_item/installation_note_item.txt b/selling/doctype/installation_note_item/installation_note_item.txt index 02871ad7343..7435d461b41 100644 --- a/selling/doctype/installation_note_item/installation_note_item.txt +++ b/selling/doctype/installation_note_item/installation_note_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-02-22 01:27:51", "docstatus": 0, - "modified": "2013-07-10 14:54:09", + "modified": "2013-10-10 17:02:31", "modified_by": "Administrator", "owner": "Administrator" }, @@ -48,18 +48,6 @@ "read_only": 1, "width": "300px" }, - { - "doctype": "DocField", - "fieldname": "prevdoc_date", - "fieldtype": "Date", - "hidden": 0, - "in_list_view": 1, - "label": "Delivery Date", - "oldfieldname": "prevdoc_date", - "oldfieldtype": "Date", - "print_hide": 0, - "read_only": 1 - }, { "doctype": "DocField", "fieldname": "serial_no", diff --git a/selling/doctype/sales_common/sales_common.py b/selling/doctype/sales_common/sales_common.py index 634ea2a3702..01718dd3f0b 100644 --- a/selling/doctype/sales_common/sales_common.py +++ b/selling/doctype/sales_common/sales_common.py @@ -298,25 +298,6 @@ class DocType(TransactionBase): exact_outstanding = flt(tot_outstanding) + flt(grand_total) get_obj('Account',acc_head[0][0]).check_credit_limit(acc_head[0][0], obj.doc.company, exact_outstanding) - def get_prevdoc_date(self, obj): - for d in getlist(obj.doclist, obj.fname): - date_field = None - - pdoctype, pname = d.prevdoc_doctype, d.prevdoc_docname - - if d.against_sales_invoice: - pdoctype, pname = "Sales Invoice", d.against_sales_invoice - elif d.against_sales_order: - pdoctype, pname = "Sales Order", d.against_sales_order - - if pdoctype and pname: - if pdoctype in ["Sales Invoice", "Delivery Note"]: - date_field = "posting_date" - else: - date_field = "transaction_date" - - d.prevdoc_date = webnotes.conn.get_value(pdoctype, pname, date_field) - def get_batch_no(doctype, txt, searchfield, start, page_len, filters): from controllers.queries import get_match_cond diff --git a/stock/doctype/delivery_note/delivery_note.js b/stock/doctype/delivery_note/delivery_note.js index edfd6ff7db2..29b3e47b32e 100644 --- a/stock/doctype/delivery_note/delivery_note.js +++ b/stock/doctype/delivery_note/delivery_note.js @@ -184,9 +184,9 @@ cur_frm.pformat.sales_order_no= function(doc, cdt, cdn){ if(cl[i].against_sales_order && prevdoc_list.indexOf(cl[i].against_sales_order) == -1) { prevdoc_list.push(cl[i].against_sales_order); if(prevdoc_list.length ==1) - out += make_row("Sales Order", cl[i].against_sales_order, cl[i].prevdoc_date, 0); + out += make_row("Sales Order", cl[i].against_sales_order, null, 0); else - out += make_row('', cl[i].against_sales_order, cl[i].prevdoc_date,0); + out += make_row('', cl[i].against_sales_order, null,0); } } } diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index 281908598fb..deaf024a2ea 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -86,7 +86,6 @@ class DocType(SellingController): sales_com_obj = get_obj(dt = 'Sales Common') sales_com_obj.check_stop_sales_order(self) sales_com_obj.check_active_sales_items(self) - sales_com_obj.get_prevdoc_date(self) self.validate_for_items() self.validate_warehouse() self.validate_uom_is_integer("stock_uom", "qty") @@ -366,7 +365,6 @@ def make_sales_invoice(source_name, target_doclist=None): def make_installation_note(source_name, target_doclist=None): def update_item(obj, target, source_parent): target.qty = flt(obj.qty) - flt(obj.installed_qty) - target.prevdoc_date = source_parent.posting_date target.serial_no = obj.serial_no doclist = get_mapped_doclist("Delivery Note", source_name, { diff --git a/stock/doctype/delivery_note_item/delivery_note_item.txt b/stock/doctype/delivery_note_item/delivery_note_item.txt index 4162187fdcd..8d1792d7c14 100644 --- a/stock/doctype/delivery_note_item/delivery_note_item.txt +++ b/stock/doctype/delivery_note_item/delivery_note_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-04-22 13:15:44", "docstatus": 0, - "modified": "2013-10-03 11:09:48", + "modified": "2013-10-10 17:03:11", "modified_by": "Administrator", "owner": "Administrator" }, @@ -362,19 +362,6 @@ "label": "Against Sales Invoice", "options": "Sales Invoice" }, - { - "doctype": "DocField", - "fieldname": "prevdoc_date", - "fieldtype": "Date", - "hidden": 1, - "in_filter": 1, - "label": "Against Document Date", - "no_copy": 1, - "oldfieldname": "prevdoc_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 1 - }, { "doctype": "DocField", "fieldname": "prevdoc_detail_docname", diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/stock/doctype/purchase_receipt/purchase_receipt.py index 1e1f1eaf869..2dd450febb9 100644 --- a/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/stock/doctype/purchase_receipt/purchase_receipt.py @@ -59,7 +59,6 @@ class DocType(BuyingController): pc_obj = get_obj(dt='Purchase Common') pc_obj.validate_for_items(self) - pc_obj.get_prevdoc_date(self) self.check_for_stopped_status(pc_obj) # sub-contracting diff --git a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt index ce491689ec6..9c0d0fbb11c 100755 --- a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt +++ b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 19:29:10", "docstatus": 0, - "modified": "2013-09-20 11:36:55", + "modified": "2013-10-10 17:02:51", "modified_by": "Administrator", "owner": "Administrator" }, @@ -424,19 +424,6 @@ "search_index": 1, "width": "150px" }, - { - "doctype": "DocField", - "fieldname": "prevdoc_date", - "fieldtype": "Date", - "hidden": 1, - "in_filter": 1, - "label": "Purchase Order Date", - "no_copy": 1, - "oldfieldname": "prevdoc_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 1 - }, { "doctype": "DocField", "fieldname": "rm_supp_cost",