mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
chore: allow wip_composite_asset in the MR PO PR PI flow
This commit is contained in:
@@ -1837,6 +1837,7 @@ def make_purchase_receipt(source_name, target_doc=None):
|
|||||||
"po_detail": "purchase_order_item",
|
"po_detail": "purchase_order_item",
|
||||||
"material_request": "material_request",
|
"material_request": "material_request",
|
||||||
"material_request_item": "material_request_item",
|
"material_request_item": "material_request_item",
|
||||||
|
"wip_composite_asset": "wip_composite_asset",
|
||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty),
|
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty),
|
||||||
|
|||||||
@@ -221,11 +221,11 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:!(doc.is_composite_asset && !doc.capitalized_in)",
|
||||||
"fieldname": "gross_purchase_amount",
|
"fieldname": "gross_purchase_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Gross Purchase Amount",
|
"label": "Gross Purchase Amount",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"read_only": 1,
|
|
||||||
"read_only_depends_on": "eval:!doc.is_existing_asset",
|
"read_only_depends_on": "eval:!doc.is_existing_asset",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
@@ -399,6 +399,7 @@
|
|||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:!doc.is_composite_asset && !doc.is_existing_asset",
|
||||||
"fieldname": "purchase_receipt",
|
"fieldname": "purchase_receipt",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Purchase Receipt",
|
"label": "Purchase Receipt",
|
||||||
@@ -416,6 +417,7 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:!doc.is_composite_asset && !doc.is_existing_asset",
|
||||||
"fieldname": "purchase_invoice",
|
"fieldname": "purchase_invoice",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Purchase Invoice",
|
"label": "Purchase Invoice",
|
||||||
@@ -479,10 +481,11 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval.doc.asset_quantity",
|
||||||
"fieldname": "asset_quantity",
|
"fieldname": "asset_quantity",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"label": "Asset Quantity",
|
"label": "Asset Quantity",
|
||||||
"read_only_depends_on": "eval:!doc.is_existing_asset && !doc.is_composite_asset"
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "depr_entry_posting_status",
|
"fieldname": "depr_entry_posting_status",
|
||||||
@@ -562,9 +565,14 @@
|
|||||||
"link_doctype": "Journal Entry",
|
"link_doctype": "Journal Entry",
|
||||||
"link_fieldname": "reference_name",
|
"link_fieldname": "reference_name",
|
||||||
"table_fieldname": "accounts"
|
"table_fieldname": "accounts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group": "Asset Capitalization",
|
||||||
|
"link_doctype": "Asset Capitalization",
|
||||||
|
"link_fieldname": "target_asset"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2023-10-03 23:28:26.732269",
|
"modified": "2023-10-27 17:03:46.629617",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset",
|
"name": "Asset",
|
||||||
|
|||||||
@@ -876,12 +876,8 @@ def get_items_tagged_to_wip_composite_asset(asset):
|
|||||||
"amount",
|
"amount",
|
||||||
]
|
]
|
||||||
|
|
||||||
pi_items = frappe.get_all(
|
|
||||||
"Purchase Invoice Item", filters={"wip_composite_asset": asset}, fields=fields
|
|
||||||
)
|
|
||||||
|
|
||||||
pr_items = frappe.get_all(
|
pr_items = frappe.get_all(
|
||||||
"Purchase Receipt Item", filters={"wip_composite_asset": asset}, fields=fields
|
"Purchase Receipt Item", filters={"wip_composite_asset": asset}, fields=fields
|
||||||
)
|
)
|
||||||
|
|
||||||
return pi_items + pr_items
|
return pr_items
|
||||||
|
|||||||
@@ -556,6 +556,7 @@ def make_purchase_receipt(source_name, target_doc=None):
|
|||||||
"bom": "bom",
|
"bom": "bom",
|
||||||
"material_request": "material_request",
|
"material_request": "material_request",
|
||||||
"material_request_item": "material_request_item",
|
"material_request_item": "material_request_item",
|
||||||
|
"wip_composite_asset": "wip_composite_asset",
|
||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty)
|
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty)
|
||||||
@@ -632,6 +633,7 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
|
|||||||
"field_map": {
|
"field_map": {
|
||||||
"name": "po_detail",
|
"name": "po_detail",
|
||||||
"parent": "purchase_order",
|
"parent": "purchase_order",
|
||||||
|
"wip_composite_asset": "wip_composite_asset",
|
||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"condition": lambda doc: (doc.base_amount == 0 or abs(doc.billed_amt) < abs(doc.amount)),
|
"condition": lambda doc: (doc.base_amount == 0 or abs(doc.billed_amt) < abs(doc.amount)),
|
||||||
|
|||||||
@@ -86,6 +86,8 @@
|
|||||||
"billed_amt",
|
"billed_amt",
|
||||||
"accounting_details",
|
"accounting_details",
|
||||||
"expense_account",
|
"expense_account",
|
||||||
|
"column_break_fyqr",
|
||||||
|
"wip_composite_asset",
|
||||||
"manufacture_details",
|
"manufacture_details",
|
||||||
"manufacturer",
|
"manufacturer",
|
||||||
"manufacturer_part_no",
|
"manufacturer_part_no",
|
||||||
@@ -896,13 +898,23 @@
|
|||||||
"fieldname": "apply_tds",
|
"fieldname": "apply_tds",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Apply TDS"
|
"label": "Apply TDS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "wip_composite_asset",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "WIP Composite Asset",
|
||||||
|
"options": "Asset"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_fyqr",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-09-13 16:22:40.825092",
|
"modified": "2023-10-27 15:50:42.655573",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Purchase Order Item",
|
"name": "Purchase Order Item",
|
||||||
|
|||||||
@@ -401,6 +401,7 @@ def make_purchase_order(source_name, target_doc=None, args=None):
|
|||||||
["uom", "uom"],
|
["uom", "uom"],
|
||||||
["sales_order", "sales_order"],
|
["sales_order", "sales_order"],
|
||||||
["sales_order_item", "sales_order_item"],
|
["sales_order_item", "sales_order_item"],
|
||||||
|
["wip_composite_asset", "wip_composite_asset"],
|
||||||
],
|
],
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"condition": select_item,
|
"condition": select_item,
|
||||||
|
|||||||
@@ -37,6 +37,10 @@
|
|||||||
"rate",
|
"rate",
|
||||||
"col_break3",
|
"col_break3",
|
||||||
"amount",
|
"amount",
|
||||||
|
"accounting_details_section",
|
||||||
|
"expense_account",
|
||||||
|
"column_break_glru",
|
||||||
|
"wip_composite_asset",
|
||||||
"manufacture_details",
|
"manufacture_details",
|
||||||
"manufacturer",
|
"manufacturer",
|
||||||
"manufacturer_part_no",
|
"manufacturer_part_no",
|
||||||
@@ -50,11 +54,10 @@
|
|||||||
"lead_time_date",
|
"lead_time_date",
|
||||||
"sales_order",
|
"sales_order",
|
||||||
"sales_order_item",
|
"sales_order_item",
|
||||||
|
"col_break4",
|
||||||
"production_plan",
|
"production_plan",
|
||||||
"material_request_plan_item",
|
"material_request_plan_item",
|
||||||
"job_card_item",
|
"job_card_item",
|
||||||
"col_break4",
|
|
||||||
"expense_account",
|
|
||||||
"section_break_46",
|
"section_break_46",
|
||||||
"page_break"
|
"page_break"
|
||||||
],
|
],
|
||||||
@@ -454,13 +457,28 @@
|
|||||||
"label": "Job Card Item",
|
"label": "Job Card Item",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"print_hide": 1
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "accounting_details_section",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Accounting Details"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_glru",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "wip_composite_asset",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "WIP Composite Asset",
|
||||||
|
"options": "Asset"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-05-07 20:23:31.250252",
|
"modified": "2023-10-27 15:53:41.444236",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Material Request Item",
|
"name": "Material Request Item",
|
||||||
|
|||||||
@@ -1091,6 +1091,7 @@ def make_purchase_invoice(source_name, target_doc=None):
|
|||||||
"is_fixed_asset": "is_fixed_asset",
|
"is_fixed_asset": "is_fixed_asset",
|
||||||
"asset_location": "asset_location",
|
"asset_location": "asset_location",
|
||||||
"asset_category": "asset_category",
|
"asset_category": "asset_category",
|
||||||
|
"wip_composite_asset": "wip_composite_asset",
|
||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"filter": lambda d: get_pending_qty(d)[0] <= 0
|
"filter": lambda d: get_pending_qty(d)[0] <= 0
|
||||||
|
|||||||
Reference in New Issue
Block a user