Merge pull request #18172 from karthikeyan5/develop-terms-selling-buying-filter
feat(setup): adding selling buying filter in terms and conditions
diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py
new file mode 100644
index 0000000..ed319a0
--- /dev/null
+++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py
@@ -0,0 +1,12 @@
+from __future__ import unicode_literals
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'blanket_order',
+ 'transactions': [
+ {
+ 'items': ['Purchase Order', 'Sales Order']
+ }
+ ]
+ }
diff --git a/erpnext/manufacturing/doctype/bom/bom_dashboard.py b/erpnext/manufacturing/doctype/bom/bom_dashboard.py
new file mode 100644
index 0000000..803ece7
--- /dev/null
+++ b/erpnext/manufacturing/doctype/bom/bom_dashboard.py
@@ -0,0 +1,27 @@
+from __future__ import unicode_literals
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'bom_no',
+ 'non_standard_fieldnames': {
+ 'Item': 'default_bom',
+ 'Purchase Order': 'bom',
+ 'Purchase Receipt': 'bom',
+ 'Purchase Invoice': 'bom'
+ },
+ 'transactions': [
+ {
+ 'label': _('Stock'),
+ 'items': ['Item', 'Stock Entry', 'Quality Inspection']
+ },
+ {
+ 'label': _('Manufacture'),
+ 'items': ['BOM', 'Work Order', 'Job Card', 'Production Plan']
+ },
+ {
+ 'label': _('Purchase'),
+ 'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
+ }
+ ]
+ }
diff --git a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
index d48bccf..c2aa2bd 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
+++ b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
@@ -10,4 +10,4 @@
'items': ['Material Request', 'Stock Entry']
}
]
- }
\ No newline at end of file
+ }
diff --git a/erpnext/manufacturing/doctype/operation/operation_dashboard.py b/erpnext/manufacturing/doctype/operation/operation_dashboard.py
new file mode 100644
index 0000000..8deb9ec
--- /dev/null
+++ b/erpnext/manufacturing/doctype/operation/operation_dashboard.py
@@ -0,0 +1,13 @@
+from __future__ import unicode_literals
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'operation',
+ 'transactions': [
+ {
+ 'label': _('Manufacture'),
+ 'items': ['BOM', 'Work Order', 'Job Card', 'Timesheet']
+ }
+ ]
+ }
diff --git a/erpnext/manufacturing/doctype/routing/routing_dashboard.py b/erpnext/manufacturing/doctype/routing/routing_dashboard.py
new file mode 100644
index 0000000..ab309cc
--- /dev/null
+++ b/erpnext/manufacturing/doctype/routing/routing_dashboard.py
@@ -0,0 +1,12 @@
+from __future__ import unicode_literals
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'routing',
+ 'transactions': [
+ {
+ 'items': ['BOM']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py
new file mode 100644
index 0000000..9e0d1d1
--- /dev/null
+++ b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py
@@ -0,0 +1,13 @@
+from __future__ import unicode_literals
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'workstation',
+ 'transactions': [
+ {
+ 'label': _('Manufacture'),
+ 'items': ['BOM', 'Routing', 'Work Order', 'Job Card', 'Operation', 'Timesheet']
+ }
+ ]
+ }
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 3936bf7..164ffa4 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -76,7 +76,6 @@
"is_customer_provided_item",
"customer",
"supplier_details",
- "manufacturers",
"delivered_by_supplier",
"column_break2",
"supplier_items",
@@ -1022,12 +1021,6 @@
"fieldtype": "Check",
"label": "Synced With Hub",
"read_only": 1
- },
- {
- "fieldname": "manufacturers",
- "fieldtype": "Table",
- "label": "Manufacturers",
- "options": "Item Manufacturer"
}
],
"has_web_view": 1,
@@ -1035,7 +1028,7 @@
"idx": 2,
"image_field": "image",
"max_attachments": 1,
- "modified": "2019-06-02 04:45:59.911507",
+ "modified": "2019-07-05 12:18:13.977931",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
@@ -1097,4 +1090,4 @@
"sort_order": "DESC",
"title_field": "item_name",
"track_changes": 1
- }
\ No newline at end of file
+ }
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 80d4e17..6484b93 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -122,6 +122,7 @@
self.validate_item_defaults()
self.validate_customer_provided_part()
self.update_defaults_from_item_group()
+ self.validate_auto_reorder_enabled_in_stock_settings()
self.cant_change()
if not self.get("__islocal"):
@@ -859,6 +860,12 @@
filters={"production_item": self.name, "docstatus": 1}):
return True
+ def validate_auto_reorder_enabled_in_stock_settings(self):
+ if self.reorder_levels:
+ enabled = frappe.db.get_single_value('Stock Settings', 'auto_indent')
+ if not enabled:
+ frappe.msgprint(msg=_("You have to enable auto re-order in Stock Settings to maintain re-order levels."), title=_("Enable Auto Re-Order"), indicator="orange")
+
def get_timeline_data(doctype, name):
'''returns timeline data based on stock ledger entry'''
out = {}
diff --git a/erpnext/stock/doctype/item/item_dashboard.py b/erpnext/stock/doctype/item/item_dashboard.py
index b3733d3..dd4676a 100644
--- a/erpnext/stock/doctype/item/item_dashboard.py
+++ b/erpnext/stock/doctype/item/item_dashboard.py
@@ -41,7 +41,7 @@
},
{
'label': _('Manufacture'),
- 'items': ['Work Order', 'Item Manufacturer']
+ 'items': ['Production Plan', 'Work Order', 'Item Manufacturer']
}
]
- }
\ No newline at end of file
+ }