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

[UPD]Restriction contract

parent 1a5de4b7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -193,13 +193,16 @@ class OperationsService(Component): ...@@ -193,13 +193,16 @@ class OperationsService(Component):
else: else:
# Récupération de toutes les factures liées à l'opération spécifiée # Récupération de toutes les factures liées à l'opération spécifiée
domain = [("acc_operation_id", "=", _id)] domain = [("acc_operation_id", "=", _id)]
domain_pmo = [("acc_operation_id", "=", _id)]
role = self._get_role(operation) role = self._get_role(operation)
if role.get("isConsumer"): if role.get("isConsumer"):
domain += [("type", "=", "achat")] domain += [("type", "=", "achat")]
if role.get("isProductor"): if role.get("isProductor"):
domain += [("type", "=", "vente")] domain += [("type", "=", "vente")]
if role.get("isPmo"): if role.get("isPmo"):
domain += [("type", "!=", False)] domain_pmo += [("type", "!=", False)]
acc_contract_ids = self.env["acc.contract"].search(domain_pmo)
else:
acc_contract_ids = self.env["acc.contract"].search(domain) acc_contract_ids = self.env["acc.contract"].search(domain)
datas["contracts"] = [] datas["contracts"] = []
......
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