Target Warehouse in Delivery Note and Sales Invoice and removed Serial No status

This commit is contained in:
Nabin Hait
2015-09-21 09:18:43 +05:30
parent adcaf75bb0
commit c865f229fb
17 changed files with 291 additions and 183 deletions

View File

@@ -214,8 +214,7 @@ def set_stock_balance_as_per_serial_no(item_code=None, posting_date=None, postin
def reset_serial_no_status_and_warehouse(serial_nos=None):
if not serial_nos:
serial_nos = frappe.db.sql_list("""select name from `tabSerial No` where status != 'Not in Use'
and docstatus = 0""")
serial_nos = frappe.db.sql_list("""select name from `tabSerial No` where docstatus = 0""")
for serial_no in serial_nos:
try:
sr = frappe.get_doc("Serial No", serial_no)
@@ -228,8 +227,6 @@ def reset_serial_no_status_and_warehouse(serial_nos=None):
except:
pass
frappe.db.sql("""update `tabSerial No` set warehouse='' where status in ('Delivered', 'Purchase Returned')""")
def repost_all_stock_vouchers():
warehouses_with_account = frappe.db.sql_list("""select master_name from tabAccount
where ifnull(account_type, '') = 'Warehouse'""")