Fixes in Production Planning Tool
This commit is contained in:
parent
dcef448f1e
commit
fe2ffaeafa
@ -369,15 +369,15 @@ cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.income_account = function(doc, cdt, cdn) {
|
cur_frm.cscript.income_account = function(doc, cdt, cdn) {
|
||||||
cur_frm.cscript.copy_account_in_all_row(doc, cdt, cdn, "income_account");
|
erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "income_account");
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.expense_account = function(doc, cdt, cdn) {
|
cur_frm.cscript.expense_account = function(doc, cdt, cdn) {
|
||||||
cur_frm.cscript.copy_account_in_all_row(doc, cdt, cdn, "expense_account");
|
erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "expense_account");
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.cost_center = function(doc, cdt, cdn) {
|
cur_frm.cscript.cost_center = function(doc, cdt, cdn) {
|
||||||
cur_frm.cscript.copy_account_in_all_row(doc, cdt, cdn, "cost_center");
|
erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "cost_center");
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
|
@ -83,8 +83,7 @@ def set_contact_details(out, party, party_type):
|
|||||||
"contact_designation": None,
|
"contact_designation": None,
|
||||||
"contact_department": None
|
"contact_department": None
|
||||||
})
|
})
|
||||||
return
|
else:
|
||||||
|
|
||||||
out.update(get_contact_details(out.contact_person))
|
out.update(get_contact_details(out.contact_person))
|
||||||
|
|
||||||
def set_other_values(out, party, party_type):
|
def set_other_values(out, party, party_type):
|
||||||
|
@ -249,7 +249,7 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
|||||||
|
|
||||||
|
|
||||||
cur_frm.cscript.schedule_date = function(doc, cdt, cdn) {
|
cur_frm.cscript.schedule_date = function(doc, cdt, cdn) {
|
||||||
cur_frm.cscript.copy_account_in_all_row(doc, cdt, cdn, "schedule_date");
|
erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "schedule_date");
|
||||||
}
|
}
|
||||||
|
|
||||||
frappe.provide("erpnext.buying");
|
frappe.provide("erpnext.buying");
|
||||||
|
@ -43,12 +43,13 @@
|
|||||||
"width": "100px"
|
"width": "100px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "now",
|
"default": "",
|
||||||
"fieldname": "planned_start_date",
|
"fieldname": "planned_start_date",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"label": "Planned Start Date",
|
"label": "Planned Start Date",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": ""
|
"precision": "",
|
||||||
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "sales_order",
|
"fieldname": "sales_order",
|
||||||
@ -112,7 +113,7 @@
|
|||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"modified": "2015-07-07 07:52:40.883761",
|
"modified": "2015-07-08 07:12:11.211808",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Production Plan Item",
|
"name": "Production Plan Item",
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
// License: GNU General Public License v3. See license.txt
|
// License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
frappe.require("assets/erpnext/js/utils.js");
|
||||||
|
|
||||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||||
cur_frm.set_value("company", frappe.defaults.get_user_default("company"))
|
cur_frm.set_value("company", frappe.defaults.get_user_default("company"))
|
||||||
cur_frm.set_value("use_multi_level_bom", 1)
|
cur_frm.set_value("use_multi_level_bom", 1)
|
||||||
@ -72,3 +74,7 @@ cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
|||||||
|
|
||||||
cur_frm.fields_dict.sales_orders.grid.get_field("customer").get_query =
|
cur_frm.fields_dict.sales_orders.grid.get_field("customer").get_query =
|
||||||
cur_frm.fields_dict.customer.get_query;
|
cur_frm.fields_dict.customer.get_query;
|
||||||
|
|
||||||
|
cur_frm.cscript.planned_start_date = function(doc, cdt, cdn) {
|
||||||
|
erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "planned_start_date");
|
||||||
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.utils import cstr, flt, cint, nowdate, now, add_days, comma_and
|
from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and
|
||||||
|
|
||||||
from frappe import msgprint, _
|
from frappe import msgprint, _
|
||||||
|
|
||||||
@ -153,7 +153,6 @@ class ProductionPlanningTool(Document):
|
|||||||
pi.bom_no = item_details and item_details[0][2] or ''
|
pi.bom_no = item_details and item_details[0][2] or ''
|
||||||
pi.so_pending_qty = flt(p['pending_qty'])
|
pi.so_pending_qty = flt(p['pending_qty'])
|
||||||
pi.planned_qty = flt(p['pending_qty'])
|
pi.planned_qty = flt(p['pending_qty'])
|
||||||
pi.planned_start_date = now()
|
|
||||||
|
|
||||||
def validate_data(self):
|
def validate_data(self):
|
||||||
self.validate_company()
|
self.validate_company()
|
||||||
|
@ -70,16 +70,5 @@ erpnext.stock.StockController = frappe.ui.form.Controller.extend({
|
|||||||
frappe.set_route("query-report", "General Ledger");
|
frappe.set_route("query-report", "General Ledger");
|
||||||
}, "icon-table");
|
}, "icon-table");
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
copy_account_in_all_row: function(doc, dt, dn, fieldname) {
|
|
||||||
var d = locals[dt][dn];
|
|
||||||
if(d[fieldname]){
|
|
||||||
var cl = doc["items"] || [];
|
|
||||||
for(var i = 0; i < cl.length; i++) {
|
|
||||||
if(!cl[i][fieldname]) cl[i][fieldname] = d[fieldname];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
refresh_field("items");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -131,6 +131,17 @@ $.extend(erpnext.utils, {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
copy_value_in_all_row: function(doc, dt, dn, table_fieldname, fieldname) {
|
||||||
|
var d = locals[dt][dn];
|
||||||
|
if(d[fieldname]){
|
||||||
|
var cl = doc[table_fieldname] || [];
|
||||||
|
for(var i = 0; i < cl.length; i++) {
|
||||||
|
if(!cl[i][fieldname]) cl[i][fieldname] = d[fieldname];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
refresh_field(table_fieldname);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -519,11 +519,11 @@ cur_frm.cscript.validate_items = function(doc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.expense_account = function(doc, cdt, cdn) {
|
cur_frm.cscript.expense_account = function(doc, cdt, cdn) {
|
||||||
cur_frm.cscript.copy_account_in_all_row(doc, cdt, cdn, "expense_account");
|
erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "expense_account");
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.cost_center = function(doc, cdt, cdn) {
|
cur_frm.cscript.cost_center = function(doc, cdt, cdn) {
|
||||||
cur_frm.cscript.copy_account_in_all_row(doc, cdt, cdn, "cost_center");
|
erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "cost_center");
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict.customer.get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict.customer.get_query = function(doc, cdt, cdn) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user