Skip to content
Extraits de code Groupes Projets
Valider fd902a3b rédigé par Julien - Le Filament's avatar Julien - Le Filament
Parcourir les fichiers

add api handler

parent 2f121e97
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -14,8 +14,8 @@ class ApiEnedisAcc(models.AbstractModel):
# Business methods
# ------------------------------------------------------
@api.model
def send_repartition_key(self, key, operation_name):
""" """
def send_repartition_key(self, key):
"""send keys for one date"""
uri = f"{self.name}{key.get('route')}"
......
......@@ -44,7 +44,8 @@ class AccRepartitionKeysWizard(models.TransientModel):
# CRUD methods (ORM overrides)
# ------------------------------------------------------
def ignore(self):
return {'type': 'ir.actions.act_window_close'}
return {"type": "ir.actions.act_window_close"}
# ------------------------------------------------------
# Actions
# ------------------------------------------------------
......@@ -86,9 +87,8 @@ class AccRepartitionKeysWizard(models.TransientModel):
)
for key in data_to_send:
response = self.env["api.enedis.acc"].send_repartition_key(
key=key, operation_name=self.operation_id.name
)
response = self.env["api.enedis.acc"].send_repartition_key(key=key)
#TODO: test api
print(response)
self.env["acc.repartition.keys"].create(
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter