Merge pull request #33030 from frappe/mergify/bp/version-14-hotfix/pr-32986

This commit is contained in:
Faris Ansari
2022-11-18 16:32:45 +05:30
committed by GitHub
3 changed files with 1198 additions and 1190 deletions

View File

@@ -404,12 +404,17 @@ def make_return_doc(doctype: str, source_name: str, target_doc=None):
returned_qty_map = get_returned_qty_map_for_row( returned_qty_map = get_returned_qty_map_for_row(
source_parent.name, source_parent.supplier, source_doc.name, doctype source_parent.name, source_parent.supplier, source_doc.name, doctype
) )
if doctype == "Subcontracting Receipt":
target_doc.received_qty = -1 * flt(source_doc.qty)
else:
target_doc.received_qty = -1 * flt( target_doc.received_qty = -1 * flt(
source_doc.received_qty - (returned_qty_map.get("received_qty") or 0) source_doc.received_qty - (returned_qty_map.get("received_qty") or 0)
) )
target_doc.rejected_qty = -1 * flt( target_doc.rejected_qty = -1 * flt(
source_doc.rejected_qty - (returned_qty_map.get("rejected_qty") or 0) source_doc.rejected_qty - (returned_qty_map.get("rejected_qty") or 0)
) )
target_doc.qty = -1 * flt(source_doc.qty - (returned_qty_map.get("qty") or 0)) target_doc.qty = -1 * flt(source_doc.qty - (returned_qty_map.get("qty") or 0))
if hasattr(target_doc, "stock_qty"): if hasattr(target_doc, "stock_qty"):

View File

@@ -246,6 +246,7 @@
"print_hide": 1 "print_hide": 1
}, },
{ {
"depends_on": "eval: !doc.is_return",
"description": "Sets 'Rejected Warehouse' in each row of the Items table.", "description": "Sets 'Rejected Warehouse' in each row of the Items table.",
"fieldname": "rejected_warehouse", "fieldname": "rejected_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
@@ -628,7 +629,7 @@
"in_create": 1, "in_create": 1,
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2022-08-26 21:02:26.353870", "modified": "2022-11-16 14:18:57.001239",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Subcontracting", "module": "Subcontracting",
"name": "Subcontracting Receipt", "name": "Subcontracting Receipt",

View File

@@ -147,6 +147,7 @@
}, },
{ {
"columns": 1, "columns": 1,
"depends_on": "eval: !parent.is_return",
"fieldname": "rejected_qty", "fieldname": "rejected_qty",
"fieldtype": "Float", "fieldtype": "Float",
"in_list_view": 1, "in_list_view": 1,
@@ -248,6 +249,7 @@
"width": "100px" "width": "100px"
}, },
{ {
"depends_on": "eval: !parent.is_return",
"fieldname": "rejected_warehouse", "fieldname": "rejected_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Rejected Warehouse", "label": "Rejected Warehouse",
@@ -311,7 +313,7 @@
"print_hide": 1 "print_hide": 1
}, },
{ {
"depends_on": "eval:!doc.is_fixed_asset", "depends_on": "eval: !parent.is_return",
"fieldname": "rejected_serial_no", "fieldname": "rejected_serial_no",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"label": "Rejected Serial No", "label": "Rejected Serial No",
@@ -474,7 +476,7 @@
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2022-08-20 17:16:48.269164", "modified": "2022-11-16 14:21:26.125815",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Subcontracting", "module": "Subcontracting",
"name": "Subcontracting Receipt Item", "name": "Subcontracting Receipt Item",