(request, domain, prod_id, archive=True)
return json_response({
        'success': success,
        'message': message,
        'product_id': prod_id
    })
Unarchive product
Unarchive product
Unarchive product
def unarchive_product(request, domain, prod_id, archive=True):
    """
    Unarchive product
    """
    product = Product.get(prod_id)
    try:
        product.unarchive()
    except DuplicateProductCodeException:
        success = False
        message = _("Another product is already using the Product ID '{product_id}'").format(
            product_id=product.code
        )
    else:
        success = True
        message = _("Product '{product_name}' has successfully been {action}.").format(
            product_name=product.name,
            action="unarchived",
        )
    return json_response({
        'success': success,
        'message': message,
        'product_id': prod_id
    })
def unarchive_product ( request , domain , prod_id , archive = True ) : product = Product . get ( prod_id ) try : product . unarchive ( ) except DuplicateProductCodeException : success = False message = _ ( "Another product is already using the Product ID '{product_id}'" ) . format ( product_id = product . code ) else : success = True message = _ ( "Product '{product_name}' has successfully been {action}." ) . format ( product_name = product . name , action = "unarchived" , ) return json_response ( { 'success' : success , 'message' : message , 'product_id' : prod_id } )