Merge pull request #16925 from rohitwaghchaure/stock_entry_enhancements
feat: stock entry enhancements
This commit is contained in:
commit
fa638443bc
@ -89,6 +89,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
}, __('Create'));
|
||||
}
|
||||
|
||||
if (doc.docstatus === 1) {
|
||||
cur_frm.add_custom_button(__('Maintenance Schedule'), function () {
|
||||
cur_frm.cscript.make_maintenance_schedule();
|
||||
}, __('Create'));
|
||||
}
|
||||
|
||||
if(!doc.auto_repeat) {
|
||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||
@ -118,6 +124,13 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
}
|
||||
},
|
||||
|
||||
make_maintenance_schedule: function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_maintenance_schedule",
|
||||
frm: cur_frm
|
||||
})
|
||||
},
|
||||
|
||||
on_submit: function(doc, dt, dn) {
|
||||
var me = this;
|
||||
|
||||
|
||||
@ -1230,6 +1230,22 @@ def get_bank_cash_account(mode_of_payment, company):
|
||||
"account": account
|
||||
}
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_maintenance_schedule(source_name, target_doc=None):
|
||||
doclist = get_mapped_doc("Sales Invoice", source_name, {
|
||||
"Sales Invoice": {
|
||||
"doctype": "Maintenance Schedule",
|
||||
"validation": {
|
||||
"docstatus": ["=", 1]
|
||||
}
|
||||
},
|
||||
"Sales Invoice Item": {
|
||||
"doctype": "Maintenance Schedule Item",
|
||||
},
|
||||
}, target_doc)
|
||||
|
||||
return doclist
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_delivery_note(source_name, target_doc=None):
|
||||
def set_missing_values(source, target):
|
||||
|
||||
@ -444,7 +444,7 @@ def make_rm_stock_entry(purchase_order, rm_items):
|
||||
item_wh = get_item_details(items)
|
||||
|
||||
stock_entry = frappe.new_doc("Stock Entry")
|
||||
stock_entry.purpose = "Subcontract"
|
||||
stock_entry.purpose = "Send to Subcontractor"
|
||||
stock_entry.purchase_order = purchase_order.name
|
||||
stock_entry.supplier = purchase_order.supplier
|
||||
stock_entry.supplier_name = purchase_order.supplier_name
|
||||
@ -452,6 +452,7 @@ def make_rm_stock_entry(purchase_order, rm_items):
|
||||
stock_entry.address_display = purchase_order.address_display
|
||||
stock_entry.company = purchase_order.company
|
||||
stock_entry.to_warehouse = purchase_order.supplier_warehouse
|
||||
stock_entry.set_stock_entry_type()
|
||||
|
||||
for item_code in fg_items:
|
||||
for rm_item_data in rm_items_list:
|
||||
|
||||
@ -729,7 +729,7 @@ def get_subcontracted_raw_materials_from_se(purchase_orders):
|
||||
sed.stock_uom, sed.subcontracted_item as main_item_code, sed.serial_no, sed.batch_no
|
||||
from `tabStock Entry` se,`tabStock Entry Detail` sed
|
||||
where
|
||||
se.name = sed.parent and se.docstatus=1 and se.purpose='Subcontract'
|
||||
se.name = sed.parent and se.docstatus=1 and se.purpose='Send to Subcontractor'
|
||||
and se.purchase_order in (%s) and ifnull(sed.t_warehouse, '') != ''
|
||||
group by sed.item_code, sed.t_warehouse
|
||||
""" % (','.join(['%s'] * len(purchase_orders))), tuple(purchase_orders), as_dict=1)
|
||||
|
||||
@ -568,6 +568,7 @@ def make_stock_entry(production_order_id, purpose, qty=None):
|
||||
stock_entry.bom_no = production_order.bom_no
|
||||
stock_entry.use_multi_level_bom = production_order.use_multi_level_bom
|
||||
stock_entry.fg_completed_qty = qty or (flt(production_order.qty) - flt(production_order.produced_qty))
|
||||
stock_entry.set_stock_entry_type()
|
||||
|
||||
if purpose=="Material Transfer for Manufacture":
|
||||
stock_entry.to_warehouse = wip_warehouse
|
||||
|
||||
@ -625,6 +625,7 @@ def make_stock_entry(work_order_id, purpose, qty=None):
|
||||
additional_costs = get_additional_costs(work_order, fg_qty=stock_entry.fg_completed_qty)
|
||||
stock_entry.set("additional_costs", additional_costs)
|
||||
|
||||
stock_entry.set_stock_entry_type()
|
||||
stock_entry.get_items()
|
||||
return stock_entry.as_dict()
|
||||
|
||||
|
||||
@ -591,4 +591,5 @@ erpnext.patches.v12_0.add_item_name_in_work_orders
|
||||
erpnext.patches.v12_0.update_pricing_rule_fields
|
||||
erpnext.patches.v11_1.make_job_card_time_logs
|
||||
erpnext.patches.v12_0.rename_pricing_rule_child_doctypes
|
||||
erpnext.patches.v12_0.move_target_distribution_from_parent_to_child #wmnfb
|
||||
erpnext.patches.v12_0.move_target_distribution_from_parent_to_child
|
||||
erpnext.patches.v12_0.stock_entry_enhancements
|
||||
|
||||
@ -14,6 +14,6 @@ def execute():
|
||||
set
|
||||
sed.subcontracted_item = pois.main_item_code
|
||||
where
|
||||
se.purpose = 'Subcontract' and sed.parent = se.name
|
||||
se.purpose = 'Send to Subcontractor' and sed.parent = se.name
|
||||
and pois.rm_item_code = sed.item_code and se.docstatus = 1
|
||||
and pois.parenttype = 'Purchase Order'""")
|
||||
52
erpnext/patches/v12_0/stock_entry_enhancements.py
Normal file
52
erpnext/patches/v12_0/stock_entry_enhancements.py
Normal file
@ -0,0 +1,52 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
|
||||
def execute():
|
||||
create_stock_entry_types()
|
||||
|
||||
company = frappe.db.get_value("Company", {'country': 'India'}, 'name')
|
||||
if company:
|
||||
add_gst_hsn_code_field()
|
||||
|
||||
def create_stock_entry_types():
|
||||
frappe.reload_doc('stock', 'doctype', 'stock_entry_type')
|
||||
frappe.reload_doc('stock', 'doctype', 'stock_entry')
|
||||
|
||||
for purpose in ["Material Issue", "Material Receipt", "Material Transfer",
|
||||
"Material Transfer for Manufacture", "Material Consumption for Manufacture", "Manufacture",
|
||||
"Repack", "Send to Subcontractor", "Send to Warehouse", "Receive at Warehouse"]:
|
||||
|
||||
ste_type = frappe.get_doc({
|
||||
'doctype': 'Stock Entry Type',
|
||||
'name': purpose,
|
||||
'purpose': purpose
|
||||
})
|
||||
|
||||
try:
|
||||
ste_type.insert()
|
||||
except frappe.DuplicateEntryError:
|
||||
pass
|
||||
|
||||
frappe.db.sql(" UPDATE `tabStock Entry` set purpose = 'Send to Subcontractor' where purpose = 'Subcontract'")
|
||||
frappe.db.sql(" UPDATE `tabStock Entry` set stock_entry_type = purpose ")
|
||||
|
||||
def add_gst_hsn_code_field():
|
||||
custom_fields = {
|
||||
'Stock Entry Detail': [dict(fieldname='gst_hsn_code', label='HSN/SAC',
|
||||
fieldtype='Data', fetch_from='item_code.gst_hsn_code',
|
||||
insert_after='description', allow_on_submit=1, print_hide=0)]
|
||||
}
|
||||
|
||||
create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch, update=True)
|
||||
|
||||
frappe.db.sql(""" update `tabStock Entry Detail`, `tabItem`
|
||||
SET
|
||||
`tabStock Entry Detail`.gst_hsn_code = `tabItem`.gst_hsn_code
|
||||
Where
|
||||
`tabItem`.name = `tabStock Entry Detail`.item_code and `tabItem`.gst_hsn_code is not null
|
||||
""")
|
||||
@ -82,6 +82,19 @@ def install(country=None):
|
||||
{'doctype': 'Employment Type', 'employee_type_name': _('Intern')},
|
||||
{'doctype': 'Employment Type', 'employee_type_name': _('Apprentice')},
|
||||
|
||||
|
||||
# Stock Entry Type
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Material Issue', 'purpose': 'Material Issue'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Material Receipt', 'purpose': 'Material Receipt'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Material Transfer', 'purpose': 'Material Transfer'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Manufacture', 'purpose': 'Manufacture'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Repack', 'purpose': 'Repack'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Send to Subcontractor', 'purpose': 'Send to Subcontractor'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Material Transfer for Manufacture', 'purpose': 'Material Transfer for Manufacture'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Material Consumption for Manufacture', 'purpose': 'Material Consumption for Manufacture'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Send to Warehouse', 'purpose': 'Send to Warehouse'},
|
||||
{'doctype': 'Stock Entry Type', 'name': 'Receive at Warehouse', 'purpose': 'Receive at Warehouse'},
|
||||
|
||||
# Designation
|
||||
{'doctype': 'Designation', 'designation_name': _('CEO')},
|
||||
{'doctype': 'Designation', 'designation_name': _('Manager')},
|
||||
|
||||
@ -202,6 +202,7 @@ def split_batch(batch_no, item_code, warehouse, qty, new_batch_id=None):
|
||||
),
|
||||
]
|
||||
))
|
||||
stock_entry.set_stock_entry_type()
|
||||
stock_entry.insert()
|
||||
stock_entry.submit()
|
||||
|
||||
|
||||
@ -67,7 +67,10 @@ class TestBatch(unittest.TestCase):
|
||||
rate = 10
|
||||
)
|
||||
]
|
||||
)).insert()
|
||||
))
|
||||
|
||||
stock_entry.set_stock_entry_type()
|
||||
stock_entry.insert()
|
||||
stock_entry.submit()
|
||||
|
||||
self.assertTrue(stock_entry.items[0].batch_no)
|
||||
@ -136,7 +139,10 @@ class TestBatch(unittest.TestCase):
|
||||
s_warehouse=receipt.items[0].warehouse,
|
||||
)
|
||||
]
|
||||
)).insert()
|
||||
))
|
||||
|
||||
stock_entry.set_stock_entry_type()
|
||||
stock_entry.insert()
|
||||
stock_entry.submit()
|
||||
|
||||
# assert same batch is selected
|
||||
@ -193,7 +199,10 @@ class TestBatch(unittest.TestCase):
|
||||
allow_zero_valuation_rate = 1
|
||||
)
|
||||
]
|
||||
)).insert()
|
||||
))
|
||||
|
||||
stock_entry.set_stock_entry_type()
|
||||
stock_entry.insert()
|
||||
stock_entry.submit()
|
||||
|
||||
def test_batch_name_with_naming_series(self):
|
||||
|
||||
@ -106,7 +106,7 @@ class Bin(Document):
|
||||
`tabStock Entry` se, `tabStock Entry Detail` sed, `tabPurchase Order` po
|
||||
where
|
||||
se.docstatus=1
|
||||
and se.purpose='Subcontract'
|
||||
and se.purpose='Send to Subcontractor'
|
||||
and ifnull(se.purchase_order, '') !=''
|
||||
and (sed.item_code = %(item)s or sed.original_item = %(item)s)
|
||||
and se.name = sed.parent
|
||||
|
||||
@ -426,6 +426,7 @@ def make_stock_entry(source_name, target_doc=None):
|
||||
target.purpose = "Material Receipt"
|
||||
|
||||
target.run_method("calculate_rate_and_amount")
|
||||
target.set_stock_entry_type()
|
||||
target.set_job_card_data()
|
||||
|
||||
doclist = get_mapped_doc("Material Request", source_name, {
|
||||
|
||||
@ -96,6 +96,8 @@ class TestMaterialRequest(unittest.TestCase):
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
se.submit()
|
||||
|
||||
@ -388,6 +390,7 @@ class TestMaterialRequest(unittest.TestCase):
|
||||
|
||||
# check for stopped status of Material Request
|
||||
se = frappe.copy_doc(se_doc)
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
mr.update_status('Stopped')
|
||||
self.assertRaises(frappe.InvalidStatusError, se.submit)
|
||||
@ -395,6 +398,7 @@ class TestMaterialRequest(unittest.TestCase):
|
||||
|
||||
mr.update_status('Submitted')
|
||||
se = frappe.copy_doc(se_doc)
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
se.submit()
|
||||
|
||||
|
||||
@ -14,6 +14,16 @@ frappe.ui.form.on('Stock Entry', {
|
||||
}
|
||||
});
|
||||
|
||||
frm.set_query('outgoing_stock_entry', function() {
|
||||
return {
|
||||
filters: [
|
||||
['Stock Entry', 'docstatus', '=', 1],
|
||||
['Stock Entry', 'per_transferred', '<','100'],
|
||||
['Stock Entry', 'purpose', '=', 'Send to Warehouse']
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
frappe.db.get_value('Stock Settings', {name: 'Stock Settings'}, 'sample_retention_warehouse', (r) => {
|
||||
if (r.sample_retention_warehouse) {
|
||||
var filters = [
|
||||
@ -39,7 +49,7 @@ frappe.ui.form.on('Stock Entry', {
|
||||
if(!item.item_code) {
|
||||
frappe.throw(__("Please enter Item Code to get Batch Number"));
|
||||
} else {
|
||||
if (in_list(["Material Transfer for Manufacture", "Manufacture", "Repack", "Subcontract"], doc.purpose)) {
|
||||
if (in_list(["Material Transfer for Manufacture", "Manufacture", "Repack", "Send to Subcontractor"], doc.purpose)) {
|
||||
var filters = {
|
||||
'item_code': item.item_code,
|
||||
'posting_date': frm.doc.posting_date || frappe.datetime.nowdate()
|
||||
@ -92,6 +102,16 @@ frappe.ui.form.on('Stock Entry', {
|
||||
});
|
||||
},
|
||||
|
||||
outgoing_stock_entry: function(frm) {
|
||||
frappe.call({
|
||||
doc: frm.doc,
|
||||
method: "set_items_for_stock_in",
|
||||
callback: function() {
|
||||
refresh_field('items');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
if(!frm.doc.docstatus) {
|
||||
frm.trigger('validate_purpose_consumption');
|
||||
@ -139,6 +159,28 @@ frappe.ui.form.on('Stock Entry', {
|
||||
}
|
||||
}
|
||||
|
||||
if (frm.doc.docstatus === 1 && frm.doc.purpose == 'Send to Warehouse') {
|
||||
if (frm.doc.per_transferred < 100) {
|
||||
frm.add_custom_button(__('Receive at Warehouse Entry'), function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.stock_entry.stock_entry.make_stock_in_entry",
|
||||
frm: frm
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if (frm.doc.per_transferred > 0) {
|
||||
frm.add_custom_button(__('Received Stock Entries'), function() {
|
||||
frappe.route_options = {
|
||||
'outgoing_stock_entry': frm.doc.name,
|
||||
'docstatus': ['!=', 2]
|
||||
};
|
||||
|
||||
frappe.set_route('List', 'Stock Entry');
|
||||
}, __("View"));
|
||||
}
|
||||
}
|
||||
|
||||
if (frm.doc.docstatus===0) {
|
||||
frm.add_custom_button(__('Purchase Invoice'), function() {
|
||||
erpnext.utils.map_current_doc({
|
||||
@ -154,6 +196,23 @@ frappe.ui.form.on('Stock Entry', {
|
||||
}
|
||||
})
|
||||
}, __("Get items from"));
|
||||
|
||||
frm.add_custom_button(__('Material Request'), function() {
|
||||
erpnext.utils.map_current_doc({
|
||||
method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
|
||||
source_doctype: "Material Request",
|
||||
target: frm,
|
||||
date_field: "schedule_date",
|
||||
setters: {
|
||||
company: frm.doc.company,
|
||||
},
|
||||
get_query_filters: {
|
||||
docstatus: 1,
|
||||
material_request_type: "Material Transfer",
|
||||
status: ['!=', 'Transferred']
|
||||
}
|
||||
})
|
||||
}, __("Get items from"));
|
||||
}
|
||||
if (frm.doc.docstatus===0 && frm.doc.purpose == "Material Issue") {
|
||||
frm.add_custom_button(__('Expired Batches'), function() {
|
||||
@ -457,6 +516,7 @@ frappe.ui.form.on('Stock Entry Detail', {
|
||||
'voucher_no' : d.name,
|
||||
'allow_zero_valuation': 1,
|
||||
};
|
||||
|
||||
return frappe.call({
|
||||
doc: frm.doc,
|
||||
method: "get_item_details",
|
||||
@ -721,8 +781,10 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;
|
||||
},
|
||||
|
||||
source_mandatory: ["Material Issue", "Material Transfer", "Subcontract", "Material Transfer for Manufacture"],
|
||||
target_mandatory: ["Material Receipt", "Material Transfer", "Subcontract", "Material Transfer for Manufacture"],
|
||||
source_mandatory: ["Material Issue", "Material Transfer", "Send to Subcontractor",
|
||||
"Material Transfer for Manufacture", "Send to Warehouse", "Receive at Warehouse"],
|
||||
target_mandatory: ["Material Receipt", "Material Transfer", "Send to Subcontractor",
|
||||
"Material Transfer for Manufacture", "Send to Warehouse", "Receive at Warehouse"],
|
||||
|
||||
from_warehouse: function(doc) {
|
||||
var me = this;
|
||||
@ -769,7 +831,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
|
||||
this.frm.cscript.toggle_enable_bom();
|
||||
|
||||
if (doc.purpose == 'Subcontract') {
|
||||
if (doc.purpose == 'Send to Subcontractor') {
|
||||
doc.customer = doc.customer_name = doc.customer_address =
|
||||
doc.delivery_note_no = doc.sales_invoice_no = null;
|
||||
} else {
|
||||
@ -787,6 +849,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
doc.purpose!='Material Issue');
|
||||
|
||||
this.frm.fields_dict["items"].grid.set_column_disp("additional_cost", doc.purpose!='Material Issue');
|
||||
this.frm.toggle_reqd("outgoing_stock_entry",
|
||||
doc.purpose == 'Receive at Warehouse' ? 1: 0);
|
||||
},
|
||||
|
||||
supplier: function(doc) {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "items_section",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -54,6 +55,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "{purpose}",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
@ -87,6 +89,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@ -118,12 +121,12 @@
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Material Issue",
|
||||
"fieldname": "purpose",
|
||||
"fieldtype": "Select",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "stock_entry_type",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
@ -131,13 +134,12 @@
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Purpose",
|
||||
"label": "Stock Entry Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "purpose",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Material Issue\nMaterial Receipt\nMaterial Transfer\nMaterial Transfer for Manufacture\nMaterial Consumption for Manufacture\nManufacture\nRepack\nSubcontract",
|
||||
"options": "Stock Entry Type",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
@ -156,6 +158,79 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose == 'Receive at Warehouse'",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "outgoing_stock_entry",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Stock Entry (Outward GIT)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Stock Entry",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "",
|
||||
"fetch_from": "stock_entry_type.purpose",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "purpose",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Purpose",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "purpose",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Material Issue\nMaterial Receipt\nMaterial Transfer\nMaterial Transfer for Manufacture\nMaterial Consumption for Manufacture\nManufacture\nRepack\nSend to Subcontractor\nSend to Warehouse\nReceive at Warehouse",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -191,6 +266,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Material Transfer for Manufacture\", \"Manufacture\", \"Material Consumption for Manufacture\"], doc.purpose)",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "work_order",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -225,7 +301,8 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Subcontract\"",
|
||||
"depends_on": "eval:doc.purpose==\"Send to Subcontractor\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "purchase_order",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -260,6 +337,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Sales Return\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "delivery_note_no",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -295,6 +373,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Sales Return\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "sales_invoice_no",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -328,6 +407,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "purchase_receipt_no",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -362,72 +442,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Material Issue\", \"Material Transfer\", \"Manufacture\", \"Repack\", \t\t\t\t\t\"Subcontract\", \"Material Transfer for Manufacture\", \"Material Consumption for Manufacture\"], doc.purpose)",
|
||||
"fieldname": "from_bom",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "From BOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "inspection_required",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Inspection Required",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col2",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -463,6 +478,7 @@
|
||||
"columns": 0,
|
||||
"default": "Today",
|
||||
"depends_on": "",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
@ -497,6 +513,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "posting_time",
|
||||
"fieldtype": "Time",
|
||||
"hidden": 0,
|
||||
@ -531,6 +548,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==0",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "set_posting_time",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@ -556,6 +574,74 @@
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "inspection_required",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Inspection Required",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Material Issue\", \"Material Transfer\", \"Manufacture\", \"Repack\", \t\t\t\t\t\"Send to Subcontractor\", \"Material Transfer for Manufacture\", \"Material Consumption for Manufacture\"], doc.purpose)",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "from_bom",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "From BOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
@ -564,6 +650,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval: doc.from_bom && (doc.purpose!==\"Sales Return\" && doc.purpose!==\"Purchase Return\")",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "sb1",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -596,6 +683,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "from_bom",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "bom_no",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -630,6 +718,7 @@
|
||||
"columns": 0,
|
||||
"depends_on": "from_bom",
|
||||
"description": "As per Stock UOM",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "fg_completed_qty",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
@ -663,6 +752,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "cb1",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -696,6 +786,7 @@
|
||||
"default": "1",
|
||||
"depends_on": "from_bom",
|
||||
"description": "Including items for sub assemblies",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "use_multi_level_bom",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@ -728,6 +819,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "from_bom",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "get_items",
|
||||
"fieldtype": "Button",
|
||||
"hidden": 0,
|
||||
@ -760,6 +852,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "section_break_12",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -791,6 +884,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "from_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -826,6 +920,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "from_warehouse",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "source_warehouse_address",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -859,6 +954,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "source_address_display",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
@ -891,6 +987,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "cb0",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -921,6 +1018,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "to_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -956,6 +1054,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "to_warehouse",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "target_warehouse_address",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -989,6 +1088,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "target_address_display",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
@ -1021,6 +1121,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "sb0",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1052,6 +1153,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "scan_barcode",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
@ -1084,6 +1186,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "items",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
@ -1119,6 +1222,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "get_stock_and_rate",
|
||||
"fieldtype": "Button",
|
||||
"hidden": 0,
|
||||
@ -1152,6 +1256,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "section_break_19",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1183,6 +1288,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "total_incoming_value",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -1216,6 +1322,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "column_break_22",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -1247,6 +1354,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "total_outgoing_value",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -1280,6 +1388,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "value_difference",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -1314,6 +1423,7 @@
|
||||
"collapsible": 1,
|
||||
"collapsible_depends_on": "total_additional_costs",
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "additional_costs_section",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1346,6 +1456,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "additional_costs",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
@ -1379,6 +1490,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "total_additional_costs",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -1412,7 +1524,8 @@
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
"columns": 0,
|
||||
"depends_on": "eval: in_list([\"Sales Return\", \"Purchase Return\", \"Subcontract\"], doc.purpose)",
|
||||
"depends_on": "eval: in_list([\"Sales Return\", \"Purchase Return\", \"Send to Subcontractor\"], doc.purpose)",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "contact_section",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1444,7 +1557,8 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Subcontract\"",
|
||||
"depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Send to Subcontractor\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "supplier",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1479,7 +1593,8 @@
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Subcontract\"",
|
||||
"depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Send to Subcontractor\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "supplier_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
@ -1513,7 +1628,8 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Subcontract\"",
|
||||
"depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Send to Subcontractor\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "supplier_address",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1548,6 +1664,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "address_display",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
@ -1580,6 +1697,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "column_break_39",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -1612,6 +1730,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Sales Return\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1647,6 +1766,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Sales Return\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "customer_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
@ -1681,6 +1801,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.purpose==\"Sales Return\"",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "customer_address",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
@ -1714,6 +1835,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "printing_settings",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1746,6 +1868,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "select_print_heading",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1780,6 +1903,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "letter_head",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1813,6 +1937,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "more_info",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1845,6 +1970,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1878,6 +2004,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "remarks",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 0,
|
||||
@ -1911,6 +2038,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col5",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -1936,6 +2064,41 @@
|
||||
"unique": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "per_transferred",
|
||||
"fieldtype": "Percent",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Per Transferred",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
@ -1944,6 +2107,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "total_amount",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "total_amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -1976,6 +2140,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "job_card",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -2009,6 +2174,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -2043,6 +2209,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "credit_note",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
@ -2071,17 +2238,15 @@
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"icon": "fa fa-file-text",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-10-18 04:42:41.452572",
|
||||
"modified": "2019-03-26 12:24:46.439626",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry",
|
||||
@ -2166,7 +2331,6 @@
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"search_fields": "posting_date, from_warehouse, to_warehouse, purpose, remarks",
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
|
||||
@ -15,6 +15,7 @@ from erpnext.stock.doctype.batch.batch import get_batch_no, set_batch_nos, get_b
|
||||
from erpnext.stock.doctype.item.item import get_item_defaults
|
||||
from erpnext.manufacturing.doctype.bom.bom import validate_bom_no, add_additional_cost
|
||||
from erpnext.stock.utils import get_bin
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from erpnext.stock.doctype.serial_no.serial_no import update_serial_nos_after_submit, get_serial_nos
|
||||
|
||||
import json
|
||||
@ -61,6 +62,7 @@ class StockEntry(StockController):
|
||||
self.validate_inspection()
|
||||
self.validate_fg_completed_qty()
|
||||
self.set_job_card_data()
|
||||
self.set_purpose_for_stock_entry()
|
||||
|
||||
if not self.from_bom:
|
||||
self.fg_completed_qty = 0.0
|
||||
@ -81,17 +83,18 @@ class StockEntry(StockController):
|
||||
update_serial_nos_after_submit(self, "items")
|
||||
self.update_work_order()
|
||||
self.validate_purchase_order()
|
||||
if self.purchase_order and self.purpose == "Subcontract":
|
||||
if self.purchase_order and self.purpose == "Send to Subcontractor":
|
||||
self.update_purchase_order_supplied_items()
|
||||
self.make_gl_entries()
|
||||
self.update_cost_in_project()
|
||||
self.validate_reserved_serial_no_consumption()
|
||||
self.update_transferred_qty()
|
||||
if self.work_order and self.purpose == "Manufacture":
|
||||
self.update_so_in_serial_number()
|
||||
|
||||
def on_cancel(self):
|
||||
|
||||
if self.purchase_order and self.purpose == "Subcontract":
|
||||
if self.purchase_order and self.purpose == "Send to Subcontractor":
|
||||
self.update_purchase_order_supplied_items()
|
||||
|
||||
if self.work_order and self.purpose == "Material Consumption for Manufacture":
|
||||
@ -102,6 +105,7 @@ class StockEntry(StockController):
|
||||
self.update_stock_ledger()
|
||||
self.make_gl_entries_on_cancel()
|
||||
self.update_cost_in_project()
|
||||
self.update_transferred_qty()
|
||||
|
||||
def set_job_card_data(self):
|
||||
if self.job_card and not self.work_order:
|
||||
@ -118,8 +122,10 @@ class StockEntry(StockController):
|
||||
frappe.throw(_("Cannot cancel transaction for Completed Work Order."))
|
||||
|
||||
def validate_purpose(self):
|
||||
valid_purposes = ["Material Issue", "Material Receipt", "Material Transfer", "Material Transfer for Manufacture",
|
||||
"Manufacture", "Repack", "Subcontract", "Material Consumption for Manufacture"]
|
||||
valid_purposes = ["Material Issue", "Material Receipt", "Material Transfer",
|
||||
"Material Transfer for Manufacture", "Manufacture", "Repack", "Send to Subcontractor",
|
||||
"Material Consumption for Manufacture", "Send to Warehouse", "Receive at Warehouse"]
|
||||
|
||||
if self.purpose not in valid_purposes:
|
||||
frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes)))
|
||||
|
||||
@ -221,9 +227,11 @@ class StockEntry(StockController):
|
||||
def validate_warehouse(self):
|
||||
"""perform various (sometimes conditional) validations on warehouse"""
|
||||
|
||||
source_mandatory = ["Material Issue", "Material Transfer", "Subcontract", "Material Transfer for Manufacture",
|
||||
"Material Consumption for Manufacture"]
|
||||
target_mandatory = ["Material Receipt", "Material Transfer", "Subcontract", "Material Transfer for Manufacture",]
|
||||
source_mandatory = ["Material Issue", "Material Transfer", "Send to Subcontractor", "Material Transfer for Manufacture",
|
||||
"Material Consumption for Manufacture", "Send to Warehouse", "Receive at Warehouse"]
|
||||
|
||||
target_mandatory = ["Material Receipt", "Material Transfer", "Send to Subcontractor",
|
||||
"Material Transfer for Manufacture", "Send to Warehouse", "Receive at Warehouse"]
|
||||
|
||||
validate_for_manufacture_repack = any([d.bom_no for d in self.get("items")])
|
||||
|
||||
@ -478,13 +486,23 @@ class StockEntry(StockController):
|
||||
if self.purpose not in ['Manufacture', 'Repack']:
|
||||
self.total_amount = sum([flt(item.amount) for item in self.get("items")])
|
||||
|
||||
def set_stock_entry_type(self):
|
||||
if self.purpose:
|
||||
self.stock_entry_type = frappe.get_cached_value('Stock Entry Type',
|
||||
{'purpose': self.purpose}, 'name')
|
||||
|
||||
def set_purpose_for_stock_entry(self):
|
||||
if self.stock_entry_type and not self.purpose:
|
||||
self.purpose = frappe.get_cached_value('Stock Entry Type',
|
||||
self.stock_entry_type, 'purpose')
|
||||
|
||||
def validate_purchase_order(self):
|
||||
"""Throw exception if more raw material is transferred against Purchase Order than in
|
||||
the raw materials supplied table"""
|
||||
backflush_raw_materials_based_on = frappe.db.get_single_value("Buying Settings",
|
||||
"backflush_raw_materials_of_subcontract_based_on")
|
||||
|
||||
if (self.purpose == "Subcontract" and self.purchase_order and
|
||||
if (self.purpose == "Send to Subcontractor" and self.purchase_order and
|
||||
backflush_raw_materials_based_on == 'BOM'):
|
||||
purchase_order = frappe.get_doc("Purchase Order", self.purchase_order)
|
||||
for se_item in self.items:
|
||||
@ -520,7 +538,7 @@ class StockEntry(StockController):
|
||||
"overproduction_percentage_for_work_order"))
|
||||
|
||||
for d in self.get('items'):
|
||||
if self.purpose != "Subcontract" and d.bom_no and flt(d.transfer_qty) > flt(self.fg_completed_qty) and (d.t_warehouse != getattr(self, "pro_doc", frappe._dict()).scrap_warehouse):
|
||||
if self.purpose != "Send to Subcontractor" and d.bom_no and flt(d.transfer_qty) > flt(self.fg_completed_qty) and (d.t_warehouse != getattr(self, "pro_doc", frappe._dict()).scrap_warehouse):
|
||||
frappe.throw(_("Quantity in row {0} ({1}) must be same as manufactured quantity {2}"). \
|
||||
format(d.idx, d.transfer_qty, self.fg_completed_qty))
|
||||
|
||||
@ -684,6 +702,30 @@ class StockEntry(StockController):
|
||||
|
||||
return ret
|
||||
|
||||
def set_items_for_stock_in(self):
|
||||
self.items = []
|
||||
|
||||
if self.outgoing_stock_entry and self.purpose == 'Receive at Warehouse':
|
||||
doc = frappe.get_doc('Stock Entry', self.outgoing_stock_entry)
|
||||
|
||||
if doc.per_transferred == 100:
|
||||
frappe.throw(_("Goods are already received against the outward entry {0}")
|
||||
.format(doc.name))
|
||||
|
||||
for d in doc.items:
|
||||
self.append('items', {
|
||||
's_warehouse': d.t_warehouse,
|
||||
'item_code': d.item_code,
|
||||
'qty': d.qty,
|
||||
'uom': d.uom,
|
||||
'against_stock_entry': d.parent,
|
||||
'ste_detail': d.name,
|
||||
'stock_uom': d.stock_uom,
|
||||
'conversion_factor': d.conversion_factor,
|
||||
'serial_no': d.serial_no,
|
||||
'batch_no': d.batch_no
|
||||
})
|
||||
|
||||
def get_items(self):
|
||||
self.set('items', [])
|
||||
self.validate_work_order()
|
||||
@ -696,7 +738,7 @@ class StockEntry(StockController):
|
||||
if self.bom_no:
|
||||
|
||||
if self.purpose in ["Material Issue", "Material Transfer", "Manufacture", "Repack",
|
||||
"Subcontract", "Material Transfer for Manufacture", "Material Consumption for Manufacture"]:
|
||||
"Send to Subcontractor", "Material Transfer for Manufacture", "Material Consumption for Manufacture"]:
|
||||
|
||||
if self.work_order and self.purpose == "Material Transfer for Manufacture":
|
||||
item_dict = self.get_pending_raw_materials()
|
||||
@ -722,7 +764,7 @@ class StockEntry(StockController):
|
||||
item_dict = self.get_bom_raw_materials(self.fg_completed_qty)
|
||||
|
||||
#Get PO Supplied Items Details
|
||||
if self.purchase_order and self.purpose == "Subcontract":
|
||||
if self.purchase_order and self.purpose == "Send to Subcontractor":
|
||||
#Get PO Supplied Items Details
|
||||
item_wh = frappe._dict(frappe.db.sql("""
|
||||
select rm_item_code, reserve_warehouse
|
||||
@ -734,13 +776,13 @@ class StockEntry(StockController):
|
||||
if self.pro_doc and (cint(self.pro_doc.from_wip_warehouse) or not self.pro_doc.skip_transfer):
|
||||
item["from_warehouse"] = self.pro_doc.wip_warehouse
|
||||
#Get Reserve Warehouse from PO
|
||||
if self.purchase_order and self.purpose=="Subcontract":
|
||||
if self.purchase_order and self.purpose=="Send to Subcontractor":
|
||||
item["from_warehouse"] = item_wh.get(item.item_code)
|
||||
item["to_warehouse"] = self.to_warehouse if self.purpose=="Subcontract" else ""
|
||||
item["to_warehouse"] = self.to_warehouse if self.purpose=="Send to Subcontractor" else ""
|
||||
|
||||
self.add_to_stock_entry_detail(item_dict)
|
||||
|
||||
if self.purpose != "Subcontract":
|
||||
if self.purpose != "Send to Subcontractor":
|
||||
scrap_item_dict = self.get_bom_scrap_material(self.fg_completed_qty)
|
||||
for item in itervalues(scrap_item_dict):
|
||||
if self.pro_doc and self.pro_doc.scrap_warehouse:
|
||||
@ -1074,7 +1116,7 @@ class StockEntry(StockController):
|
||||
frappe.MappingMismatchError)
|
||||
|
||||
def validate_batch(self):
|
||||
if self.purpose in ["Material Transfer for Manufacture", "Manufacture", "Repack", "Subcontract", "Material Issue"]:
|
||||
if self.purpose in ["Material Transfer for Manufacture", "Manufacture", "Repack", "Send to Subcontractor", "Material Issue"]:
|
||||
for item in self.get("items"):
|
||||
if item.batch_no:
|
||||
disabled = frappe.db.get_value("Batch", item.batch_no, "disabled")
|
||||
@ -1130,6 +1172,52 @@ class StockEntry(StockController):
|
||||
frappe.throw(_("Item {0} (Serial No: {1}) cannot be consumed as is reserverd\
|
||||
to fullfill Sales Order {2}.").format(item.item_code, sr, sales_order))
|
||||
|
||||
def update_transferred_qty(self):
|
||||
if self.purpose == 'Receive at Warehouse':
|
||||
stock_entries = {}
|
||||
stock_entries_child_list = []
|
||||
for d in self.items:
|
||||
if not (d.against_stock_entry and d.ste_detail):
|
||||
continue
|
||||
|
||||
stock_entries_child_list.append(d.ste_detail)
|
||||
transferred_qty = frappe.get_all("Stock Entry Detail", fields = ["sum(qty) as qty"],
|
||||
filters = { 'against_stock_entry': d.against_stock_entry,
|
||||
'ste_detail': d.ste_detail,'docstatus': 1})
|
||||
|
||||
stock_entries[(d.against_stock_entry, d.ste_detail)] = (transferred_qty[0].qty
|
||||
if transferred_qty and transferred_qty[0] else 0.0) or 0.0
|
||||
|
||||
if not stock_entries: return None
|
||||
|
||||
cond = ''
|
||||
for data, transferred_qty in stock_entries.items():
|
||||
cond += """ WHEN (parent = %s and name = %s) THEN %s
|
||||
""" %(frappe.db.escape(data[0]), frappe.db.escape(data[1]), transferred_qty)
|
||||
|
||||
if cond and stock_entries_child_list:
|
||||
frappe.db.sql(""" UPDATE `tabStock Entry Detail`
|
||||
SET
|
||||
transferred_qty = CASE {cond} END
|
||||
WHERE
|
||||
name in ({ste_details}) """.format(cond=cond,
|
||||
ste_details = ','.join(['%s'] * len(stock_entries_child_list))),
|
||||
tuple(stock_entries_child_list))
|
||||
|
||||
args = {
|
||||
'source_dt': 'Stock Entry Detail',
|
||||
'target_field': 'transferred_qty',
|
||||
'target_ref_field': 'qty',
|
||||
'target_dt': 'Stock Entry Detail',
|
||||
'join_field': 'ste_detail',
|
||||
'target_parent_dt': 'Stock Entry',
|
||||
'target_parent_field': 'per_transferred',
|
||||
'source_field': 'qty',
|
||||
'percent_join_field': 'against_stock_entry'
|
||||
}
|
||||
|
||||
self._update_percent_field_in_targets(args, update_modified=True)
|
||||
|
||||
@frappe.whitelist()
|
||||
def move_sample_to_retention_warehouse(company, items):
|
||||
if isinstance(items, string_types):
|
||||
@ -1138,6 +1226,7 @@ def move_sample_to_retention_warehouse(company, items):
|
||||
stock_entry = frappe.new_doc("Stock Entry")
|
||||
stock_entry.company = company
|
||||
stock_entry.purpose = "Material Transfer"
|
||||
stock_entry.set_stock_entry_type()
|
||||
for item in items:
|
||||
if item.get('sample_quantity') and item.get('batch_no'):
|
||||
sample_quantity = validate_sample_quantity(item.get('item_code'), item.get('sample_quantity'),
|
||||
@ -1165,6 +1254,42 @@ def move_sample_to_retention_warehouse(company, items):
|
||||
if stock_entry.get('items'):
|
||||
return stock_entry.as_dict()
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_stock_in_entry(source_name, target_doc=None):
|
||||
def set_missing_values(source, target):
|
||||
target.purpose = 'Receive at Warehouse'
|
||||
target.set_stock_entry_type()
|
||||
|
||||
def update_item(source_doc, target_doc, source_parent):
|
||||
target_doc.t_warehouse = ''
|
||||
target_doc.s_warehouse = source_doc.t_warehouse
|
||||
target_doc.qty = source_doc.qty - source_doc.transferred_qty
|
||||
|
||||
doclist = get_mapped_doc("Stock Entry", source_name, {
|
||||
"Stock Entry": {
|
||||
"doctype": "Stock Entry",
|
||||
"field_map": {
|
||||
"name": "outgoing_stock_entry"
|
||||
},
|
||||
"validation": {
|
||||
"docstatus": ["=", 1]
|
||||
}
|
||||
},
|
||||
"Stock Entry Detail": {
|
||||
"doctype": "Stock Entry Detail",
|
||||
"field_map": {
|
||||
"name": "ste_detail",
|
||||
"parent": "against_stock_entry",
|
||||
"serial_no": "serial_no",
|
||||
"batch_no": "batch_no"
|
||||
},
|
||||
"postprocess": update_item,
|
||||
"condition": lambda doc: flt(doc.qty) - flt(doc.transferred_qty) > 0.01
|
||||
},
|
||||
}, target_doc, set_missing_values)
|
||||
|
||||
return doclist
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_work_order_details(work_order):
|
||||
work_order = frappe.get_doc("Work Order", work_order)
|
||||
@ -1224,7 +1349,7 @@ def get_used_alternative_items(purchase_order=None, work_order=None):
|
||||
cond = ""
|
||||
|
||||
if purchase_order:
|
||||
cond = "and ste.purpose = 'Subcontract' and ste.purchase_order = '{0}'".format(purchase_order)
|
||||
cond = "and ste.purpose = 'Send to Subcontractor' and ste.purchase_order = '{0}'".format(purchase_order)
|
||||
elif work_order:
|
||||
cond = "and ste.purpose = 'Material Transfer for Manufacture' and ste.work_order = '{0}'".format(work_order)
|
||||
|
||||
|
||||
@ -1,6 +1,22 @@
|
||||
frappe.listview_settings['Stock Entry'] = {
|
||||
add_fields: ["`tabStock Entry`.`from_warehouse`", "`tabStock Entry`.`to_warehouse`",
|
||||
"`tabStock Entry`.`purpose`", "`tabStock Entry`.`work_order`", "`tabStock Entry`.`bom_no`"],
|
||||
get_indicator: function (doc) {
|
||||
if (doc.docstatus === 0) {
|
||||
return [__("Draft"), "red", "docstatus,=,0"];
|
||||
|
||||
} else if (doc.purpose === 'Send to Warehouse' && doc.per_transferred < 100) {
|
||||
// not delivered & overdue
|
||||
return [__("Goods In Transit"), "grey", "per_transferred,<,100"];
|
||||
|
||||
} else if (doc.purpose === 'Send to Warehouse' && doc.per_transferred === 100) {
|
||||
return [__("Goods Transferred"), "green", "per_transferred,=,100"];
|
||||
} else if (doc.docstatus === 2) {
|
||||
return [__("Canceled"), "red", "docstatus,=,2"];
|
||||
} else {
|
||||
return [__("Submitted"), "blue", "docstatus,=,1"];
|
||||
}
|
||||
},
|
||||
column_render: {
|
||||
"from_warehouse": function(doc) {
|
||||
var html = "";
|
||||
|
||||
@ -124,6 +124,7 @@ def make_stock_entry(**args):
|
||||
'expense_account': args.expense_account
|
||||
})
|
||||
|
||||
s.set_stock_entry_type()
|
||||
if not args.do_not_save:
|
||||
s.insert()
|
||||
if not args.do_not_submit:
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Stock Entry",
|
||||
"stock_entry_type": "Material Receipt",
|
||||
"purpose": "Material Receipt",
|
||||
"items": [
|
||||
{
|
||||
"conversion_factor": 1.0,
|
||||
@ -17,14 +19,14 @@
|
||||
"transfer_qty": 50.0,
|
||||
"uom": "_Test UOM"
|
||||
}
|
||||
],
|
||||
"purpose": "Material Receipt"
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Stock Entry",
|
||||
"posting_date": "2013-01-25",
|
||||
"purpose": "Material Issue",
|
||||
"stock_entry_type": "Material Issue",
|
||||
"items": [
|
||||
{
|
||||
"conversion_factor": 1.0,
|
||||
@ -40,15 +42,14 @@
|
||||
"transfer_qty": 40.0,
|
||||
"uom": "_Test UOM"
|
||||
}
|
||||
],
|
||||
"posting_date": "2013-01-25",
|
||||
"purpose": "Material Issue"
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Stock Entry",
|
||||
"posting_date": "2013-01-25",
|
||||
"purpose": "Material Transfer",
|
||||
"stock_entry_type": "Material Transfer",
|
||||
"items": [
|
||||
{
|
||||
"conversion_factor": 1.0,
|
||||
@ -65,15 +66,13 @@
|
||||
"transfer_qty": 45.0,
|
||||
"uom": "_Test UOM"
|
||||
}
|
||||
],
|
||||
"posting_date": "2013-01-25",
|
||||
"purpose": "Material Transfer"
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Stock Entry",
|
||||
"purpose": "Repack",
|
||||
"stock_entry_type": "Repack",
|
||||
"items": [
|
||||
{
|
||||
"conversion_factor": 1.0,
|
||||
@ -103,7 +102,6 @@
|
||||
"transfer_qty": 1,
|
||||
"uom": "_Test UOM"
|
||||
}
|
||||
],
|
||||
"purpose": "Repack"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -15,7 +15,7 @@ from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import
|
||||
from erpnext.stock.doctype.item.test_item import set_item_variant_settings, make_item_variant, create_item
|
||||
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
|
||||
from erpnext.accounts.doctype.account.test_account import get_inventory_account
|
||||
from erpnext.stock.doctype.stock_entry.stock_entry import move_sample_to_retention_warehouse
|
||||
from erpnext.stock.doctype.stock_entry.stock_entry import move_sample_to_retention_warehouse, make_stock_in_entry
|
||||
|
||||
from six import iteritems
|
||||
|
||||
@ -239,6 +239,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
repack = frappe.copy_doc(test_records[3])
|
||||
repack.posting_date = nowdate()
|
||||
repack.posting_time = nowtime()
|
||||
repack.set_stock_entry_type()
|
||||
repack.insert()
|
||||
repack.submit()
|
||||
|
||||
@ -272,6 +273,8 @@ class TestStockEntry(unittest.TestCase):
|
||||
"amount": 200
|
||||
},
|
||||
])
|
||||
|
||||
repack.set_stock_entry_type()
|
||||
repack.insert()
|
||||
repack.submit()
|
||||
|
||||
@ -327,6 +330,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
def test_serial_no_not_reqd(self):
|
||||
se = frappe.copy_doc(test_records[0])
|
||||
se.get("items")[0].serial_no = "ABCD"
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(SerialNoNotRequiredError, se.submit)
|
||||
|
||||
@ -335,6 +339,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].item_code = "_Test Serialized Item"
|
||||
se.get("items")[0].qty = 2
|
||||
se.get("items")[0].transfer_qty = 2
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(SerialNoRequiredError, se.submit)
|
||||
|
||||
@ -344,6 +349,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].qty = 2
|
||||
se.get("items")[0].serial_no = "ABCD\nEFGH\nXYZ"
|
||||
se.get("items")[0].transfer_qty = 2
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(SerialNoQtyError, se.submit)
|
||||
|
||||
@ -353,6 +359,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].qty = 2
|
||||
se.get("items")[0].serial_no = "ABCD"
|
||||
se.get("items")[0].transfer_qty = 2
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(SerialNoQtyError, se.submit)
|
||||
|
||||
@ -362,6 +369,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].qty = 2
|
||||
se.get("items")[0].serial_no = "ABCD\nEFGH"
|
||||
se.get("items")[0].transfer_qty = 2
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
se.submit()
|
||||
|
||||
@ -382,6 +390,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].t_warehouse = None
|
||||
se.get("items")[0].serial_no = "ABCD\nEFGH"
|
||||
se.get("items")[0].transfer_qty = 2
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
|
||||
self.assertRaises(SerialNoNotExistsError, se.submit)
|
||||
@ -394,6 +403,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].qty = 1
|
||||
se.get("items")[0].serial_no = serial_nos[0]
|
||||
se.get("items")[0].transfer_qty = 1
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(SerialNoDuplicateError, se.submit)
|
||||
|
||||
@ -420,6 +430,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].serial_no = serial_nos[0]
|
||||
se.get("items")[0].s_warehouse = "_Test Warehouse - _TC"
|
||||
se.get("items")[0].t_warehouse = "_Test Warehouse 1 - _TC"
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(SerialNoItemError, se.submit)
|
||||
|
||||
@ -435,6 +446,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].serial_no = serial_no
|
||||
se.get("items")[0].s_warehouse = "_Test Warehouse - _TC"
|
||||
se.get("items")[0].t_warehouse = "_Test Warehouse 1 - _TC"
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
se.submit()
|
||||
self.assertTrue(frappe.db.get_value("Serial No", serial_no, "warehouse"), "_Test Warehouse 1 - _TC")
|
||||
@ -456,6 +468,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se.get("items")[0].serial_no = serial_nos[0]
|
||||
se.get("items")[0].s_warehouse = "_Test Warehouse 1 - _TC"
|
||||
se.get("items")[0].t_warehouse = "_Test Warehouse - _TC"
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(SerialNoWarehouseError, se.submit)
|
||||
|
||||
@ -476,6 +489,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
from erpnext.stock.utils import InvalidWarehouseCompany
|
||||
st1 = frappe.copy_doc(test_records[0])
|
||||
st1.get("items")[0].t_warehouse="_Test Warehouse 2 - _TC1"
|
||||
st1.set_stock_entry_type()
|
||||
st1.insert()
|
||||
self.assertRaises(InvalidWarehouseCompany, st1.submit)
|
||||
|
||||
@ -506,6 +520,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
st1.get("items")[0].t_warehouse="_Test Warehouse 2 - _TC1"
|
||||
st1.get("items")[0].expense_account = "Stock Adjustment - _TC1"
|
||||
st1.get("items")[0].cost_center = "Main - _TC1"
|
||||
st1.set_stock_entry_type()
|
||||
st1.insert()
|
||||
st1.submit()
|
||||
|
||||
@ -529,6 +544,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
se = frappe.copy_doc(test_records[0])
|
||||
se.set_posting_time = 1
|
||||
se.posting_date = add_days(nowdate(), -15)
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
self.assertRaises(StockFreezeError, se.submit)
|
||||
frappe.db.set_value("Stock Settings", None, "stock_frozen_upto_days", 0)
|
||||
@ -644,6 +660,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
"sample_quantity": 4
|
||||
})
|
||||
receipt_entry.set_stock_entry_type()
|
||||
receipt_entry.insert()
|
||||
receipt_entry.submit()
|
||||
|
||||
@ -660,6 +677,7 @@ class TestStockEntry(unittest.TestCase):
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
"batch_no": receipt_entry.get("items")[0].batch_no
|
||||
})
|
||||
retention_entry.set_stock_entry_type()
|
||||
retention_entry.insert()
|
||||
retention_entry.submit()
|
||||
|
||||
@ -726,6 +744,33 @@ class TestStockEntry(unittest.TestCase):
|
||||
self.assertEqual(se.get("items")[0].allow_zero_valuation_rate, 1)
|
||||
self.assertEqual(se.get("items")[0].amount, 0)
|
||||
|
||||
def test_goods_in_transit(self):
|
||||
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
|
||||
warehouse = "_Test Warehouse FG 1 - _TC"
|
||||
|
||||
if not frappe.db.exists('Warehouse', warehouse):
|
||||
create_warehouse("_Test Warehouse FG 1")
|
||||
|
||||
outward_entry = make_stock_entry(item_code="_Test Item",
|
||||
purpose="Send to Warehouse",
|
||||
source="_Test Warehouse - _TC",
|
||||
target="_Test Warehouse 1 - _TC", qty=50, basic_rate=100)
|
||||
|
||||
inward_entry1 = make_stock_in_entry(outward_entry.name)
|
||||
inward_entry1.items[0].t_warehouse = warehouse
|
||||
inward_entry1.items[0].qty = 25
|
||||
inward_entry1.submit()
|
||||
|
||||
doc = frappe.get_doc('Stock Entry', outward_entry.name)
|
||||
self.assertEqual(doc.per_transferred, 50)
|
||||
|
||||
inward_entry2 = make_stock_in_entry(outward_entry.name)
|
||||
inward_entry2.items[0].t_warehouse = warehouse
|
||||
inward_entry2.items[0].qty = 25
|
||||
inward_entry2.submit()
|
||||
|
||||
doc = frappe.get_doc('Stock Entry', outward_entry.name)
|
||||
self.assertEqual(doc.per_transferred, 100)
|
||||
|
||||
def make_serialized_item(item_code=None, serial_no=None, target_warehouse=None):
|
||||
se = frappe.copy_doc(test_records[0])
|
||||
@ -737,6 +782,7 @@ def make_serialized_item(item_code=None, serial_no=None, target_warehouse=None):
|
||||
if target_warehouse:
|
||||
se.get("items")[0].t_warehouse = target_warehouse
|
||||
|
||||
se.set_stock_entry_type()
|
||||
se.insert()
|
||||
se.submit()
|
||||
return se
|
||||
|
||||
@ -6,7 +6,7 @@ QUnit.test("test material Transfer to manufacture", function(assert) {
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Stock Entry', [
|
||||
{purpose:'Subcontract'},
|
||||
{purpose:'Send to Subcontractor'},
|
||||
{from_warehouse:'Work In Progress - '+frappe.get_abbr(frappe.defaults.get_default('Company'))},
|
||||
{to_warehouse:'Finished Goods - '+frappe.get_abbr(frappe.defaults.get_default('Company'))},
|
||||
{items: [
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "barcode",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
@ -53,6 +54,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "section_break_2",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -84,6 +86,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 2,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "s_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -118,6 +121,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col_break1",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -148,6 +152,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 2,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "t_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -182,6 +187,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "sec_break1",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -212,6 +218,7 @@
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 3,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "item_code",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -246,6 +253,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col_break2",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -276,6 +284,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "item_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
@ -307,6 +316,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "section_break_8",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -339,6 +349,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
@ -374,6 +385,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "column_break_10",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -405,6 +417,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Attach",
|
||||
"hidden": 1,
|
||||
@ -437,6 +450,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "image_view",
|
||||
"fieldtype": "Image",
|
||||
"hidden": 0,
|
||||
@ -470,6 +484,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "quantity_and_rate",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -501,6 +516,7 @@
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 3,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "qty",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
@ -534,6 +550,7 @@
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "basic_rate",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -568,6 +585,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "basic_amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -601,6 +619,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "additional_cost",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -634,6 +653,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -668,6 +688,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "valuation_rate",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@ -701,6 +722,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col_break3",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -731,6 +753,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "uom",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -765,6 +788,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "conversion_factor",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
@ -798,6 +822,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "stock_uom",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -832,6 +857,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "transfer_qty",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
@ -866,6 +892,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_from": "item_code.retain_sample",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "retain_sample",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@ -900,6 +927,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "retain_sample",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "sample_quantity",
|
||||
"fieldtype": "Int",
|
||||
"hidden": 0,
|
||||
@ -933,6 +961,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "serial_no_batch",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -964,6 +993,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "serial_no",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
@ -997,6 +1027,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col_break4",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -1027,6 +1058,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "batch_no",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1062,6 +1094,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:parent.inspection_required && doc.t_warehouse",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "quality_inspection",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1095,6 +1128,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "accounting",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1127,6 +1161,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:cint(erpnext.is_perpetual_inventory_enabled(parent.company))",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "expense_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1159,6 +1194,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col_break5",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -1191,6 +1227,7 @@
|
||||
"columns": 0,
|
||||
"default": ":Company",
|
||||
"depends_on": "eval:cint(erpnext.is_perpetual_inventory_enabled(parent.company))",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "cost_center",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1223,6 +1260,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "more_info",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@ -1254,6 +1292,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "allow_zero_valuation_rate",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@ -1286,6 +1325,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "actual_qty",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
@ -1320,6 +1360,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "BOM No. for a Finished Good Item",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "bom_no",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
@ -1353,6 +1394,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "s_warehouse",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "allow_alternative_item",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@ -1385,6 +1427,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "col_break6",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@ -1416,6 +1459,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Material Request used to make this Stock Entry",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "material_request",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
@ -1448,6 +1492,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "material_request_item",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
@ -1480,6 +1525,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "original_item",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
@ -1513,6 +1559,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "subcontracted_item",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1538,6 +1585,171 @@
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "reference_section",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "against_stock_entry",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Against Stock Entry",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "Stock Entry",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "ste_detail",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Stock Entry Child",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "column_break_51",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "transferred_qty",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Transferred Qty",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
@ -1550,7 +1762,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2019-01-07 16:58:58.769285",
|
||||
"modified": "2019-03-13 19:15:04.678398",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry Detail",
|
||||
|
||||
0
erpnext/stock/doctype/stock_entry_type/__init__.py
Normal file
0
erpnext/stock/doctype/stock_entry_type/__init__.py
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Stock Entry Type', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
156
erpnext/stock/doctype/stock_entry_type/stock_entry_type.json
Normal file
156
erpnext/stock/doctype/stock_entry_type/stock_entry_type.json
Normal file
@ -0,0 +1,156 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "Prompt",
|
||||
"beta": 0,
|
||||
"creation": "2019-03-13 16:23:46.636769",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Material Issue",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "purpose",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Purpose",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nMaterial Issue\nMaterial Receipt\nMaterial Transfer\nMaterial Transfer for Manufacture\nMaterial Consumption for Manufacture\nManufacture\nRepack\nSend to Subcontractor\nSend to Warehouse\nReceive at Warehouse",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 1,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2019-03-26 12:02:42.144377",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry Type",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Manufacturing Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Stock Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Stock User",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
10
erpnext/stock/doctype/stock_entry_type/stock_entry_type.py
Normal file
10
erpnext/stock/doctype/stock_entry_type/stock_entry_type.py
Normal file
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class StockEntryType(Document):
|
||||
pass
|
||||
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestStockEntryType(unittest.TestCase):
|
||||
pass
|
||||
@ -59,7 +59,7 @@ def get_consumed_items(condition):
|
||||
sum(se_item.transfer_qty) as 'consume_qty'
|
||||
from `tabStock Entry` se, `tabStock Entry Detail` se_item
|
||||
where se.name = se_item.parent and se.docstatus = 1
|
||||
and (ifnull(se_item.t_warehouse, '') = '' or se.purpose = 'Subcontract') %s
|
||||
and (ifnull(se_item.t_warehouse, '') = '' or se.purpose = 'Send to Subcontractor') %s
|
||||
group by se_item.item_code""" % (condition), as_dict=1)
|
||||
|
||||
cn_items_map = {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user