diff --git a/services/operation_services.py b/services/operation_services.py index 8c99f2e4f62713da601bf797f831c5260094680f..80eded5aa167d4ab858aec0e4e82ce6601c94fb7 100644 --- a/services/operation_services.py +++ b/services/operation_services.py @@ -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,22 +219,17 @@ 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( - [ - ("acc_operation_id", "=", _id), - ("type", "=", "all"), - ] - ) + + acc_contract_all = ( + self.env["acc.contract"] + .sudo() + .search([ + ("acc_operation_id", "=", _id), + ("type", "=", "all"), + ]) ) - acc_contract_ids = self.env["acc.contract"].search(domain_c) - acc_contract_ids += acc_contract_all + acc_contract_ids = self.env["acc.contract"].search(domain_c) + acc_contract_ids += acc_contract_all acc_contract_pmo = self.env["acc.contract"].search( [ @@ -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": {