From 570985f40e06554edf6c349a16baafd0fb6a01bd Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 29 May 2024 12:25:56 +0530 Subject: [PATCH 1/5] fix: Filters in account balance report (cherry picked from commit 1c9fe691ea924a4b5f579544b639c7fb51017d07) --- erpnext/accounts/report/account_balance/account_balance.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/accounts/report/account_balance/account_balance.py b/erpnext/accounts/report/account_balance/account_balance.py index 6f9f7ebcb8d..f385c71a9f4 100644 --- a/erpnext/accounts/report/account_balance/account_balance.py +++ b/erpnext/accounts/report/account_balance/account_balance.py @@ -49,7 +49,6 @@ def get_conditions(filters): if filters.account_type: conditions["account_type"] = filters.account_type - return conditions if filters.company: conditions["company"] = filters.company From 39885b2b010b25257ca82d41d316ca3b87c7dfca Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Jun 2024 14:05:57 +0530 Subject: [PATCH 2/5] fix: get assets received but not billed account only if any asset item is received (#41734) fix: get assets received but not billed account only if any asset item received --- .../doctype/purchase_invoice/purchase_invoice.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index c5f089fd24d..e0debba6fd5 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -284,7 +284,7 @@ class PurchaseInvoice(BuyingController): stock_not_billed_account = self.get_company_default("stock_received_but_not_billed") stock_items = self.get_stock_items() - asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed") + self.asset_received_but_not_billed = None if self.update_stock: self.validate_item_code() @@ -370,18 +370,23 @@ class PurchaseInvoice(BuyingController): elif item.is_fixed_asset: account = None if item.pr_detail: + if not self.asset_received_but_not_billed: + self.asset_received_but_not_billed = self.get_company_default( + "asset_received_but_not_billed" + ) + # check if 'Asset Received But Not Billed' account is credited in Purchase receipt or not arbnb_booked_in_pr = frappe.db.get_value( "GL Entry", { "voucher_type": "Purchase Receipt", "voucher_no": item.purchase_receipt, - "account": asset_received_but_not_billed, + "account": self.asset_received_but_not_billed, }, "name", ) if arbnb_booked_in_pr: - account = asset_received_but_not_billed + account = self.asset_received_but_not_billed if not account: account_type = ( From 8c09968e1bd227bdd714b8148aca87dc4ee702de Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 3 Jun 2024 17:31:27 +0530 Subject: [PATCH 3/5] chore: Sys Manager shluld have submit permission for repost doctypes (cherry picked from commit 4558f64c0fa7c2297a378211468186a7df8f2a8a) --- .../repost_accounting_ledger/repost_accounting_ledger.json | 6 +++++- .../repost_payment_ledger/repost_payment_ledger.json | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.json b/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.json index f9344ce4f3a..0d74b2150f7 100644 --- a/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.json +++ b/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.json @@ -53,13 +53,15 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2024-05-23 17:00:42.984798", + "modified": "2024-06-03 17:30:37.012593", "modified_by": "Administrator", "module": "Accounts", "name": "Repost Accounting Ledger", "owner": "Administrator", "permissions": [ { + "amend": 1, + "cancel": 1, "create": 1, "delete": 1, "email": 1, @@ -68,7 +70,9 @@ "read": 1, "report": 1, "role": "System Manager", + "select": 1, "share": 1, + "submit": 1, "write": 1 } ], diff --git a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json index 4ecff8cac3b..2b4efead7f3 100644 --- a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json +++ b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json @@ -98,13 +98,15 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2024-05-23 17:00:31.540640", + "modified": "2024-06-03 17:31:04.472279", "modified_by": "Administrator", "module": "Accounts", "name": "Repost Payment Ledger", "owner": "Administrator", "permissions": [ { + "amend": 1, + "cancel": 1, "create": 1, "delete": 1, "email": 1, @@ -113,7 +115,9 @@ "read": 1, "report": 1, "role": "System Manager", + "select": 1, "share": 1, + "submit": 1, "write": 1 }, { From dc3265751c55e493a8ea617703dc5113b87d2c14 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:37:26 +0530 Subject: [PATCH 4/5] fix: payment term when creating PO from SO (backport #41376) (#41743) fix: payment term when creating PO from SO (#41376) * fix: payment term when creating PO from SO * fix: payment term when creating PO from SO * fix: payment term when creating PO from SO * fix: payment term when creating PO from SO (cherry picked from commit 441596f795b7968fb0166dc794a11cfb73408358) Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com> --- erpnext/selling/doctype/sales_order/sales_order.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 68fa67e92f1..c3f14e1f948 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -932,11 +932,19 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t target.discount_amount = 0.0 target.inter_company_order_reference = "" target.shipping_rule = "" + target.tc_name = "" + target.terms = "" + target.payment_terms_template = "" + target.payment_schedule = [] default_price_list = frappe.get_value("Supplier", supplier, "default_price_list") if default_price_list: target.buying_price_list = default_price_list + default_payment_terms = frappe.get_value("Supplier", supplier, "payment_terms") + if default_payment_terms: + target.payment_terms_template = default_payment_terms + if any(item.delivered_by_supplier == 1 for item in source.items): if source.shipping_address_name: target.shipping_address = source.shipping_address_name @@ -988,7 +996,6 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t "contact_person", "taxes_and_charges", "shipping_address", - "terms", ], "validation": {"docstatus": ["=", 1]}, }, @@ -1056,6 +1063,10 @@ def make_purchase_order(source_name, selected_items=None, target_doc=None): target.discount_amount = 0.0 target.inter_company_order_reference = "" target.shipping_rule = "" + target.tc_name = "" + target.terms = "" + target.payment_terms_template = "" + target.payment_schedule = [] if is_drop_ship_order(target): target.customer = source.customer @@ -1091,7 +1102,6 @@ def make_purchase_order(source_name, selected_items=None, target_doc=None): "contact_person", "taxes_and_charges", "shipping_address", - "terms", ], "validation": {"docstatus": ["=", 1]}, }, From 5ab5bd138fe65f131afec8608af0f42c1ede037f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:55:42 +0530 Subject: [PATCH 5/5] fix: Ignore disabling default currency field while creating new company (backport #41699) (#41760) fix: Ignore disabling default currency field while creating new company (#41699) (cherry picked from commit 80f6228d45b67147815af15b27058b0173b402af) Co-authored-by: Nabin Hait --- erpnext/setup/doctype/company/company.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js index 6c237d787bb..ff4e186d6ce 100644 --- a/erpnext/setup/doctype/company/company.js +++ b/erpnext/setup/doctype/company/company.js @@ -12,10 +12,11 @@ frappe.ui.form.on("Company", { } }); } - - frm.call("check_if_transactions_exist").then((r) => { - frm.toggle_enable("default_currency", !r.message); - }); + if (!frm.doc.__islocal) { + frm.call("check_if_transactions_exist").then((r) => { + frm.toggle_enable("default_currency", !r.message); + }); + } }, setup: function (frm) { frm.__rename_queue = "long";