fixes in Production Order
This commit is contained in:
parent
1ca0b74e03
commit
6f272f2f53
@ -59,12 +59,12 @@ erpnext.production_order = {
|
||||
var doc = frm.doc;
|
||||
if (doc.docstatus === 1) {
|
||||
|
||||
if (flt(doc.material_transferred_for_qty) < flt(doc.qty)) {
|
||||
if (flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) {
|
||||
frm.add_custom_button(__('Transfer Materials for Manufacture'),
|
||||
cur_frm.cscript['Transfer Raw Materials'], frappe.boot.doctype_icons["Stock Entry"]);
|
||||
}
|
||||
|
||||
if (flt(doc.produced_qty) < flt(doc.material_transferred_for_qty)) {
|
||||
if (flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) {
|
||||
frm.add_custom_button(__('Update Finished Goods'),
|
||||
cur_frm.cscript['Update Finished Goods'], frappe.boot.doctype_icons["Stock Entry"]);
|
||||
}
|
||||
@ -160,8 +160,8 @@ $.extend(cur_frm.cscript, {
|
||||
make_se: function(purpose) {
|
||||
var me = this;
|
||||
var max = (purpose === "Manufacture") ?
|
||||
flt(this.frm.doc.material_transferred_for_qty) - flt(this.frm.doc.produced_qty) :
|
||||
flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_qty);
|
||||
flt(this.frm.doc.qty) - flt(this.frm.doc.produced_qty) :
|
||||
flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
|
||||
|
||||
frappe.prompt({fieldtype:"Int", label: __("Qty for {0}", [purpose]), fieldname:"qty",
|
||||
description: __("Max: {0}", [max]) },
|
||||
|
@ -94,10 +94,13 @@
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:doc.docstatus==1",
|
||||
"description": "",
|
||||
"fieldname": "material_transferred_for_qty",
|
||||
"fieldtype": "Int",
|
||||
"label": "Material Transferred for Qty",
|
||||
"fieldname": "material_transferred_for_manufacturing",
|
||||
"fieldtype": "Float",
|
||||
"label": "Material Transferred for Manufacturing",
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"read_only": 1
|
||||
@ -352,7 +355,7 @@
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-03-09 15:28:12.535414",
|
||||
"modified": "2015-03-10 17:02:28.401930",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Manufacturing",
|
||||
"name": "Production Order",
|
||||
|
@ -124,8 +124,9 @@ class ProductionOrder(Document):
|
||||
def update_production_order_qty(self):
|
||||
"""Update **Manufactured Qty** and **Material Transferred for Qty** in Production Order
|
||||
based on Stock Entry"""
|
||||
print "call"
|
||||
for purpose, fieldname in (("Manufacture", "produced_qty"),
|
||||
("Material Transfer for Manufacture", "material_transferred_for_qty")):
|
||||
("Material Transfer for Manufacture", "material_transferred_for_manufacturing")):
|
||||
qty = flt(frappe.db.sql("""select sum(fg_completed_qty)
|
||||
from `tabStock Entry` where production_order=%s and docstatus=1
|
||||
and purpose=%s""", (self.name, purpose))[0][0])
|
||||
|
@ -118,7 +118,7 @@ erpnext.patches.v5_0.rename_customer_issue
|
||||
erpnext.patches.v5_0.update_material_transfer_for_manufacture
|
||||
erpnext.patches.v5_0.manufacturing_activity_type
|
||||
erpnext.patches.v5_0.update_item_description_and_image
|
||||
erpnext.patches.v5_0.update_material_transferred_for_qty
|
||||
erpnext.patches.v5_0.update_material_transferred_for_manufacturing
|
||||
erpnext.patches.v5_0.stock_entry_update_value
|
||||
erpnext.patches.v5_0.convert_stock_reconciliation
|
||||
erpnext.patches.v5_0.update_projects
|
||||
|
@ -2,7 +2,7 @@ import frappe
|
||||
|
||||
def execute():
|
||||
frappe.reload_doctype("Production Order")
|
||||
frappe.db.sql("""update `tabProduction Order` set material_transferred_for_qty=
|
||||
frappe.db.sql("""update `tabProduction Order` set material_transferred_for_manufacturing=
|
||||
(select sum(fg_completed_qty) from `tabStock Entry`
|
||||
where docstatus=1
|
||||
and production_order=`tabProduction Order`.name
|
||||
|
@ -135,10 +135,12 @@
|
||||
{
|
||||
"fieldname": "operation_id",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"label": "Operation ID",
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
@ -242,7 +244,7 @@
|
||||
"icon": "icon-time",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-02-26 02:22:10.312376",
|
||||
"modified": "2015-03-10 17:07:35.506886",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Time Log",
|
||||
|
@ -470,7 +470,7 @@ class StockEntry(StockController):
|
||||
pro_doc = frappe.get_doc("Production Order", self.production_order)
|
||||
_validate_production_order(pro_doc)
|
||||
pro_doc.run_method("update_status")
|
||||
if self.purpose in "Manufacture":
|
||||
if self.purpose in ["Material Transfer for Manufacture","Manufacture"]:
|
||||
pro_doc.run_method("update_production_order_qty")
|
||||
self.update_planned_qty(pro_doc)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user