fix: multiple issues related to serial and batch bundle (#41662)

This commit is contained in:
rohitwaghchaure
2024-05-28 18:48:09 +05:30
committed by GitHub
parent e3cf53a8b7
commit ce834f5dba
24 changed files with 569 additions and 88 deletions

View File

@@ -302,6 +302,21 @@ frappe.ui.form.on("Subcontracting Receipt", {
};
}
},
reset_raw_materials_table: (frm) => {
frm.clear_table("supplied_items");
frm.call({
method: "reset_raw_materials",
doc: frm.doc,
freeze: true,
callback: (r) => {
if (!r.exc) {
frm.save();
}
},
});
},
});
frappe.ui.form.on("Landed Cost Taxes and Charges", {

View File

@@ -47,8 +47,11 @@
"total_qty",
"column_break_27",
"total",
"raw_material_details",
"raw_materials_consumed_section",
"reset_raw_materials_table",
"column_break_uinr",
"get_current_stock",
"raw_material_details",
"supplied_items",
"additional_costs_section",
"distribute_additional_costs_based_on",
@@ -300,6 +303,7 @@
"depends_on": "supplied_items",
"fieldname": "raw_material_details",
"fieldtype": "Section Break",
"hide_border": 1,
"label": "Raw Materials Consumed",
"options": "fa fa-table",
"print_hide": 1,
@@ -640,12 +644,26 @@
"fieldname": "supplier_delivery_note",
"fieldtype": "Data",
"label": "Supplier Delivery Note"
},
{
"fieldname": "raw_materials_consumed_section",
"fieldtype": "Section Break",
"label": "Raw Materials Actions"
},
{
"fieldname": "reset_raw_materials_table",
"fieldtype": "Button",
"label": "Reset Raw Materials Table"
},
{
"fieldname": "column_break_uinr",
"fieldtype": "Column Break"
}
],
"in_create": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-03-27 13:10:46.856728",
"modified": "2024-05-27 15:02:13.517969",
"modified_by": "Administrator",
"module": "Subcontracting",
"name": "Subcontracting Receipt",

View File

@@ -179,6 +179,11 @@ class SubcontractingReceipt(SubcontractingController):
self.update_status()
self.delete_auto_created_batches()
@frappe.whitelist()
def reset_raw_materials(self):
self.supplied_items = []
self.create_raw_materials_supplied()
def validate_closed_subcontracting_order(self):
for item in self.items:
if item.subcontracting_order: