diff --git a/services/operation_services.py b/services/operation_services.py index e24b668d89fe4659a53c09c3c5f13eda13798f06..628b4c9de30b9337c23ca748d8dbae8d13d09cbc 100644 --- a/services/operation_services.py +++ b/services/operation_services.py @@ -193,14 +193,17 @@ class OperationsService(Component): else: # Récupération de toutes les factures liées à l'opération spécifiée domain = [("acc_operation_id", "=", _id)] + domain_pmo = [("acc_operation_id", "=", _id)] role = self._get_role(operation) if role.get("isConsumer"): domain += [("type", "=", "achat")] if role.get("isProductor"): domain += [("type", "=", "vente")] if role.get("isPmo"): - domain += [("type", "!=", False)] - acc_contract_ids = self.env["acc.contract"].search(domain) + domain_pmo += [("type", "!=", False)] + acc_contract_ids = self.env["acc.contract"].search(domain_pmo) + else: + acc_contract_ids = self.env["acc.contract"].search(domain) datas["contracts"] = [] for n in acc_contract_ids: