Fixed permission issue
This commit is contained in:
parent
430810f64c
commit
d4453aef68
@ -329,12 +329,11 @@ erpnext.work_order = {
|
|||||||
|
|
||||||
if(!frm.doc.skip_transfer){
|
if(!frm.doc.skip_transfer){
|
||||||
// If "Material Consumption is check in Manufacturing Settings, allow Material Consumption
|
// If "Material Consumption is check in Manufacturing Settings, allow Material Consumption
|
||||||
frappe.model.get_value('Manufacturing Settings', {'name': 'Manufacturing Settings'}, 'material_consumption', function(d) {
|
|
||||||
if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))
|
if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))
|
||||||
&& frm.doc.status != 'Stopped') {
|
&& frm.doc.status != 'Stopped') {
|
||||||
frm.has_finish_btn = true;
|
frm.has_finish_btn = true;
|
||||||
|
|
||||||
if (d.material_consumption == 1) {
|
if (frm.doc.__onload && frm.doc.__onload.material_consumption == 1) {
|
||||||
// Only show "Material Consumption" when required_qty > consumed_qty
|
// Only show "Material Consumption" when required_qty > consumed_qty
|
||||||
var counter = 0;
|
var counter = 0;
|
||||||
var tbl = frm.doc.required_items || [];
|
var tbl = frm.doc.required_items || [];
|
||||||
@ -346,7 +345,8 @@ erpnext.work_order = {
|
|||||||
}
|
}
|
||||||
if (counter > 0) {
|
if (counter > 0) {
|
||||||
var consumption_btn = frm.add_custom_button(__('Material Consumption'), function() {
|
var consumption_btn = frm.add_custom_button(__('Material Consumption'), function() {
|
||||||
erpnext.work_order.make_consumption_se(frm, d.backflush_raw_materials_based_on);
|
const backflush_raw_materials_based_on = frm.doc.__onload.backflush_raw_materials_based_on;
|
||||||
|
erpnext.work_order.make_consumption_se(frm, backflush_raw_materials_based_on);
|
||||||
});
|
});
|
||||||
consumption_btn.addClass('btn-primary');
|
consumption_btn.addClass('btn-primary');
|
||||||
}
|
}
|
||||||
@ -361,7 +361,6 @@ erpnext.work_order = {
|
|||||||
finish_btn.addClass('btn-primary');
|
finish_btn.addClass('btn-primary');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
if ((flt(doc.produced_qty) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
|
if ((flt(doc.produced_qty) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
|
||||||
var finish_btn = frm.add_custom_button(__('Finish'), function() {
|
var finish_btn = frm.add_custom_button(__('Finish'), function() {
|
||||||
|
|||||||
@ -31,6 +31,12 @@ form_grid_templates = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class WorkOrder(Document):
|
class WorkOrder(Document):
|
||||||
|
def onload(self):
|
||||||
|
ms = frappe.get_doc("Manufacturing Settings")
|
||||||
|
self.set_onload("material_consumption", ms.material_consumption)
|
||||||
|
self.set_onload("backflush_raw_materials_based_on", ms.backflush_raw_materials_based_on)
|
||||||
|
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_production_item()
|
self.validate_production_item()
|
||||||
if self.bom_no:
|
if self.bom_no:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user