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 "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))
|
||||
&& frm.doc.status != 'Stopped') {
|
||||
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
|
||||
var counter = 0;
|
||||
var tbl = frm.doc.required_items || [];
|
||||
@ -346,7 +345,8 @@ erpnext.work_order = {
|
||||
}
|
||||
if (counter > 0) {
|
||||
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');
|
||||
}
|
||||
@ -361,7 +361,6 @@ erpnext.work_order = {
|
||||
finish_btn.addClass('btn-primary');
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if ((flt(doc.produced_qty) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
|
||||
var finish_btn = frm.add_custom_button(__('Finish'), function() {
|
||||
|
||||
@ -31,6 +31,12 @@ form_grid_templates = {
|
||||
}
|
||||
|
||||
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):
|
||||
self.validate_production_item()
|
||||
if self.bom_no:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user