def new_product(product_name):
     processed_food = food = False
     conditionned_weight = sub_category = category = great_category = None
     print("pour le new product gret, category  et sub: ", great_category,
           category, sub_category)
     great_category = Categories.choice_list(rank=1)
     if great_category == 'r':
         print("vous devez choisir une grande catégorie !")
         Product.new_product(product_name)
     elif great_category != "nourriture":
         category = Categories.choice_list(great_category=great_category,
                                           rank=2)
         if category == 'r':
             Product.new_product(product_name)
     else:
         category = Categories.choice_list(great_category=great_category,
                                           rank=2,
                                           food=True)
         if category == 'r':
             Product.new_product(product_name)
         else:
             sub_category = Categories.choice_list(
                 great_category=great_category, category=category, rank=3)
             if sub_category == 'r':
                 Product.new_product(product_name)
             else:
                 conditionned_weight = Product.cond_weight()
                 rep = Check.check_yn(
                     "Est_ce de la nourriture transformée? ")
                 if rep == "o":
                     processed_food = True
     datas = product_name, great_category, category, sub_category, processed_food, conditionned_weight
     with Connection.get_cursor() as cur:
         sql = (
             """INSERT INTO product(product_name, great_category, category, sub_category, processed_food, conditionned_weight)
                VALUES (%s, %s, %s, %s, %s, %s);""")
         cur.execute(sql, datas)
     with Connection.get_cursor() as cur:
         cur.execute("SELECT MAX(id) FROM product")
         product_id = cur.fetchone()
     return product_id[0], conditionned_weight, food