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

[ADD]Change state whan justif added

parent 942fb043
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -54,6 +54,8 @@ class AccountInvoice(models.Model):
)
file.delete()
self.proof_file = False
if self.type == "in_invoice":
self.state = "draft"
except:
self.proof_file = False
......
......@@ -26,10 +26,12 @@ class UploadFileWizard(models.TransientModel):
Ajoute un fichier sur la GED Alfresco
@return: fonction get_partner_files() de res.partner
"""
is_in_invoice = False
if self.env.context["active_model"] == "account.invoice":
account_id = self.env["account.invoice"].browse(self.env.context["active_id"])
if account_id.type == "in_invoice":
proof_folder = self.env.user.company_id.proof_invoice_cmis
is_in_invoice = True
else:
proof_folder = self.env.user.company_id.proof_invoice_customer_cmis
else:
......@@ -74,6 +76,14 @@ class UploadFileWizard(models.TransientModel):
)
file_id = file.getProperties().get('cmis:objectId')
obj.proof_file = file.getObjectId()
if is_in_invoice == True:
obj.state = "paid"
if obj.task_ids:
for task in obj.task_ids:
task.stage_id = self.env.ref(
"adefpat_project.project_stage_paye"
).id
except Exception as e:
raise UserError(json.loads(e.details).get('message'))
......
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