Merge pull request #37669 from s-aga-r/FIX-37664
refactor: rename field `Over Order Allowance` to `Blanket Order Allowance`
This commit is contained in:
		
						commit
						787fc8737f
					
				| @ -16,7 +16,7 @@ | |||||||
|   "transaction_settings_section", |   "transaction_settings_section", | ||||||
|   "po_required", |   "po_required", | ||||||
|   "pr_required", |   "pr_required", | ||||||
|   "over_order_allowance", |   "blanket_order_allowance", | ||||||
|   "column_break_12", |   "column_break_12", | ||||||
|   "maintain_same_rate", |   "maintain_same_rate", | ||||||
|   "set_landed_cost_based_on_purchase_invoice_rate", |   "set_landed_cost_based_on_purchase_invoice_rate", | ||||||
| @ -159,19 +159,19 @@ | |||||||
|    "fieldtype": "Check", |    "fieldtype": "Check", | ||||||
|    "label": "Set Landed Cost Based on Purchase Invoice Rate" |    "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", |    "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.", |    "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", |    "fieldname": "use_transaction_date_exchange_rate", | ||||||
|    "fieldtype": "Check", |    "fieldtype": "Check", | ||||||
|    "label": "Use Transaction Date Exchange Rate" |    "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", |  "icon": "fa fa-cog", | ||||||
| @ -179,7 +179,7 @@ | |||||||
|  "index_web_pages_for_search": 1, |  "index_web_pages_for_search": 1, | ||||||
|  "issingle": 1, |  "issingle": 1, | ||||||
|  "links": [], |  "links": [], | ||||||
|  "modified": "2023-10-16 16:22:03.201078", |  "modified": "2023-10-25 14:03:32.520418", | ||||||
|  "modified_by": "Administrator", |  "modified_by": "Administrator", | ||||||
|  "module": "Buying", |  "module": "Buying", | ||||||
|  "name": "Buying Settings", |  "name": "Buying Settings", | ||||||
|  | |||||||
| @ -107,7 +107,7 @@ def validate_against_blanket_order(order_doc): | |||||||
| 			allowance = flt( | 			allowance = flt( | ||||||
| 				frappe.db.get_single_value( | 				frappe.db.get_single_value( | ||||||
| 					"Selling Settings" if order_doc.doctype == "Sales Order" else "Buying Settings", | 					"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(): | 			for bo_name, item_data in order_data.items(): | ||||||
|  | |||||||
| @ -63,7 +63,7 @@ class TestBlanketOrder(FrappeTestCase): | |||||||
| 		po1.currency = get_company_currency(po1.company) | 		po1.currency = get_company_currency(po1.company) | ||||||
| 		self.assertEqual(po1.items[0].qty, (bo.items[0].qty - bo.items[0].ordered_qty)) | 		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 | 		# Sales Order | ||||||
| 		bo = make_blanket_order(blanket_order_type="Selling", quantity=100) | 		bo = make_blanket_order(blanket_order_type="Selling", quantity=100) | ||||||
| 
 | 
 | ||||||
| @ -74,7 +74,7 @@ class TestBlanketOrder(FrappeTestCase): | |||||||
| 		so.items[0].qty = 110 | 		so.items[0].qty = 110 | ||||||
| 		self.assertRaises(frappe.ValidationError, so.submit) | 		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() | 		so.submit() | ||||||
| 
 | 
 | ||||||
| 		# Purchase Order | 		# Purchase Order | ||||||
| @ -87,7 +87,7 @@ class TestBlanketOrder(FrappeTestCase): | |||||||
| 		po.items[0].qty = 110 | 		po.items[0].qty = 110 | ||||||
| 		self.assertRaises(frappe.ValidationError, po.submit) | 		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() | 		po.submit() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -341,5 +341,6 @@ execute:frappe.delete_doc("Page", "welcome-to-erpnext") | |||||||
| erpnext.patches.v15_0.delete_payment_gateway_doctypes | erpnext.patches.v15_0.delete_payment_gateway_doctypes | ||||||
| erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item | erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item | ||||||
| erpnext.patches.v15_0.update_sre_from_voucher_details | 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 | # below migration patch should always run last | ||||||
| erpnext.patches.v14_0.migrate_gl_to_payment_ledger | erpnext.patches.v14_0.migrate_gl_to_payment_ledger | ||||||
|  | |||||||
							
								
								
									
										15
									
								
								erpnext/patches/v14_0/rename_over_order_allowance_field.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								erpnext/patches/v14_0/rename_over_order_allowance_field.py
									
									
									
									
									
										Normal 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", | ||||||
|  | 	) | ||||||
| @ -25,7 +25,7 @@ | |||||||
|   "so_required", |   "so_required", | ||||||
|   "dn_required", |   "dn_required", | ||||||
|   "sales_update_frequency", |   "sales_update_frequency", | ||||||
|   "over_order_allowance", |   "blanket_order_allowance", | ||||||
|   "column_break_5", |   "column_break_5", | ||||||
|   "allow_multiple_items", |   "allow_multiple_items", | ||||||
|   "allow_against_multiple_purchase_orders", |   "allow_against_multiple_purchase_orders", | ||||||
| @ -183,12 +183,6 @@ | |||||||
|    "fieldtype": "Check", |    "fieldtype": "Check", | ||||||
|    "label": "Allow Sales Order Creation For Expired Quotation" |    "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", |    "default": "0", | ||||||
|    "fieldname": "dont_reserve_sales_order_qty_on_sales_return", |    "fieldname": "dont_reserve_sales_order_qty_on_sales_return", | ||||||
| @ -200,6 +194,12 @@ | |||||||
|    "fieldname": "allow_negative_rates_for_items", |    "fieldname": "allow_negative_rates_for_items", | ||||||
|    "fieldtype": "Check", |    "fieldtype": "Check", | ||||||
|    "label": "Allow Negative rates for Items" |    "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", |  "icon": "fa fa-cog", | ||||||
| @ -207,7 +207,7 @@ | |||||||
|  "index_web_pages_for_search": 1, |  "index_web_pages_for_search": 1, | ||||||
|  "issingle": 1, |  "issingle": 1, | ||||||
|  "links": [], |  "links": [], | ||||||
|  "modified": "2023-08-14 20:33:05.693667", |  "modified": "2023-10-25 14:03:03.966701", | ||||||
|  "modified_by": "Administrator", |  "modified_by": "Administrator", | ||||||
|  "module": "Selling", |  "module": "Selling", | ||||||
|  "name": "Selling Settings", |  "name": "Selling Settings", | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user