refactor: rename field Over Order Allowance to Blanket Order Allowance (backport #37669) (#37682)

* refactor: rename field `Over Order Allowance` to `Blanket Order Allowance`

(cherry picked from commit 8ffa2bfe25d8fae317d77705aec82a92dc269874)

* chore: patch to rename field `over_order_allowance`

(cherry picked from commit fcfcf6957e07ad5afc281e5f43154ca1170e14c4)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot] 2023-10-25 14:58:01 +05:30 committed by GitHub
parent a871d955d4
commit 2f5d991225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 21 deletions

View File

@ -16,7 +16,7 @@
"transaction_settings_section",
"po_required",
"pr_required",
"over_order_allowance",
"blanket_order_allowance",
"column_break_12",
"maintain_same_rate",
"set_landed_cost_based_on_purchase_invoice_rate",
@ -159,19 +159,19 @@
"fieldtype": "Check",
"label": "Set Landed Cost Based on Purchase Invoice Rate"
},
{
"default": "0",
"description": "Percentage you are allowed to order more against the Blanket Order Quantity. For example: If you have a Blanket Order of Quantity 100 units. and your Allowance is 10% then you are allowed to order 110 units.",
"fieldname": "over_order_allowance",
"fieldtype": "Float",
"label": "Over Order Allowance (%)"
},
{
"default": "0",
"description": "While making Purchase Invoice from Purchase Order, use Exchange Rate on Invoice's transaction date rather than inheriting it from Purchase Order. Only applies for Purchase Invoice.",
"fieldname": "use_transaction_date_exchange_rate",
"fieldtype": "Check",
"label": "Use Transaction Date Exchange Rate"
},
{
"default": "0",
"description": "Percentage you are allowed to order beyond the Blanket Order quantity.",
"fieldname": "blanket_order_allowance",
"fieldtype": "Float",
"label": "Blanket Order Allowance (%)"
}
],
"icon": "fa fa-cog",
@ -179,7 +179,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-10-16 16:22:03.201078",
"modified": "2023-10-25 14:03:32.520418",
"modified_by": "Administrator",
"module": "Buying",
"name": "Buying Settings",

View File

@ -107,7 +107,7 @@ def validate_against_blanket_order(order_doc):
allowance = flt(
frappe.db.get_single_value(
"Selling Settings" if order_doc.doctype == "Sales Order" else "Buying Settings",
"over_order_allowance",
"blanket_order_allowance",
)
)
for bo_name, item_data in order_data.items():

View File

@ -63,7 +63,7 @@ class TestBlanketOrder(FrappeTestCase):
po1.currency = get_company_currency(po1.company)
self.assertEqual(po1.items[0].qty, (bo.items[0].qty - bo.items[0].ordered_qty))
def test_over_order_allowance(self):
def test_blanket_order_allowance(self):
# Sales Order
bo = make_blanket_order(blanket_order_type="Selling", quantity=100)
@ -74,7 +74,7 @@ class TestBlanketOrder(FrappeTestCase):
so.items[0].qty = 110
self.assertRaises(frappe.ValidationError, so.submit)
frappe.db.set_single_value("Selling Settings", "over_order_allowance", 10)
frappe.db.set_single_value("Selling Settings", "blanket_order_allowance", 10)
so.submit()
# Purchase Order
@ -87,7 +87,7 @@ class TestBlanketOrder(FrappeTestCase):
po.items[0].qty = 110
self.assertRaises(frappe.ValidationError, po.submit)
frappe.db.set_single_value("Buying Settings", "over_order_allowance", 10)
frappe.db.set_single_value("Buying Settings", "blanket_order_allowance", 10)
po.submit()

View File

@ -341,5 +341,6 @@ execute:frappe.delete_doc("Page", "welcome-to-erpnext")
erpnext.patches.v15_0.delete_payment_gateway_doctypes
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
erpnext.patches.v15_0.update_sre_from_voucher_details
erpnext.patches.v14_0.rename_over_order_allowance_field
# below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger

View File

@ -0,0 +1,15 @@
from frappe.model.utils.rename_field import rename_field
def execute():
rename_field(
"Buying Settings",
"over_order_allowance",
"blanket_order_allowance",
)
rename_field(
"Selling Settings",
"over_order_allowance",
"blanket_order_allowance",
)

View File

@ -25,7 +25,7 @@
"so_required",
"dn_required",
"sales_update_frequency",
"over_order_allowance",
"blanket_order_allowance",
"column_break_5",
"allow_multiple_items",
"allow_against_multiple_purchase_orders",
@ -183,12 +183,6 @@
"fieldtype": "Check",
"label": "Allow Sales Order Creation For Expired Quotation"
},
{
"description": "Percentage you are allowed to order more against the Blanket Order Quantity. For example: If you have a Blanket Order of Quantity 100 units. and your Allowance is 10% then you are allowed to order 110 units.",
"fieldname": "over_order_allowance",
"fieldtype": "Float",
"label": "Over Order Allowance (%)"
},
{
"default": "0",
"fieldname": "dont_reserve_sales_order_qty_on_sales_return",
@ -200,6 +194,12 @@
"fieldname": "allow_negative_rates_for_items",
"fieldtype": "Check",
"label": "Allow Negative rates for Items"
},
{
"description": "Percentage you are allowed to sell beyond the Blanket Order quantity.",
"fieldname": "blanket_order_allowance",
"fieldtype": "Float",
"label": "Blanket Order Allowance (%)"
}
],
"icon": "fa fa-cog",
@ -207,7 +207,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-08-14 20:33:05.693667",
"modified": "2023-10-25 14:03:03.966701",
"modified_by": "Administrator",
"module": "Selling",
"name": "Selling Settings",