From ecde1d58b5f3dbc0bbbf2fc96a867b7e25ae5776 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Wed, 29 Nov 2023 18:25:52 +0530 Subject: [PATCH 1/4] fix: set cwip account before asset tests (cherry picked from commit ef8e4191cda22e148e9319758ab6624d76a4ae2f) --- .../asset_value_adjustment/test_asset_value_adjustment.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py b/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py index 977a9b3714b..8fdcd0c14df 100644 --- a/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py +++ b/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py @@ -15,6 +15,9 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_pu class TestAssetValueAdjustment(unittest.TestCase): def setUp(self): create_asset_data() + frappe.db.set_value( + "Company", "_Test Company", "capital_work_in_progress_account", "CWIP Account - _TC" + ) def test_current_asset_value(self): pr = make_purchase_receipt( From 2dc4b02fc853ec1cf40ab1da1126811e0f9e2862 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:11:53 +0530 Subject: [PATCH 2/4] fix: use `docstatus` instead of `status` (backport #38439) (#38442) fix: use `docstatus` instead of `status` (cherry picked from commit 1423b38d50faa8b2f44cab9626a837037e1d0570) Co-authored-by: s-aga-r --- erpnext/buying/doctype/purchase_order/purchase_order.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 69f34c33b69..56c06fb50ce 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -705,8 +705,8 @@ def get_mapped_subcontracting_order(source_name, target_doc=None): @frappe.whitelist() def is_subcontracting_order_created(po_name) -> bool: - count = frappe.db.count( - "Subcontracting Order", {"purchase_order": po_name, "status": ["not in", ["Draft", "Cancelled"]]} + return ( + True + if frappe.db.exists("Subcontracting Order", {"purchase_order": po_name, "docstatus": ["=", 1]}) + else False ) - - return True if count else False From 2908d966b620c4462b96d79e46f08e6bed3ff1df Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:15:52 +0530 Subject: [PATCH 3/4] fix: exploded items in Subcontracting Receipt (backport #38441) (#38444) * fix: exploded items in Subcontracting Receipt (cherry picked from commit 62b4a263f86a15dc39cd62b4fa39df87f0ec0dfa) # Conflicts: # erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json * chore: `conflicts` --------- Co-authored-by: s-aga-r --- .../subcontracting_receipt_item.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json index 28bd84e5895..755142e5a97 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json +++ b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json @@ -45,6 +45,7 @@ "subcontracting_receipt_item", "section_break_45", "bom", + "include_exploded_items", "serial_no", "col_break5", "batch_no", @@ -465,12 +466,19 @@ "fieldname": "accounting_details_section", "fieldtype": "Section Break", "label": "Accounting Details" + }, + { + "default": "0", + "fieldname": "include_exploded_items", + "fieldtype": "Check", + "label": "Include Exploded Items", + "print_hide": 1 } ], "idx": 1, "istable": 1, "links": [], - "modified": "2023-11-14 18:38:26.459669", + "modified": "2023-11-30 12:05:51.920705", "modified_by": "Administrator", "module": "Subcontracting", "name": "Subcontracting Receipt Item", From e8ea6022f02615dccb0766b52b9a0c36a3b2d067 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 30 Nov 2023 12:22:55 +0530 Subject: [PATCH 4/4] refactor: pass on filter to upfront outstanding query as well (cherry picked from commit cfd3230c75b5e549b98b2362947ee8744c98e920) --- erpnext/accounts/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 2836056b0c9..c98b8193538 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -1809,6 +1809,8 @@ class QueryPaymentLedger(object): .where(ple.delinked == 0) .where(Criterion.all(filter_on_against_voucher_no)) .where(Criterion.all(self.common_filter)) + .where(Criterion.all(self.dimensions_filter)) + .where(Criterion.all(self.voucher_posting_date)) .groupby(ple.against_voucher_type, ple.against_voucher_no, ple.party_type, ple.party) .orderby(ple.posting_date, ple.voucher_no) .having(qb.Field("amount_in_account_currency") > 0)