Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/webnotes/erpnext into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
trhura committed Jan 28, 2014
2 parents 2e67426 + 7349c19 commit d7f3d63
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"app_name": "ERPNext",
"app_version": "3.6.6",
"app_version": "3.7.1",
"base_template": "app/portal/templates/base.html",
"modules": {
"Accounts": {
Expand Down Expand Up @@ -74,5 +74,5 @@
"type": "module"
}
},
"requires_framework_version": "==3.7.5"
"requires_framework_version": "==3.8.0"
}
13 changes: 13 additions & 0 deletions patches/1401/fix_planned_qty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

import webnotes

def execute():
webnotes.conn.auto_commit_on_many_writes = 1
from utilities.repost_stock import repost_stock
for d in webnotes.conn.sql("""select distinct production_item, fg_warehouse
from `tabProduction Order` where docstatus>0""", as_dict=1):
repost_stock(d.production_item, d.fg_warehouse)

webnotes.conn.auto_commit_on_many_writes = 0
17 changes: 17 additions & 0 deletions patches/1401/fix_serial_no_status_and_warehouse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import webnotes

def execute():
serial_nos = webnotes.conn.sql("""select name from `tabSerial No` where docstatus=0
and status in ('Available', 'Sales Returned') and ifnull(warehouse, '') = ''""")
for sr in serial_nos:
try:
sr_bean = webnotes.bean("Serial No", sr[0])
sr_bean.make_controller().via_stock_ledger = True
sr_bean.save()
webnotes.conn.commit()
except:
pass
2 changes: 2 additions & 0 deletions patches/patch_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,6 @@
"patches.1401.p01_make_buying_selling_as_check_box_in_price_list",
"patches.1401.update_billing_status_for_zero_value_order",
"patches.1401.enable_all_price_list",
"patches.1401.fix_serial_no_status_and_warehouse",
"patches.1401.fix_planned_qty",
]
3 changes: 2 additions & 1 deletion stock/doctype/price_list/price_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"creation": "2013-01-25 11:35:09",
"docstatus": 0,
"modified": "2014-01-17 13:29:39",
"modified": "2014-01-27 11:11:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
Expand All @@ -11,6 +11,7 @@
"allow_copy": 0,
"allow_email": 1,
"allow_print": 1,
"allow_rename": 1,
"autoname": "field:price_list_name",
"description": "Price List Master",
"doctype": "DocType",
Expand Down
11 changes: 7 additions & 4 deletions stock/doctype/serial_no/serial_no.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,17 @@ def set_status(self, last_sle):
self.doc.status = "Sales Returned"
else:
self.doc.status = "Available"
if not self.doc.warehouse:
self.doc.warehouse = last_sle.warehouse
else:
if document_type == "Purchase Return":
self.doc.status = "Purchase Returned"
elif last_sle.voucher_type in ("Delivery Note", "Sales Invoice"):
self.doc.status = "Delivered"
else:
self.doc.status = "Not Available"
else:
self.doc.status = "Not Available"

def set_purchase_details(self, purchase_sle):
if purchase_sle:
Expand Down Expand Up @@ -185,10 +189,9 @@ def after_rename(self, old, new, merge=False):
def on_stock_ledger_entry(self):
if self.via_stock_ledger and not self.doc.fields.get("__islocal"):
last_sle = self.get_last_sle()
if last_sle:
self.set_status(last_sle.get("last_sle"))
self.set_purchase_details(last_sle.get("purchase_sle"))
self.set_sales_details(last_sle.get("delivery_sle"))
self.set_status(last_sle.get("last_sle"))
self.set_purchase_details(last_sle.get("purchase_sle"))
self.set_sales_details(last_sle.get("delivery_sle"))

def on_communication(self):
return
Expand Down
3 changes: 2 additions & 1 deletion stock/doctype/stock_entry/stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ def _validate_production_order(pro_bean):
pro_bean = webnotes.bean("Production Order", self.doc.production_order)
_validate_production_order(pro_bean)
self.update_produced_qty(pro_bean)
self.update_planned_qty(pro_bean)
if self.doc.purpose == "Manufacture/Repack":
self.update_planned_qty(pro_bean)

def update_produced_qty(self, pro_bean):
if self.doc.purpose == "Manufacture/Repack":
Expand Down

0 comments on commit d7f3d63

Please sign in to comment.