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

[ADD]Add external invoice

parent 15472183
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -212,8 +212,31 @@ class OperationsService(Component): ...@@ -212,8 +212,31 @@ class OperationsService(Component):
if acc_account_ids if acc_account_ids
else [] else []
) )
# Récupération de toutes les factures externes
# liées à l'opération spécifiée
domain = [("acc_operation_id", "=", _id)]
domain += [
("type", "=", "facture"),
]
acc_contract_ids = self.env["acc.contract"].search(domain)
datas["factures_externes"] = (
acc_contract_ids.mapped(
lambda n: {
"id": n.id,
"name": n.name,
"start_date": n.start_date,
"end_date": n.end_date,
"type": n.type,
"url": base_url + n.get_portal_url(),
}
)
if acc_contract_ids
else []
)
else: else:
# Récupération de toutes les factures liées à l'opération spécifiée # Récupération de tous les contrats liés à l'opération spécifiée
domain = [("acc_operation_id", "=", _id)] domain = [("acc_operation_id", "=", _id)]
domain_pmo = [("acc_operation_id", "=", _id)] domain_pmo = [("acc_operation_id", "=", _id)]
role = self._get_role(operation) role = self._get_role(operation)
...@@ -707,6 +730,21 @@ class OperationsService(Component): ...@@ -707,6 +730,21 @@ class OperationsService(Component):
}, },
}, },
}, },
"factures_externes": {
"nullable": True,
"type": "list",
"schema": {
"type": "dict",
"schema": {
"id": {"type": "integer"},
"name": {"type": "string"},
"type": {"type": "string", "nullable": True},
"url": {"type": "string", "nullable": True},
"seller": {"type": "string", "nullable": True},
"buyer": {"type": "string", "nullable": True},
},
},
},
"contracts": { "contracts": {
"nullable": True, "nullable": True,
"type": "list", "type": "list",
......
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