mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-12 17:23:38 +00:00
feat(stock): add company field to Bin with migration patch
This commit is contained in:
@@ -461,3 +461,4 @@ erpnext.patches.v15_0.create_accounting_dimensions_in_advance_taxes_and_charges
|
||||
execute:frappe.delete_doc_if_exists("Workspace Sidebar", "Opening & Closing")
|
||||
erpnext.patches.v16_0.migrate_transaction_deletion_task_flags_to_status # 2
|
||||
erpnext.patches.v16_0.set_ordered_qty_in_quotation_item
|
||||
erpnext.patches.v16_0.update_company_custom_field_in_bin
|
||||
14
erpnext/patches/v16_0/update_company_custom_field_in_bin.py
Normal file
14
erpnext/patches/v16_0/update_company_custom_field_in_bin.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc("stock", "doctype", "bin")
|
||||
|
||||
frappe.db.sql(
|
||||
"""
|
||||
UPDATE `tabBin` b
|
||||
INNER JOIN `tabWarehouse` w ON b.warehouse = w.name
|
||||
SET b.company = w.company
|
||||
WHERE b.company IS NULL OR b.company = ''
|
||||
"""
|
||||
)
|
||||
@@ -22,6 +22,7 @@
|
||||
"reserved_stock",
|
||||
"section_break_pmrs",
|
||||
"stock_uom",
|
||||
"company",
|
||||
"column_break_0slj",
|
||||
"valuation_rate",
|
||||
"stock_value"
|
||||
@@ -132,6 +133,14 @@
|
||||
"options": "UOM",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "warehouse.company",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "valuation_rate",
|
||||
"fieldtype": "Float",
|
||||
@@ -186,7 +195,7 @@
|
||||
"idx": 1,
|
||||
"in_create": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:06:39.414036",
|
||||
"modified": "2026-02-01 08:11:46.824913",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Bin",
|
||||
@@ -231,8 +240,9 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"row_format": "Dynamic",
|
||||
"search_fields": "item_code,warehouse",
|
||||
"sort_field": "creation",
|
||||
"sort_order": "ASC",
|
||||
"states": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class Bin(Document):
|
||||
from frappe.types import DF
|
||||
|
||||
actual_qty: DF.Float
|
||||
company: DF.Link | None
|
||||
indented_qty: DF.Float
|
||||
item_code: DF.Link
|
||||
ordered_qty: DF.Float
|
||||
|
||||
Reference in New Issue
Block a user