mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
[hub] rename is_hub_item to is_item_from_hub (#11069)
* [hub] rename is_hub_item to is_item_from_hub * [rename] is_hub_item to is_item_from_hub
This commit is contained in:
committed by
Nabin Hait
parent
9c0d30a087
commit
925e9776e8
@@ -56,115 +56,6 @@ def make_opportunity(buyer_name, email_id):
|
|||||||
o.lead = frappe.get_all("Lead", filters={"email_id": email_id}, fields = ["name"])[0]["name"]
|
o.lead = frappe.get_all("Lead", filters={"email_id": email_id}, fields = ["name"])[0]["name"]
|
||||||
o.save(ignore_permissions=True)
|
o.save(ignore_permissions=True)
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def get_items(text='', by_item_codes=0, start=0, limit=20, order_by='', category=None, company_name=None, country=None):
|
|
||||||
# item_codes = []
|
|
||||||
# if cint(by_item_codes):
|
|
||||||
# item_codes = [d["item_code"] for d in frappe.get_all("Item", fields=["item_code"], filters={"is_hub_item": "1"},
|
|
||||||
# limit_start = start, limit_page_length = limit)]
|
|
||||||
# if not item_codes:
|
|
||||||
# return []
|
|
||||||
|
|
||||||
# args = {
|
|
||||||
# "text": text,
|
|
||||||
# "item_codes": item_codes,
|
|
||||||
# "category": category,
|
|
||||||
# "company_name": company_name,
|
|
||||||
# "country": country,
|
|
||||||
# "order_by": order_by,
|
|
||||||
# "start": start,
|
|
||||||
# "limit": limit
|
|
||||||
# }
|
|
||||||
# return hub_request('get_items', data=json.dumps(args))
|
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def get_all_companies():
|
|
||||||
# return hub_request('get_all_companies')
|
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def get_item_details(item_code):
|
|
||||||
# args = {
|
|
||||||
# "item_code": item_code,
|
|
||||||
# }
|
|
||||||
# return hub_request('get_item_details', data=json.dumps(args))
|
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def get_company_details(company_id):
|
|
||||||
# args = {
|
|
||||||
# "company_id": company_id,
|
|
||||||
# }
|
|
||||||
# return hub_request('get_company_details', data=json.dumps(args))
|
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def get_categories():
|
|
||||||
# # update_local_hub_categories()
|
|
||||||
# return hub_request('get_categories')
|
|
||||||
|
|
||||||
# def update_local_hub_categories():
|
|
||||||
# categories = get_categories()
|
|
||||||
# categories_to_remove = []
|
|
||||||
# categories_to_add = []
|
|
||||||
# old_categories = frappe.db.sql_list("select category_name from from `tabHub Category`")
|
|
||||||
# new_categories = [d.category_name for d in categories]
|
|
||||||
# for old_category in old_categories:
|
|
||||||
# if old_category not in new_categories:
|
|
||||||
# categories_to_remove.append(old_category)
|
|
||||||
|
|
||||||
# for new_category in new_categories:
|
|
||||||
# if new_category not in old_categories:
|
|
||||||
# categories_to_add.append(new_category)
|
|
||||||
|
|
||||||
# for d in categories_to_remove:
|
|
||||||
# docname = frappe.get_list('Hub Category', filters = {"category_name": d})[0]["name"]
|
|
||||||
# frappe.delete_doc("Hub Category", docname)
|
|
||||||
|
|
||||||
# for d in categories_to_add:
|
|
||||||
# doc = frappe.new_doc("Hub Category")
|
|
||||||
# doc.category_name = d
|
|
||||||
# doc.save()
|
|
||||||
|
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def get_items_seen_states(items):
|
|
||||||
# items = json.loads(items)
|
|
||||||
# for d in items:
|
|
||||||
# local_item_code = "HUB-" + d["item_code"]
|
|
||||||
# if frappe.db.exists("Item", {"item_code": local_item_code}):
|
|
||||||
# d["seen"] = 1
|
|
||||||
# else:
|
|
||||||
# d["seen"] = 0
|
|
||||||
# return items
|
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def get_local_hub_item_codes():
|
|
||||||
# item_codes = []
|
|
||||||
# for d in frappe.get_all("Item", fields=["item_code"], filters={"is_hub_item": 1}):
|
|
||||||
# item_codes.append(d["item_code"][4:])
|
|
||||||
# return item_codes
|
|
||||||
|
|
||||||
# @frappe.whitelist()
|
|
||||||
# def hub_item_request_action(item):
|
|
||||||
# item = json.loads(item)
|
|
||||||
# rfq = make_rfq(item)
|
|
||||||
# # , send click count and say requested
|
|
||||||
# send_opportunity_details(supplier_name, supplier_email)
|
|
||||||
# make_opportunities()
|
|
||||||
# return rfq
|
|
||||||
|
|
||||||
# def send_opportunity_details(supplier_name, supplier_email):
|
|
||||||
# connection = get_connection()
|
|
||||||
# params = {
|
|
||||||
# "buyer_name": supplier_name,
|
|
||||||
# "email_id": supplier_email
|
|
||||||
# }
|
|
||||||
# args = frappe._dict(dict(
|
|
||||||
# doctype="Hub Document",
|
|
||||||
# type="Opportunity",
|
|
||||||
# document_data=json.dumps(params),
|
|
||||||
# user=supplier_email
|
|
||||||
# ))
|
|
||||||
# response = connection.insert("Hub Document", args)
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_rfq_and_send_opportunity(item, supplier):
|
def make_rfq_and_send_opportunity(item, supplier):
|
||||||
supplier = make_supplier(supplier)
|
supplier = make_supplier(supplier)
|
||||||
@@ -221,7 +112,7 @@ def make_item(item):
|
|||||||
'doctype': 'Item',
|
'doctype': 'Item',
|
||||||
'item_code': item.item_code,
|
'item_code': item.item_code,
|
||||||
'item_group': item.item_group,
|
'item_group': item.item_group,
|
||||||
'is_hub_item': 1
|
'is_item_from_hub': 1
|
||||||
}).insert()
|
}).insert()
|
||||||
else:
|
else:
|
||||||
item_doc = frappe.get_doc('Item', item.item_code)
|
item_doc = frappe.get_doc('Item', item.item_code)
|
||||||
|
|||||||
@@ -240,7 +240,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fieldname": "is_hub_item",
|
"fieldname": "is_item_from_hub",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
@@ -249,7 +249,7 @@
|
|||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Is Hub Item",
|
"label": "Is Item from Hub",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
@@ -3165,7 +3165,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:(!doc.is_hub_item)",
|
"depends_on": "eval:(!doc.is_item_from_hub)",
|
||||||
"fieldname": "hub_publishing_sb",
|
"fieldname": "hub_publishing_sb",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3329,7 +3329,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2017-09-27 14:08:02.948326",
|
"modified": "2017-10-03 14:08:02.948326",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class Item(WebsiteGenerator):
|
|||||||
if not self.description:
|
if not self.description:
|
||||||
self.description = self.item_name
|
self.description = self.item_name
|
||||||
|
|
||||||
if self.is_sales_item and not self.is_hub_item:
|
if self.is_sales_item and not self.is_item_from_hub:
|
||||||
self.publish_in_hub = 1
|
self.publish_in_hub = 1
|
||||||
|
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user