mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 18:21:22 +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")
|
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.migrate_transaction_deletion_task_flags_to_status # 2
|
||||||
erpnext.patches.v16_0.set_ordered_qty_in_quotation_item
|
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",
|
"reserved_stock",
|
||||||
"section_break_pmrs",
|
"section_break_pmrs",
|
||||||
"stock_uom",
|
"stock_uom",
|
||||||
|
"company",
|
||||||
"column_break_0slj",
|
"column_break_0slj",
|
||||||
"valuation_rate",
|
"valuation_rate",
|
||||||
"stock_value"
|
"stock_value"
|
||||||
@@ -132,6 +133,14 @@
|
|||||||
"options": "UOM",
|
"options": "UOM",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fetch_from": "warehouse.company",
|
||||||
|
"fieldname": "company",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company",
|
||||||
|
"options": "Company",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "valuation_rate",
|
"fieldname": "valuation_rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
@@ -186,7 +195,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:06:39.414036",
|
"modified": "2026-02-01 08:11:46.824913",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Bin",
|
"name": "Bin",
|
||||||
@@ -231,6 +240,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
|
"row_format": "Dynamic",
|
||||||
"search_fields": "item_code,warehouse",
|
"search_fields": "item_code,warehouse",
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class Bin(Document):
|
|||||||
from frappe.types import DF
|
from frappe.types import DF
|
||||||
|
|
||||||
actual_qty: DF.Float
|
actual_qty: DF.Float
|
||||||
|
company: DF.Link | None
|
||||||
indented_qty: DF.Float
|
indented_qty: DF.Float
|
||||||
item_code: DF.Link
|
item_code: DF.Link
|
||||||
ordered_qty: DF.Float
|
ordered_qty: DF.Float
|
||||||
|
|||||||
Reference in New Issue
Block a user