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

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

(cherry picked from commit ce834f5dba)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
#	erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json

* chore: fix conflicts

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-05-28 21:57:13 +05:30
committed by GitHub
parent 2e8ae4dc30
commit dc0bb220ed
24 changed files with 571 additions and 90 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": "2023-11-16 13:04:00.710534",
"modified": "2024-05-28 15:02:13.517969",
"modified_by": "Administrator",
"module": "Subcontracting",
"name": "Subcontracting Receipt",
@@ -714,4 +732,4 @@
"timeline_field": "supplier",
"title_field": "title",
"track_changes": 1
}
}

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: