[sales invoice] [update stock] allow update stock in sales invoice, without it being a pos invoice

This commit is contained in:
Anand Doshi
2013-05-30 17:43:30 +05:30
parent c6f890f892
commit ecc28f0311
12 changed files with 115 additions and 101 deletions

View File

@@ -285,11 +285,10 @@ class DocType(StockController):
+ _("Status should be Submitted"), raise_exception=webnotes.InvalidStatusError)
# update stock check
if ref.doclist[0].doctype == "Sales Invoice" and (cint(ref.doclist[0].is_pos) != 1 \
or cint(ref.doclist[0].update_stock) != 1):
webnotes.msgprint(_(ref.doclist[0].doctype) + ' "' + ref.doclist[0].name + '": '
+ _("Is POS and Update Stock should be checked."),
raise_exception=NotUpdateStockError)
if ref.doclist[0].doctype == "Sales Invoice" and cint(ref.doclist[0].update_stock) != 1:
webnotes.msgprint(_(ref.doclist[0].doctype) + ' "' + ref.doclist[0].name + '": '
+ _("Update Stock should be checked."),
raise_exception=NotUpdateStockError)
# posting date check
ref_posting_datetime = "%s %s" % (cstr(ref.doclist[0].posting_date),
@@ -684,7 +683,7 @@ def get_production_order_details(production_order):
def query_sales_return_doc(doctype, txt, searchfield, start, page_len, filters):
conditions = ""
if doctype == "Sales Invoice":
conditions = "and is_pos=1 and update_stock=1"
conditions = "and update_stock=1"
return webnotes.conn.sql("""select name, customer, customer_name
from `tab%s` where docstatus = 1