Skip to content
Extraits de code Groupes Projets
Valider b87660d8 rédigé par Juliana's avatar Juliana
Parcourir les fichiers

[UPD]Change name with hour-min

parent 505e3e51
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import json import json
from datetime import date from datetime import date, datetime
from odoo import api, fields, models from odoo import api, fields, models
from odoo.exceptions import UserError from odoo.exceptions import UserError
...@@ -117,9 +117,9 @@ class AdefpatProjectJustifZip(models.TransientModel): ...@@ -117,9 +117,9 @@ class AdefpatProjectJustifZip(models.TransientModel):
}] }]
} }
if self.type_convention_id: if self.type_convention_id:
file_name = "justifs_projets_"+ str(date.today()) + "_" + self.type_convention_id.name file_name = "justifs_projets_"+ str(datetime.now().strftime("%y-%m-%d-%H-%M")) + "_" + self.type_convention_id.name
else: else:
file_name = "justifs_projets_"+ str(date.today()) file_name = "justifs_projets_"+ str(datetime.now().strftime("%y-%m-%d-%H-%M"))
self.create_json_file(file_name, virtual_json) self.create_json_file(file_name, virtual_json)
@api.multi @api.multi
...@@ -139,9 +139,9 @@ class AdefpatProjectJustifZip(models.TransientModel): ...@@ -139,9 +139,9 @@ class AdefpatProjectJustifZip(models.TransientModel):
] ]
} }
if self.type_convention_id: if self.type_convention_id:
file_name = "justifs_factures_fournisseurs_" + str(date.today()) + "_" + self.type_convention_id.name file_name = "justifs_factures_fournisseurs_" + str(datetime.now().strftime("%y-%m-%d-%H-%M")) + "_" + self.type_convention_id.name
else: else:
file_name = "justifs_factures_fournisseurs_" + str(date.today()) file_name = "justifs_factures_fournisseurs_" + str(datetime.now().strftime("%y-%m-%d-%H-%M"))
json_file_cmis = self.env.user.company_id.proof_justif_cmis json_file_cmis = self.env.user.company_id.proof_justif_cmis
return self.create_json_file(file_name, virtual_json, json_file_cmis) return self.create_json_file(file_name, virtual_json, json_file_cmis)
...@@ -168,9 +168,9 @@ class AdefpatProjectJustifZip(models.TransientModel): ...@@ -168,9 +168,9 @@ class AdefpatProjectJustifZip(models.TransientModel):
] ]
} }
if self.type_convention_id: if self.type_convention_id:
file_name = "justifs_factures_clients_" + str(date.today()) + "_" + self.type_convention_id.name file_name = "justifs_factures_clients_" + str(datetime.now().strftime("%y-%m-%d-%H-%M")) + "_" + self.type_convention_id.name
else: else:
file_name = "justifs_factures_clients_" + str(date.today()) file_name = "justifs_factures_clients_" + str(datetime.now().strftime("%y-%m-%d-%H-%M"))
json_file_cmis = self.env.user.company_id.proof_justif_cmis json_file_cmis = self.env.user.company_id.proof_justif_cmis
return self.create_json_file(file_name, virtual_json, json_file_cmis) return self.create_json_file(file_name, virtual_json, json_file_cmis)
...@@ -213,9 +213,9 @@ class AdefpatProjectJustifZip(models.TransientModel): ...@@ -213,9 +213,9 @@ class AdefpatProjectJustifZip(models.TransientModel):
} }
if self.type_convention_id: if self.type_convention_id:
file_name = "justifs_frais_" + str( file_name = "justifs_frais_" + str(
date.today()) + "_" + self.type_convention_id.name datetime.now().strftime("%y-%m-%d-%H-%M")) + "_" + self.type_convention_id.name
else: else:
file_name = "justifs_frais_" + str( file_name = "justifs_frais_" + str(
date.today()) datetime.now().strftime("%y-%m-%d-%H-%M"))
json_file_cmis = self.env.user.company_id.proof_justif_cmis json_file_cmis = self.env.user.company_id.proof_justif_cmis
return self.create_json_file(file_name, virtual_json, json_file_cmis) return self.create_json_file(file_name, virtual_json, json_file_cmis)
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