# Path: amdeb_amazon/model_names/shared_names.py
# SHARED_NAME_FIELD = 'name'
# 
# MODEL_NAME_FIELD = 'model_name'
# 
# RECORD_ID_FIELD = 'record_id'
# 
# PRODUCT_SKU_FIELD = 'product_sku'
# 
# Path: amdeb_amazon/model_names/product_attribute.py
# PRODUCT_ATTRIBUTE_ID_FIELD = 'attribute_id'
# 
# Path: amdeb_amazon/model_names/product_template.py
# PRODUCT_IS_PRODUCT_VARIANT_FIELD = 'is_product_variant'
# 
# PRODUCT_VARIANT_COUNT_FIELD = 'product_variant_count'
# 
# PRODUCT_VARIANT_IDS_FIELD = 'product_variant_ids'
# 
# PRODUCT_BULLET_POINT_PREFIX = 'amazon_bullet_point'
# 
# PRODUCT_BULLET_POINT_COUNT = 5
# 
# PRODUCT_ATTRIBUTE_LINE_IDS_FIELD = 'attribute_line_ids'


from ..model_names.shared_names import(
    SHARED_NAME_FIELD, MODEL_NAME_FIELD,
    RECORD_ID_FIELD, PRODUCT_SKU_FIELD,
)
from ..model_names.product_attribute import PRODUCT_ATTRIBUTE_ID_FIELD
from ..model_names.product_product import(
    PRODUCT_ATTRIBUTE_VALUE_IDS_FIELD,
    AMAZON_SYNC_ACTIVE_FIELD,
    PRODUCT_TEMPLATE_ID_FIELD,
)
from ..model_names.product_template import (
    PRODUCT_IS_PRODUCT_VARIANT_FIELD,
    PRODUCT_VARIANT_COUNT_FIELD,
    PRODUCT_VARIANT_IDS_FIELD,
    PRODUCT_BULLET_POINT_PREFIX,
    PRODUCT_BULLET_POINT_COUNT,
    PRODUCT_ATTRIBUTE_LINE_IDS_FIELD,
)
    def get_sku(product):
        # for a template that has multi variants,
        # we create a customized SKU
        sku = product[PRODUCT_SKU_FIELD]
        if sku:
            sku = sku.strip()
        return sku

    @staticmethod
    def get_template_sku(product):
        template = product[PRODUCT_TEMPLATE_ID_FIELD]
        return OdooProductAccess.get_sku(template)

    @staticmethod
    def get_variant_attributes(product):
        result = []
        rel_attr_table = product[PRODUCT_ATTRIBUTE_VALUE_IDS_FIELD]
        for attr_value in rel_attr_table:
            value = attr_value[SHARED_NAME_FIELD]
            name = attr_value[PRODUCT_ATTRIBUTE_ID_FIELD][SHARED_NAME_FIELD]
            result.append((name, value))

        return result

    @staticmethod
    def get_template_attribute_names(product_template):
        result = []
        product_attr_line_table = product_template[
            PRODUCT_ATTRIBUTE_LINE_IDS_FIELD]
        for attr_line in product_attr_line_table:

# Path: amdeb_amazon/model_names/shared_names.py
# SHARED_NAME_FIELD = 'name'
# 
# MODEL_NAME_FIELD = 'model_name'
# 
# RECORD_ID_FIELD = 'record_id'
# 
# PRODUCT_SKU_FIELD = 'product_sku'
# 
# Path: amdeb_amazon/model_names/product_attribute.py
# PRODUCT_ATTRIBUTE_ID_FIELD = 'attribute_id'
# 
# Path: amdeb_amazon/model_names/product_template.py
# PRODUCT_IS_PRODUCT_VARIANT_FIELD = 'is_product_variant'
# 
# PRODUCT_VARIANT_COUNT_FIELD = 'product_variant_count'
# 
# PRODUCT_VARIANT_IDS_FIELD = 'product_variant_ids'
# 
# PRODUCT_BULLET_POINT_PREFIX = 'amazon_bullet_point'
# 
# PRODUCT_BULLET_POINT_COUNT = 5
# 
# PRODUCT_ATTRIBUTE_LINE_IDS_FIELD = 'attribute_line_ids'


# Path: amdeb_amazon/models_access/odoo_product_access.py
from ..model_names.shared_names import(
    SHARED_NAME_FIELD, MODEL_NAME_FIELD,
    RECORD_ID_FIELD, PRODUCT_SKU_FIELD,
)
from ..model_names.product_attribute import PRODUCT_ATTRIBUTE_ID_FIELD
from ..model_names.product_product import(
    PRODUCT_ATTRIBUTE_VALUE_IDS_FIELD,
    AMAZON_SYNC_ACTIVE_FIELD,
    PRODUCT_TEMPLATE_ID_FIELD,
)
from ..model_names.product_template import (
    PRODUCT_IS_PRODUCT_VARIANT_FIELD,
    PRODUCT_VARIANT_COUNT_FIELD,
    PRODUCT_VARIANT_IDS_FIELD,
    PRODUCT_BULLET_POINT_PREFIX,
    PRODUCT_BULLET_POINT_COUNT,
    PRODUCT_ATTRIBUTE_LINE_IDS_FIELD,
)

    def get_sku(product):
        # for a template that has multi variants,
        # we create a customized SKU
        sku = product[PRODUCT_SKU_FIELD]
        if sku:
            sku = sku.strip()
        return sku

    @staticmethod
    def get_template_sku(product):
        template = product[PRODUCT_TEMPLATE_ID_FIELD]
        return OdooProductAccess.get_sku(template)

    @staticmethod
    def get_variant_attributes(product):
        result = []
        rel_attr_table = product[PRODUCT_ATTRIBUTE_VALUE_IDS_FIELD]
        for attr_value in rel_attr_table:
            value = attr_value[SHARED_NAME_FIELD]
            name = attr_value[PRODUCT_ATTRIBUTE_ID_FIELD][SHARED_NAME_FIELD]
            result.append((name, value))

        return result

    @staticmethod
    def get_template_attribute_names(product_template):
        result = []
        product_attr_line_table = product_template[
            PRODUCT_ATTRIBUTE_LINE_IDS_FIELD]
        for attr_line in product_attr_line_table:

            name = attr_line[PRODUCT_ATTRIBUTE_ID_FIELD][SHARED_NAME_FIELD]