[
  {
    "doctype": "Workflow",
    "name": "OTO Vente Pipeline",
    "workflow_name": "OTO Vente Pipeline",
    "document_type": "OTO Dossier Vente",
    "workflow_state_field": "workflow_state",
    "is_active": 1,
    "send_email_alert": 0,
    "override_status": 0,
    "states": [
      {
        "state": "Lead",
        "doc_status": "0",
        "allow_edit": "OTO Ventes Conseiller",
        "update_field": "statut_pipeline",
        "update_value": "lead",
        "is_optional_state": 0,
        "message": "Nouveau prospect qualifie a contacter."
      },
      {
        "state": "Visite planifiée",
        "doc_status": "0",
        "allow_edit": "OTO Ventes Conseiller",
        "update_field": "statut_pipeline",
        "update_value": "visite",
        "is_optional_state": 0,
        "message": "Visite du site ou de l'unite temoin programmee."
      },
      {
        "state": "Devis émis",
        "doc_status": "0",
        "allow_edit": "OTO Ventes Conseiller",
        "update_field": "statut_pipeline",
        "update_value": "devis",
        "is_optional_state": 0,
        "message": "Devis chiffre remis au prospect (attente decision)."
      },
      {
        "state": "Réservation confirmée",
        "doc_status": "1",
        "allow_edit": "OTO Ventes Réservations",
        "update_field": "statut_pipeline",
        "update_value": "reservation",
        "is_optional_state": 0,
        "message": "Depot de reservation encaisse ; dossier verrouille (soumis)."
      },
      {
        "state": "Contrat signé",
        "doc_status": "1",
        "allow_edit": "OTO Ventes Contrats",
        "update_field": "statut_pipeline",
        "update_value": "contrat",
        "is_optional_state": 0,
        "message": "Contrat de vente signe par les deux parties."
      },
      {
        "state": "CONFOTUR déposé",
        "doc_status": "1",
        "allow_edit": "OTO Ventes CONFOTUR",
        "update_field": "statut_pipeline",
        "update_value": "confotur_depose",
        "is_optional_state": 0,
        "message": "Dossier d'incitation CONFOTUR depose aupres de l'autorite."
      },
      {
        "state": "CONFOTUR approuvé",
        "doc_status": "1",
        "allow_edit": "OTO Ventes CONFOTUR",
        "update_field": "statut_pipeline",
        "update_value": "confotur_approuve",
        "is_optional_state": 0,
        "message": "Incitation CONFOTUR approuvee ; cycle de vente clos avec succes."
      },
      {
        "state": "Abandonné",
        "doc_status": "0",
        "allow_edit": "OTO Ventes Chef Équipe",
        "update_field": "statut_pipeline",
        "update_value": "abandonne",
        "is_optional_state": 0,
        "message": "Piste abandonnee avant reservation (brouillon)."
      },
      {
        "state": "Perdu",
        "doc_status": "2",
        "allow_edit": "OTO Ventes Directeur",
        "update_field": "statut_pipeline",
        "update_value": "perdu",
        "is_optional_state": 0,
        "message": "Affaire soumise resiliee/annulee (dossier annule)."
      }
    ],
    "transitions": [
      {
        "state": "CONFOTUR déposé",
        "action": "Approuver CONFOTUR",
        "next_state": "CONFOTUR approuvé",
        "allowed": "OTO Ventes CONFOTUR",
        "allow_self_approval": 0,
        "condition": null
      },
      {
        "state": "Contrat signé",
        "action": "Déposer CONFOTUR",
        "next_state": "CONFOTUR déposé",
        "allowed": "OTO Ventes CONFOTUR",
        "allow_self_approval": 1,
        "condition": null
      },
      {
        "state": "Contrat signé",
        "action": "Résilier (perdu)",
        "next_state": "Perdu",
        "allowed": "OTO Direction Commerciale",
        "allow_self_approval": 0,
        "condition": null
      },
      {
        "state": "Devis émis",
        "action": "Abandonner",
        "next_state": "Abandonné",
        "allowed": "OTO Ventes Chef Équipe",
        "allow_self_approval": 1,
        "condition": null
      },
      {
        "state": "Devis émis",
        "action": "Confirmer réservation",
        "next_state": "Réservation confirmée",
        "allowed": "OTO Ventes Réservations",
        "allow_self_approval": 0,
        "condition": null
      },
      {
        "state": "Lead",
        "action": "Abandonner",
        "next_state": "Abandonné",
        "allowed": "OTO Ventes Conseiller",
        "allow_self_approval": 1,
        "condition": null
      },
      {
        "state": "Lead",
        "action": "Planifier visite",
        "next_state": "Visite planifiée",
        "allowed": "OTO Ventes Conseiller",
        "allow_self_approval": 1,
        "condition": null
      },
      {
        "state": "Réservation confirmée",
        "action": "Annuler (perdu)",
        "next_state": "Perdu",
        "allowed": "OTO Ventes Directeur",
        "allow_self_approval": 0,
        "condition": null
      },
      {
        "state": "Réservation confirmée",
        "action": "Signer contrat",
        "next_state": "Contrat signé",
        "allowed": "OTO Ventes Contrats",
        "allow_self_approval": 0,
        "condition": null
      },
      {
        "state": "Visite planifiée",
        "action": "Abandonner",
        "next_state": "Abandonné",
        "allowed": "OTO Ventes Conseiller",
        "allow_self_approval": 1,
        "condition": null
      },
      {
        "state": "Visite planifiée",
        "action": "Émettre devis",
        "next_state": "Devis émis",
        "allowed": "OTO Ventes Conseiller",
        "allow_self_approval": 1,
        "condition": null
      }
    ]
  }
]
