Skip to content

Commit

Permalink
Update data fetching method
Browse files Browse the repository at this point in the history
  • Loading branch information
Drayang committed Feb 15, 2022
1 parent 607b4c0 commit f63d585
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 40 deletions.
39 changes: 3 additions & 36 deletions frepple/frepple/doctype/frepple_data_export/frepple_data_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,8 @@ def export_customers():
"category":customer.customer_type,
"owner":customer.customer_group
})
output = make_post_request(url,headers=headers, data=data)

output = make_post_request(url,headers=headers, data=data)



def export_locations():
api = "location"
Expand Down Expand Up @@ -260,8 +258,6 @@ def export_locations():
"available":available
})
output = make_post_request(url,headers=headers, data=data)




def export_buffers():
Expand All @@ -282,7 +278,6 @@ def export_buffers():
output = make_post_request(url,headers=headers, data=data)



def export_item_distribution():
api = "itemdistribution"
url,headers = get_frepple_params(api=api,filter=None)
Expand Down Expand Up @@ -356,6 +351,7 @@ def export_skills():

output = make_post_request(url,headers=headers, data=data)


def export_resource_skills():
api = "resourceskill" #equivalent to customer doctype
url,headers = get_frepple_params(api=api,filter=None)
Expand Down Expand Up @@ -423,7 +419,6 @@ def export_item_suppliers():
output = make_post_request(url,headers=headers, data=data)



def export_operations():
api = "operation"
url,headers = get_frepple_params(api=api,filter=None)
Expand Down Expand Up @@ -548,6 +543,7 @@ def export_operation_resources():
})
output = make_post_request(url,headers=headers, data=data)


def export_sales_orders():
api = "demand" #equivalent sales order
url,headers = get_frepple_params(api=api,filter=None)
Expand Down Expand Up @@ -576,32 +572,3 @@ def export_sales_orders():

output = make_post_request(url,headers=headers, data=data)



# def export_manufacturing_orders():
# api = "manufacturingorder" #equivalent work order
# url,headers = get_frepple_params(api=api,filter=None)

# sales_orders = frappe.db.sql(
# """
# SELECT reference,operation,status,qty,location,customer, timestamp(due) as "due",priority,status,so_owner
# FROM `tabFrepple Manufacturing Order`
# """,
# as_dict=1)


# for sales_order in sales_orders:
# print(sales_order)
# data = json.dumps({
# "name": sales_order.name,
# "description": sales_order.item_name + " ordered by " + sales_order.customer, #default
# "item": sales_order.item,
# "customer": sales_order.customer,
# "location": sales_order.location,
# "due": sales_order.due.isoformat(),
# "status": sales_order.status,
# "quantity": sales_order.qty,
# "priority": sales_order.priority
# })

# output = make_post_request(url,headers=headers, data=data)
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
from datetime import timedelta
from frappe.utils import add_to_date



class FreppleIntegrationDataFetching(Document):
pass

Expand Down Expand Up @@ -214,8 +212,6 @@ def fetch_resource_skills():
'proficiency':i.proficiency
})



def fetch_suppliers():
suppliers = frappe.db.sql("""SELECT name FROM `tabSupplier`""",as_dict=1)
for supplier in suppliers:
Expand Down

0 comments on commit f63d585

Please sign in to comment.