Merge branch 'develop'
This commit is contained in:
commit
943dc1f59c
@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '5.0.27'
|
__version__ = '5.0.28'
|
||||||
|
1
erpnext/change_log/v5/v5_0_28.md
Normal file
1
erpnext/change_log/v5/v5_0_28.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
- Open notification of Sales Order and Purchase Order based on whether Invoice is created against them. For eg. If a Sales Order is not Invoiced, it will be considered as open. Previously it was considered open if Delivery Note was created against Sales Order.
|
@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
|
|||||||
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "5.0.27"
|
app_version = "5.0.28"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ def get_notification_config():
|
|||||||
"Contact": {"status": "Open"},
|
"Contact": {"status": "Open"},
|
||||||
"Opportunity": {"status": "Open"},
|
"Opportunity": {"status": "Open"},
|
||||||
"Quotation": {"docstatus": 0},
|
"Quotation": {"docstatus": 0},
|
||||||
"Sales Order": { "per_delivered": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
"Sales Order": { "per_billed": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
||||||
"Journal Entry": {"docstatus": 0},
|
"Journal Entry": {"docstatus": 0},
|
||||||
"Sales Invoice": { "outstanding_amount": (">", 0), "docstatus": ("<", 2) },
|
"Sales Invoice": { "outstanding_amount": (">", 0), "docstatus": ("<", 2) },
|
||||||
"Purchase Invoice": {"docstatus": 0},
|
"Purchase Invoice": {"docstatus": 0},
|
||||||
@ -25,7 +25,7 @@ def get_notification_config():
|
|||||||
"Delivery Note": {"docstatus": 0},
|
"Delivery Note": {"docstatus": 0},
|
||||||
"Stock Entry": {"docstatus": 0},
|
"Stock Entry": {"docstatus": 0},
|
||||||
"Material Request": {"docstatus": 0},
|
"Material Request": {"docstatus": 0},
|
||||||
"Purchase Order": { "per_received": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
"Purchase Order": { "per_billed": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
||||||
"Production Order": { "status": "In Process" },
|
"Production Order": { "status": "In Process" },
|
||||||
"BOM": {"docstatus": 0},
|
"BOM": {"docstatus": 0},
|
||||||
"Timesheet": {"docstatus": 0},
|
"Timesheet": {"docstatus": 0},
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
import frappe.defaults
|
import frappe.defaults
|
||||||
|
|
||||||
from frappe.utils import cstr, cint, flt, comma_or, get_datetime
|
from frappe.utils import cstr, cint, flt, comma_or, get_datetime, getdate
|
||||||
|
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from erpnext.stock.utils import get_incoming_rate
|
from erpnext.stock.utils import get_incoming_rate
|
||||||
@ -66,6 +66,7 @@ class StockEntry(StockController):
|
|||||||
self.validate_valuation_rate()
|
self.validate_valuation_rate()
|
||||||
self.set_total_incoming_outgoing_value()
|
self.set_total_incoming_outgoing_value()
|
||||||
self.set_total_amount()
|
self.set_total_amount()
|
||||||
|
self.validate_batch()
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.update_stock_ledger()
|
self.update_stock_ledger()
|
||||||
@ -359,8 +360,11 @@ class StockEntry(StockController):
|
|||||||
if self.purpose == "Subcontract" and self.purchase_order:
|
if self.purpose == "Subcontract" and self.purchase_order:
|
||||||
purchase_order = frappe.get_doc("Purchase Order", self.purchase_order)
|
purchase_order = frappe.get_doc("Purchase Order", self.purchase_order)
|
||||||
for se_item in self.items:
|
for se_item in self.items:
|
||||||
total_allowed = [d.required_qty for d in purchase_order.supplied_items \
|
total_allowed = sum([flt(d.required_qty) for d in purchase_order.supplied_items \
|
||||||
if d.rm_item_code == se_item.item_code][0]
|
if d.rm_item_code == se_item.item_code])
|
||||||
|
if not total_allowed:
|
||||||
|
frappe.throw(_("Item {0} not found in 'Raw Materials Supplied' table in Purchase Order {1}")
|
||||||
|
.format(se_item.item_code, self.purchase_order))
|
||||||
total_supplied = frappe.db.sql("""select sum(qty)
|
total_supplied = frappe.db.sql("""select sum(qty)
|
||||||
from `tabStock Entry Detail`, `tabStock Entry`
|
from `tabStock Entry Detail`, `tabStock Entry`
|
||||||
where `tabStock Entry`.purchase_order = %s
|
where `tabStock Entry`.purchase_order = %s
|
||||||
@ -722,6 +726,13 @@ class StockEntry(StockController):
|
|||||||
frappe.throw(_("Item or Warehouse for row {0} does not match Material Request").format(item.idx),
|
frappe.throw(_("Item or Warehouse for row {0} does not match Material Request").format(item.idx),
|
||||||
frappe.MappingMismatchError)
|
frappe.MappingMismatchError)
|
||||||
|
|
||||||
|
def validate_batch(self):
|
||||||
|
if self.purpose == "Material Transfer for Manufacture":
|
||||||
|
for item in self.get("items"):
|
||||||
|
if item.batch_no:
|
||||||
|
if getdate(self.posting_date) > getdate(frappe.db.get_value("Batch", item.batch_no, "expiry_date")):
|
||||||
|
frappe.throw(_("Batch {0} of Item {1} has expired.").format(item.batch_no, item.item_code))
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_party_details(ref_dt, ref_dn):
|
def get_party_details(ref_dt, ref_dn):
|
||||||
if ref_dt in ["Delivery Note", "Sales Invoice"]:
|
if ref_dt in ["Delivery Note", "Sales Invoice"]:
|
||||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
version = "5.0.27"
|
version = "5.0.28"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
Loading…
Reference in New Issue
Block a user