[revert] is_sales_item, is_purchase_item back
This commit is contained in:
parent
de08639d49
commit
d973c1606a
@ -232,7 +232,8 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
|||||||
|
|
||||||
cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) {
|
||||||
return {
|
return {
|
||||||
query: "erpnext.controllers.queries.item_query"
|
query: "erpnext.controllers.queries.item_query",
|
||||||
|
filters: {'is_purchase_item': 1}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return{
|
return{
|
||||||
query: "erpnext.controllers.queries.item_query"
|
query: "erpnext.controllers.queries.item_query",
|
||||||
|
filters: {'is_purchase_item': 1}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -51,7 +51,8 @@ erpnext.crm.Opportunity = frappe.ui.form.Controller.extend({
|
|||||||
|
|
||||||
this.frm.set_query("item_code", "items", function() {
|
this.frm.set_query("item_code", "items", function() {
|
||||||
return {
|
return {
|
||||||
query: "erpnext.controllers.queries.item_query"
|
query: "erpnext.controllers.queries.item_query",
|
||||||
|
filters: {'is_sales_item': 1}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@ import frappe
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
fields = ("is_stock_item", "is_asset_item", "has_batch_no", "has_serial_no",
|
fields = ("is_stock_item", "is_asset_item", "has_batch_no", "has_serial_no",
|
||||||
"inspection_required", "is_sub_contracted_item")
|
"is_sales_item", "is_purchase_item", "inspection_required", "is_sub_contracted_item")
|
||||||
|
|
||||||
|
|
||||||
# convert to 1 or 0
|
# convert to 1 or 0
|
||||||
update_str = ", ".join(["`{0}`=if(`{0}`='Yes',1,0)".format(f) for f in fields])
|
update_str = ", ".join(["`{0}`=if(`{0}`='Yes',1,0)".format(f) for f in fields])
|
||||||
|
@ -66,7 +66,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
|||||||
if(this.frm.fields_dict["items"].grid.get_field('item_code')) {
|
if(this.frm.fields_dict["items"].grid.get_field('item_code')) {
|
||||||
this.frm.set_query("item_code", "items", function() {
|
this.frm.set_query("item_code", "items", function() {
|
||||||
return {
|
return {
|
||||||
query: "erpnext.controllers.queries.item_query"
|
query: "erpnext.controllers.queries.item_query",
|
||||||
|
filters: {'is_sales_item': 1}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import random
|
|||||||
def make_sample_data():
|
def make_sample_data():
|
||||||
"""Create a few opportunities, quotes, material requests, issues, todos, projects
|
"""Create a few opportunities, quotes, material requests, issues, todos, projects
|
||||||
to help the user get started"""
|
to help the user get started"""
|
||||||
items = frappe.get_all("Item")
|
items = frappe.get_all("Item", {'is_sales_item': 1})
|
||||||
|
|
||||||
customers = frappe.get_all("Customer")
|
customers = frappe.get_all("Customer")
|
||||||
warehouses = frappe.get_all("Warehouse")
|
warehouses = frappe.get_all("Warehouse")
|
||||||
@ -25,7 +25,7 @@ def make_sample_data():
|
|||||||
make_projects()
|
make_projects()
|
||||||
|
|
||||||
if items and warehouses:
|
if items and warehouses:
|
||||||
make_material_request(items)
|
make_material_request(frappe.get_all("Item"))
|
||||||
|
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
|
@ -318,6 +318,8 @@ def create_items(args):
|
|||||||
"item_name": item,
|
"item_name": item,
|
||||||
"description": item,
|
"description": item,
|
||||||
"show_in_website": 1,
|
"show_in_website": 1,
|
||||||
|
"is_sales_item": is_sales_item,
|
||||||
|
"is_purchase_item": is_purchase_item,
|
||||||
"is_stock_item": is_stock_item and 1 or 0,
|
"is_stock_item": is_stock_item and 1 or 0,
|
||||||
"item_group": item_group,
|
"item_group": item_group,
|
||||||
"stock_uom": args.get("item_uom_" + str(i)),
|
"stock_uom": args.get("item_uom_" + str(i)),
|
||||||
|
@ -705,33 +705,6 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"default": "Purchase",
|
|
||||||
"fieldname": "default_material_request_type",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"label": "Default Material Request Type",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
@ -1054,6 +1027,32 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "is_purchase_item",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Is Purchase Item",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
@ -1483,6 +1482,32 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "is_sales_item",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Is Sales Item",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
@ -2335,7 +2360,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2016-08-03 17:30:51.323382",
|
"modified": "2016-08-16 01:59:49.494629",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user