feat: batchwise valuation flag
This is required to avoid breaking behaviour in valuation of old batches
This commit is contained in:
parent
00e8565868
commit
f4af75f60b
@ -353,3 +353,4 @@ erpnext.patches.v13_0.update_reserved_qty_closed_wo
|
||||
erpnext.patches.v13_0.update_exchange_rate_settings
|
||||
erpnext.patches.v14_0.delete_amazon_mws_doctype
|
||||
erpnext.patches.v13_0.set_work_order_qty_in_so_from_mr
|
||||
erpnext.patches.v14_0.update_batch_valuation_flag
|
||||
|
12
erpnext/patches/v14_0/update_batch_valuation_flag.py
Normal file
12
erpnext/patches/v14_0/update_batch_valuation_flag.py
Normal file
@ -0,0 +1,12 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
"""
|
||||
- Don't use batchwise valuation for existing batches.
|
||||
- Only batches created after this patch shoule use it.
|
||||
"""
|
||||
frappe.db.sql("""
|
||||
UPDATE `tabBatch`
|
||||
SET use_batchwise_valuation=0
|
||||
""")
|
@ -9,6 +9,8 @@
|
||||
"field_order": [
|
||||
"sb_disabled",
|
||||
"disabled",
|
||||
"column_break_24",
|
||||
"use_batchwise_valuation",
|
||||
"sb_batch",
|
||||
"batch_id",
|
||||
"item",
|
||||
@ -186,6 +188,18 @@
|
||||
"fieldtype": "Float",
|
||||
"label": "Produced Qty",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_24",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "1",
|
||||
"fieldname": "use_batchwise_valuation",
|
||||
"fieldtype": "Check",
|
||||
"label": "Use Batch-wise Valuation",
|
||||
"read_only": 1,
|
||||
"set_only_once": 1
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-archive",
|
||||
@ -193,7 +207,7 @@
|
||||
"image_field": "image",
|
||||
"links": [],
|
||||
"max_attachments": 5,
|
||||
"modified": "2021-07-08 16:22:01.343105",
|
||||
"modified": "2021-10-11 13:38:12.806976",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Batch",
|
||||
|
Loading…
x
Reference in New Issue
Block a user