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

[FIX]Add check data field in all function

parent bf605bb5
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -212,7 +212,6 @@ class OperationsService(Component):
# Récupération de tous les contrats liés à l'opération spécifiée
domain_c = [("acc_operation_id", "=", _id)]
domain_pmo = [("acc_operation_id", "=", _id)]
role = self._get_role(operation)
if role.get("isConsumer") or role.get("isProductor"):
domain_c += [
......@@ -220,19 +219,14 @@ class OperationsService(Component):
("type", "=", "other"),
("type", "=", "vente_achat"),
]
if role.get("isPmo"):
domain_pmo += [("type", "!=", False)]
acc_contract_ids = self.env["acc.contract"].sudo().search(domain_pmo)
else:
acc_contract_all = (
self.env["acc.contract"]
.sudo()
.search(
[
.search([
("acc_operation_id", "=", _id),
("type", "=", "all"),
]
)
])
)
acc_contract_ids = self.env["acc.contract"].search(domain_c)
acc_contract_ids += acc_contract_all
......@@ -739,6 +733,7 @@ class OperationsService(Component):
"isPmo": {"type": "boolean"},
"isConsumer": {"type": "boolean"},
"isProductor": {"type": "boolean"},
"isDataCdc": {"type": "boolean"},
},
},
"id": {"type": "integer"},
......@@ -763,6 +758,7 @@ class OperationsService(Component):
"isPmo": {"type": "boolean"},
"isConsumer": {"type": "boolean"},
"isProductor": {"type": "boolean"},
"isDataCdc": {"type": "boolean"},
},
},
"id": {"type": "integer"},
......@@ -854,6 +850,7 @@ class OperationsService(Component):
"isPmo": {"type": "boolean"},
"isConsumer": {"type": "boolean"},
"isProductor": {"type": "boolean"},
"isDataCdc": {"type": "boolean"},
},
},
"graph_data": {
......@@ -887,6 +884,7 @@ class OperationsService(Component):
"isPmo": {"type": "boolean"},
"isConsumer": {"type": "boolean"},
"isProductor": {"type": "boolean"},
"isDataCdc": {"type": "boolean"},
},
},
"prms": {
......@@ -944,6 +942,7 @@ class OperationsService(Component):
"isPmo": {"type": "boolean"},
"isConsumer": {"type": "boolean"},
"isProductor": {"type": "boolean"},
"isDataCdc": {"type": "boolean"},
},
},
"prms": {
......
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