Merge pull request #38647 from barredterra/copy-emails-to-customer
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index 5dc5c38..f0392be 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -1334,10 +1334,10 @@
)
date_field_mapper = {
- "from_date": self.from_date >= so.transaction_date,
- "to_date": self.to_date <= so.transaction_date,
- "from_delivery_date": self.from_delivery_date >= so_item.delivery_date,
- "to_delivery_date": self.to_delivery_date <= so_item.delivery_date,
+ "from_date": so.transaction_date >= self.from_date,
+ "to_date": so.transaction_date <= self.to_date,
+ "from_delivery_date": so_item.delivery_date >= self.from_delivery_date,
+ "to_delivery_date": so_item.delivery_date <= self.to_delivery_date,
}
for field, value in date_field_mapper.items():
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py
index aa7bc5b..39beb36 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order.py
@@ -1511,14 +1511,14 @@
def validate_operation_data(row):
- if row.get("qty") <= 0:
+ if flt(row.get("qty")) <= 0:
frappe.throw(
_("Quantity to Manufacture can not be zero for the operation {0}").format(
frappe.bold(row.get("operation"))
)
)
- if row.get("qty") > row.get("pending_qty"):
+ if flt(row.get("qty")) > flt(row.get("pending_qty")):
frappe.throw(
_("For operation {0}: Quantity ({1}) can not be greater than pending quantity({2})").format(
frappe.bold(row.get("operation")),