From 2627fb10ce57efcda446d008fff1195dc8a72b2b Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 24 Jun 2025 16:14:24 +0530 Subject: [PATCH] chore: resolve conflicts --- .../doctype/sales_invoice/test_sales_invoice.py | 13 +------------ erpnext/controllers/accounts_controller.py | 4 +++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index fde0dd1f7ef..2b9af8669d3 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -3287,7 +3287,7 @@ class TestSalesInvoice(FrappeTestCase): si.posting_date = getdate() si.submit() - @IntegrationTestCase.change_settings("Accounts Settings", {"over_billing_allowance": 0}) + @change_settings("Accounts Settings", {"over_billing_allowance": 0}) def test_over_billing_case_against_delivery_note(self): """ Test a case where duplicating the item with qty = 1 in the invoice @@ -3295,12 +3295,6 @@ class TestSalesInvoice(FrappeTestCase): """ from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note -<<<<<<< HEAD - over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance") - frappe.db.set_value("Accounts Settings", None, "over_billing_allowance", 0) - -======= ->>>>>>> 47c3c4808e (fix: get already billed amount from current doc instead of database (#48079)) dn = create_delivery_note() dn.submit() @@ -3317,12 +3311,7 @@ class TestSalesInvoice(FrappeTestCase): si.save() self.assertTrue("cannot overbill" in str(err.exception).lower()) -<<<<<<< HEAD - - frappe.db.set_value("Accounts Settings", None, "over_billing_allowance", over_billing_allowance) -======= dn.cancel() ->>>>>>> 47c3c4808e (fix: get already billed amount from current doc instead of database (#48079)) @change_settings( "Accounts Settings", diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index f5898ba8677..21567a60abe 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1752,7 +1752,9 @@ class AccountsController(TransactionBase): precision = self.precision(based_on, "items") precision_allowance = 1 / (10**precision) - role_allowed_to_overbill = frappe.get_single_value("Accounts Settings", "role_allowed_to_over_bill") + role_allowed_to_overbill = frappe.get_cached_value( + "Accounts Settings", None, "role_allowed_to_over_bill" + ) is_overbilling_allowed = role_allowed_to_overbill in frappe.get_roles() for row in ref_wise_billed_amount.values():