fix(stock): validate over delivery/receipt allowance in stock settings

This commit is contained in:
Afsal Syed
2026-08-02 02:31:21 +05:30
committed by Sudharsanan Ashok
parent c020de5a69
commit 446ec6030a
2 changed files with 13 additions and 5 deletions

View File

@@ -125,7 +125,8 @@
"description": "The percentage you are allowed to receive or deliver more against the quantity ordered. For example, if you have ordered 100 units, and your Allowance is 10%, then you are allowed to receive 110 units.",
"fieldname": "over_delivery_receipt_allowance",
"fieldtype": "Float",
"label": "Over Delivery/Receipt Allowance (%)"
"label": "Over Delivery/Receipt Allowance (%)",
"non_negative": 1
},
{
"default": "Stop",
@@ -276,7 +277,8 @@
"description": "The percentage you are allowed to transfer more against the quantity ordered. For example, if you have ordered 100 units, and your Allowance is 10%, then you are allowed transfer 110 units.",
"fieldname": "mr_qty_allowance",
"fieldtype": "Float",
"label": "Over Transfer Allowance (%)"
"label": "Over Transfer Allowance (%)",
"non_negative": 1
},
{
"default": "0",
@@ -437,7 +439,8 @@
"description": "The percentage you are allowed to pick more items in the pick list than the ordered quantity.",
"fieldname": "over_picking_allowance",
"fieldtype": "Percent",
"label": "Over Picking Allowance (%)"
"label": "Over Picking Allowance (%)",
"non_negative": 1
},
{
"default": "1",
@@ -590,7 +593,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2026-07-16 17:00:00.000000",
"modified": "2026-08-01 23:35:02.896836",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Settings",

View File

@@ -68,7 +68,7 @@ class StockSettings(Document):
use_naming_series: DF.Check
use_serial_batch_fields: DF.Check
validate_material_transfer_warehouses: DF.Check
valuation_method: DF.Literal["FIFO", "Moving Average", "LIFO"]
valuation_method: DF.Literal["FIFO", "Moving Average", "LIFO", "Standard Cost"]
# end: auto-generated types
def validate(self):
@@ -101,6 +101,7 @@ class StockSettings(Document):
validate_fields_for_doctype=False,
)
self.validate_over_delivery_receipt_allowance()
self.validate_serial_and_batch_no_settings()
self.cant_change_valuation_method()
self.validate_clean_description_html()
@@ -112,6 +113,10 @@ class StockSettings(Document):
self.change_precision_for_stock_entry()
self.validate_do_not_use_batchwise_valuation()
def validate_over_delivery_receipt_allowance(self):
if not self.over_delivery_receipt_allowance:
self.role_allowed_to_over_deliver_receive = None
def validate_do_not_use_batchwise_valuation(self):
doc_before_save = self.get_doc_before_save()
if not doc_before_save: