fix: maintain PO and PO Item ref in SCR Item

This commit is contained in:
s-aga-r 2023-11-23 17:48:34 +05:30
parent a2ede7d6d5
commit e1cea25781
2 changed files with 28 additions and 5 deletions

View File

@ -194,9 +194,11 @@ def make_subcontracting_receipt(source_name, target_doc=None):
def get_mapped_subcontracting_receipt(source_name, target_doc=None): def get_mapped_subcontracting_receipt(source_name, target_doc=None):
def update_item(obj, target, source_parent): def update_item(source, target, source_parent):
target.qty = flt(obj.qty) - flt(obj.received_qty) target.purchase_order = source_parent.purchase_order
target.amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.rate) target.purchase_order_item = source.purchase_order_item
target.qty = flt(source.qty) - flt(source.received_qty)
target.amount = (flt(source.qty) - flt(source.received_qty)) * flt(source.rate)
target_doc = get_mapped_doc( target_doc = get_mapped_doc(
"Subcontracting Order", "Subcontracting Order",

View File

@ -63,7 +63,9 @@
"dimension_col_break", "dimension_col_break",
"project", "project",
"section_break_80", "section_break_80",
"page_break" "page_break",
"purchase_order",
"purchase_order_item"
], ],
"fields": [ "fields": [
{ {
@ -517,12 +519,31 @@
"label": "Reference Name", "label": "Reference Name",
"no_copy": 1, "no_copy": 1,
"read_only": 1 "read_only": 1
},
{
"fieldname": "purchase_order_item",
"fieldtype": "Data",
"hidden": 1,
"label": "Purchase Order Item",
"no_copy": 1,
"read_only": 1,
"search_index": 1
},
{
"fieldname": "purchase_order",
"fieldtype": "Link",
"hidden": 1,
"label": "Purchase Order",
"no_copy": 1,
"options": "Purchase Order",
"read_only": 1,
"search_index": 1
} }
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2023-11-14 18:38:26.459669", "modified": "2023-11-23 17:38:55.134685",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Subcontracting", "module": "Subcontracting",
"name": "Subcontracting Receipt Item", "name": "Subcontracting Receipt Item",