From 8f0e7c6ce40c027bed22588a5478da5b5dac16d5 Mon Sep 17 00:00:00 2001
From: Jordi Albert <63541019+jarg1023@users.noreply.github.com>
Date: Fri, 26 Aug 2022 12:50:27 +0200
Subject: [PATCH] #25 | Fix ips not shown when no it object was assigned and
improve table UI
---
msp/msp/doctype/ip_network/ip_network.js | 18 +++++++++---------
msp/msp/doctype/ip_network/ip_network.py | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/msp/msp/doctype/ip_network/ip_network.js b/msp/msp/doctype/ip_network/ip_network.js
index b72534a..c203e09 100644
--- a/msp/msp/doctype/ip_network/ip_network.js
+++ b/msp/msp/doctype/ip_network/ip_network.js
@@ -30,31 +30,31 @@ function getUsedIpsInNetwork(frm) {
tableBody += `
|
${(element?.ip_address === '') ? "-" : element?.ip_address}
|
- ${(element?.title === '') ? "-" : element?.title}
+ ${(element?.title === '') ? __("no object assigned") : element?.title}
|
- ${(element?.type === '') ? "-" : element?.type} |
+ ${(element?.type === '') ? __("no type assigned") : element?.type} |
`;
});
const table = tableBody ? `
-
-
+
+
- | IP |
- Name |
- Type |
+ IP |
+ Name |
+ Type |
diff --git a/msp/msp/doctype/ip_network/ip_network.py b/msp/msp/doctype/ip_network/ip_network.py
index aab3951..4da4577 100644
--- a/msp/msp/doctype/ip_network/ip_network.py
+++ b/msp/msp/doctype/ip_network/ip_network.py
@@ -20,7 +20,7 @@ class IPNetwork(Document):
ito.title,
ito.type
FROM `tabIP Address` ipa
- JOIN `tabIT Object` ito
+ LEFT JOIN `tabIT Object` ito
ON ipa.it_object = ito.name
WHERE ipa.ip_network = %(ip_network)s
AND ito.status != %(status)s