diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 066735abc03..5eeb25e093b 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -748,7 +748,6 @@ def make_purchase_receipt(source_name, target_doc=None, args=None): "sales_order_item": "sales_order_item", "wip_composite_asset": "wip_composite_asset", }, - "field_no_map": ["expense_account"], "postprocess": update_item, "condition": lambda doc: ( True if is_unit_price_row(doc) else abs(doc.received_qty) < abs(doc.qty) diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index ca2f4d4ac72..69971410b2c 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -755,7 +755,7 @@ class PurchaseReceipt(BuyingController): stock_asset_rbnb = ( self.get_company_default("asset_received_but_not_billed") if d.is_fixed_asset - else (d.expense_account or self.get_company_default("stock_received_but_not_billed")) + else self.get_company_default("stock_received_but_not_billed") ) landed_cost_entries = self.get_item_account_wise_lcv_entries() if d.is_fixed_asset: @@ -809,7 +809,7 @@ class PurchaseReceipt(BuyingController): stock_asset_rbnb = ( self.get_company_default("asset_received_but_not_billed") if d.is_fixed_asset - else (d.expense_account or self.get_company_default("stock_received_but_not_billed")) + else self.get_company_default("stock_received_but_not_billed") ) stock_value_diff = get_stock_value_difference(self.name, d.name, d.rejected_warehouse) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 1b3b9a97f3b..a1f431c883e 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -434,19 +434,6 @@ def get_basic_details(ctx: ItemDetailsCtx, item, overwrite_warehouse=True) -> It expense_account = get_asset_category_account( fieldname="fixed_asset_account", item=ctx.item_code, company=ctx.company ) - elif ctx.doctype == "Purchase Receipt": - from erpnext.accounts.utils import get_company_default - - if not ( - frappe.get_value("Company", ctx.company, "enable_provisional_accounting_for_non_stock_items") - and not item.is_stock_item - and ctx.qty - ): - expense_account = ( - get_company_default(ctx.company, "stock_received_but_not_billed") - if not frappe.in_test - else f'Stock Received But Not Billed - {frappe.get_value("Company", ctx.company, "abbr")}' - ) # Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master if not ctx.uom: