Merge pull request #17696 from Anurag810/warehouse_type
feat: Added Warehouse Type master
This commit is contained in:
commit
e7b8400fc7
File diff suppressed because it is too large
Load Diff
0
erpnext/stock/doctype/warehouse_type/__init__.py
Normal file
0
erpnext/stock/doctype/warehouse_type/__init__.py
Normal file
10
erpnext/stock/doctype/warehouse_type/test_warehouse_type.py
Normal file
10
erpnext/stock/doctype/warehouse_type/test_warehouse_type.py
Normal file
@ -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 TestWarehouseType(unittest.TestCase):
|
||||
pass
|
8
erpnext/stock/doctype/warehouse_type/warehouse_type.js
Normal file
8
erpnext/stock/doctype/warehouse_type/warehouse_type.js
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('Warehouse Type', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
108
erpnext/stock/doctype/warehouse_type/warehouse_type.json
Normal file
108
erpnext/stock/doctype/warehouse_type/warehouse_type.json
Normal file
@ -0,0 +1,108 @@
|
||||
{
|
||||
"autoname": "Prompt",
|
||||
"creation": "2019-05-21 15:27:06.514511",
|
||||
"doctype": "DocType",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"description"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description"
|
||||
}
|
||||
],
|
||||
"modified": "2019-05-27 18:35:33.354571",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Warehouse Type",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Item Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Stock Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Sales User",
|
||||
"share": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Stock User",
|
||||
"share": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Purchase User",
|
||||
"share": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts User",
|
||||
"share": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Manufacturing User",
|
||||
"share": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1
|
||||
}
|
10
erpnext/stock/doctype/warehouse_type/warehouse_type.py
Normal file
10
erpnext/stock/doctype/warehouse_type/warehouse_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 WarehouseType(Document):
|
||||
pass
|
@ -49,7 +49,24 @@ frappe.query_reports["Stock Balance"] = {
|
||||
"label": __("Warehouse"),
|
||||
"fieldtype": "Link",
|
||||
"width": "80",
|
||||
"options": "Warehouse"
|
||||
"options": "Warehouse",
|
||||
get_query: () => {
|
||||
var warehouse_type = frappe.query_report.get_filter_value('warehouse_type');
|
||||
if(warehouse_type){
|
||||
return {
|
||||
filters: {
|
||||
'warehouse_type': warehouse_type
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname": "warehouse_type",
|
||||
"label": __("Warehouse Type"),
|
||||
"fieldtype": "Link",
|
||||
"width": "80",
|
||||
"options": "Warehouse Type"
|
||||
},
|
||||
{
|
||||
"fieldname":"include_uom",
|
||||
|
@ -113,6 +113,10 @@ def get_conditions(filters):
|
||||
where wh.lft >= %s and wh.rgt <= %s and sle.warehouse = wh.name)"%(warehouse_details.lft,
|
||||
warehouse_details.rgt)
|
||||
|
||||
if filters.get("warehouse_type") and not filters.get("warehouse"):
|
||||
conditions += " and exists (select name from `tabWarehouse` wh \
|
||||
where wh.warehouse_type = '%s' and sle.warehouse = wh.name)"%(filters.get("warehouse_type"))
|
||||
|
||||
return conditions
|
||||
|
||||
def get_stock_ledger_entries(filters, items):
|
||||
|
Loading…
Reference in New Issue
Block a user