From aa420eb3e5eadc127425324d1f47bf98cde00339 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 25 Apr 2022 10:55:20 +0530 Subject: [PATCH] feat(unicommerce): capture batch group field --- ecommerce_integrations/unicommerce/constants.py | 1 + .../doctype/unicommerce_settings/unicommerce_settings.py | 8 ++++++++ ecommerce_integrations/unicommerce/product.py | 2 ++ 3 files changed, 11 insertions(+) diff --git a/ecommerce_integrations/unicommerce/constants.py b/ecommerce_integrations/unicommerce/constants.py index 6478fd0a..4307bf9f 100644 --- a/ecommerce_integrations/unicommerce/constants.py +++ b/ecommerce_integrations/unicommerce/constants.py @@ -29,6 +29,7 @@ ITEM_LENGTH_FIELD = "unicommerce_item_length" ITEM_WIDTH_FIELD = "unicommerce_item_width" ITEM_HEIGHT_FIELD = "unicommerce_item_height" +ITEM_BATCH_GROUP_FIELD = "unicommerce_batch_group_code" SHIPPING_PACKAGE_STATUS_FIELD = "unicommerce_shipping_package_status" IS_COD_CHECKBOX = "unicommerce_is_cod" SHIPPING_METHOD_FIELD = "unicommerce_shipping_method" diff --git a/ecommerce_integrations/unicommerce/doctype/unicommerce_settings/unicommerce_settings.py b/ecommerce_integrations/unicommerce/doctype/unicommerce_settings/unicommerce_settings.py index 52aae71d..bc2d44cb 100644 --- a/ecommerce_integrations/unicommerce/doctype/unicommerce_settings/unicommerce_settings.py +++ b/ecommerce_integrations/unicommerce/doctype/unicommerce_settings/unicommerce_settings.py @@ -22,6 +22,7 @@ GRN_STOCK_ENTRY_TYPE, INVOICE_CODE_FIELD, IS_COD_CHECKBOX, + ITEM_BATCH_GROUP_FIELD, ITEM_HEIGHT_FIELD, ITEM_LENGTH_FIELD, ITEM_SYNC_CHECKBOX, @@ -231,6 +232,13 @@ def setup_custom_fields(update=True): insert_after=ITEM_WIDTH_FIELD, print_hide=1, ), + dict( + fieldname=ITEM_BATCH_GROUP_FIELD, + label="Batch Group Code", + fieldtype="Data", + insert_after=ITEM_HEIGHT_FIELD, + print_hide=1, + ), ], "Sales Order": [ dict( diff --git a/ecommerce_integrations/unicommerce/product.py b/ecommerce_integrations/unicommerce/product.py index 64637257..b44f78c5 100644 --- a/ecommerce_integrations/unicommerce/product.py +++ b/ecommerce_integrations/unicommerce/product.py @@ -10,6 +10,7 @@ from ecommerce_integrations.unicommerce.api_client import JsonDict, UnicommerceAPIClient from ecommerce_integrations.unicommerce.constants import ( DEFAULT_WEIGHT_UOM, + ITEM_BATCH_GROUP_FIELD, ITEM_HEIGHT_FIELD, ITEM_LENGTH_FIELD, ITEM_SYNC_CHECKBOX, @@ -37,6 +38,7 @@ "length": ITEM_LENGTH_FIELD, "width": ITEM_WIDTH_FIELD, "height": ITEM_HEIGHT_FIELD, + "batchGroupCode": ITEM_BATCH_GROUP_FIELD, } ERPNEXT_TO_UNI_ITEM_MAPPING = {v: k for k, v in UNI_TO_ERPNEXT_ITEM_MAPPING.items()}