Skip to content

Commit 55c9e7f

Browse files
committed
Merge branch 'staging' into production
2 parents 9b9d534 + 4f32b83 commit 55c9e7f

File tree

3 files changed

+59
-7
lines changed

3 files changed

+59
-7
lines changed

bloomstack_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
__version__ = '2.2.0'
4+
__version__ = '2.2.1'

bloomstack_core/bloomstack_core/custom/purchase_receipt_item.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,59 @@
317317
"translatable": 0,
318318
"unique": 0,
319319
"width": null
320+
},
321+
{
322+
"_assign": null,
323+
"_comments": null,
324+
"_liked_by": null,
325+
"_user_tags": null,
326+
"allow_in_quick_entry": 0,
327+
"allow_on_submit": 0,
328+
"bold": 0,
329+
"collapsible": 0,
330+
"collapsible_depends_on": null,
331+
"columns": 0,
332+
"creation": "2021-04-28 22:44:11.730666",
333+
"default": null,
334+
"depends_on": null,
335+
"description": null,
336+
"docstatus": 0,
337+
"dt": "Purchase Receipt Item",
338+
"fetch_from": null,
339+
"fetch_if_empty": 0,
340+
"fieldname": "metrc_product_name",
341+
"fieldtype": "Data",
342+
"hidden": 0,
343+
"idx": 7,
344+
"ignore_user_permissions": 0,
345+
"ignore_xss_filter": 0,
346+
"in_global_search": 0,
347+
"in_list_view": 0,
348+
"in_standard_filter": 0,
349+
"insert_after": "item_name",
350+
"label": "METRC Product Name",
351+
"length": 0,
352+
"modified": "2021-04-28 22:44:11.730666",
353+
"modified_by": "Administrator",
354+
"name": "Purchase Receipt Item-metrc_product_name",
355+
"no_copy": 0,
356+
"options": null,
357+
"owner": "Administrator",
358+
"parent": null,
359+
"parentfield": null,
360+
"parenttype": null,
361+
"permlevel": 0,
362+
"precision": "",
363+
"print_hide": 0,
364+
"print_hide_if_no_value": 0,
365+
"print_width": null,
366+
"read_only": 0,
367+
"report_hide": 0,
368+
"reqd": 0,
369+
"search_index": 0,
370+
"translatable": 1,
371+
"unique": 0,
372+
"width": null
320373
}
321374
],
322375
"custom_perms": [],

bloomstack_core/bloomtrace/transfer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ def create_purchase_receipt(transfer):
55
transfer = frappe.parse_json(transfer)
66

77
for item in transfer.get("items", []):
8-
item_exists = frappe.get_all("Item", filters={"metrc_item_name": item.pop("product_name")}, fields=["name", "item_name"])
9-
if item_exists:
10-
item.update({
11-
"item_code": item_exists[0].name,
12-
"item_name": item_exists[0].item_name
13-
})
8+
supplier_item = frappe.db.get_all("Item Supplier", filters={"supplier_part_no": item.get("product_name")}, fields=["parent"])
9+
item.update({
10+
"item_code": supplier_item[0].parent if supplier_item else None,
11+
"metrc_product_name": item.get("product_name")
12+
})
1413

1514
doc = frappe.get_doc({"doctype": "Purchase Receipt"})
1615
doc.update(transfer)

0 commit comments

Comments
 (0)