feat: auto create serial and batch bundle

This commit is contained in:
Rohit Waghchaure
2023-03-28 12:16:27 +05:30
parent c1132d1e6d
commit 648efca940
18 changed files with 556 additions and 642 deletions

View File

@@ -372,6 +372,16 @@ class StockController(AccountsController):
row.db_set("serial_and_batch_bundle", None)
def set_serial_and_batch_bundle(self, table_name=None):
if not table_name:
table_name = "items"
for row in self.get(table_name):
if row.get("serial_and_batch_bundle"):
frappe.get_doc(
"Serial and Batch Bundle", row.serial_and_batch_bundle
).set_serial_and_batch_values(self, row)
def make_package_for_transfer(
self, serial_and_batch_bundle, warehouse, type_of_transaction=None, do_not_submit=None
):
@@ -749,16 +759,6 @@ class StockController(AccountsController):
message = self.prepare_over_receipt_message(rule, values)
frappe.throw(msg=message, title=_("Over Receipt"))
def set_serial_and_batch_bundle(self, table_name=None):
if not table_name:
table_name = "items"
for row in self.get(table_name):
if row.get("serial_and_batch_bundle"):
frappe.get_doc(
"Serial and Batch Bundle", row.serial_and_batch_bundle
).set_serial_and_batch_values(self, row)
def prepare_over_receipt_message(self, rule, values):
message = _(
"{0} qty of Item {1} is being received into Warehouse {2} with capacity {3}."