Skip to content

Commit

Permalink
Merge pull request #393 from efeone/aumms_28
Browse files Browse the repository at this point in the history
feat:Product field and weight field updation in manufacturing Request.
  • Loading branch information
SherinKR authored May 10, 2024
2 parents 6105b21 + 92496c3 commit 2abce53
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ frappe.ui.form.on("Jewellery Job Card", {
refresh: function(frm){
create_custom_buttons(frm);
calculate_total_weight(frm);
if (frm.doc.docstatus === 1) {
frm.remove_custom_button('Start');
}
}
});

Expand Down Expand Up @@ -44,6 +47,7 @@ let create_custom_buttons = function(frm){
}
}


function updateStartTime(frm) {
const currentTime = frappe.datetime.now_datetime();
let row = frappe.model.add_child(frm.doc, 'Job Time', 'job_time');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def update_product(self):
for stage in manufacturing_request.manufacturing_stages:
if stage.manufacturing_stage == self.stage:
for item in self.item_details:
frappe.db.set_value('Manufacturing Stage', stage.name, 'product', item.item)
frappe.db.set_value('Manufacturing Stage', stage.name, 'weight', item.weight)
frappe.db.set_value('Manufacturing Stage', stage.name, 'product', self.final_product)
frappe.db.set_value('Manufacturing Stage', stage.name, 'weight', self.weight)
break

def create_metal_ledger(self) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"read_only": 1
},
{
"depends_on": "eval:(doc.raw_material_available == 1 && doc.previous_stage_completed == 1)",
"depends_on": "eval:(doc.raw_material_available == 1 || (doc.previous_stage_completed == 1 && doc.is_raw_material_from_previous_stage_only == 1))",
"fieldname": "create_job_card",
"fieldtype": "Button",
"label": "Create Job Card"
Expand All @@ -89,6 +89,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Smith",
"mandatory_depends_on": "eval:doc.raw_material_available == 1",
"options": "Employee"
},
{
Expand Down Expand Up @@ -149,23 +150,30 @@
"options": "Warehouse"
},
{
"depends_on": "eval:doc.completed == 1",
"fieldname": "product",
"fieldtype": "Link",
"label": "Product",
"options": "Item"
"options": "Item",
"read_only": 1
},
{
"depends_on": "eval:doc.completed == 1",
"fieldname": "weight",
"fieldtype": "Float",
"label": "Weight"
"label": "Weight",
"read_only": 1
},
{
"depends_on": "eval:doc.previous_stage_completed == 1",
"fieldname": "previous_stage_product",
"fieldtype": "Link",
"label": "Previous Stage Product",
"options": "Item"
"options": "Item",
"read_only": 1
},
{
"depends_on": "eval:doc.previous_stage_completed == 1",
"fieldname": "previous_stage_weight",
"fieldtype": "Float",
"label": "Previous Stage Weight",
Expand All @@ -185,4 +193,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

0 comments on commit 2abce53

Please sign in to comment.