Vor Durchführung der Migration wird nun zusätzlich geprüft, ob Teilenummern in der Blacklist fehlen. Ist immer dann der Fall, wenn eine Teilenummer eine Stückliste besitzt und sich darin Positionsnummern befinden, die beigestellt oder dispo-inaktiv sind.
This commit is contained in:
@@ -234,6 +234,7 @@ class CadItem(DataModel):
|
||||
super().__init__()
|
||||
self._red_ids = {}
|
||||
self._parent_children_mapping = {}
|
||||
self._bom_properties = {}
|
||||
self._data = {}
|
||||
self._gui_data = {}
|
||||
self._gui_states = {}
|
||||
@@ -280,7 +281,18 @@ class CadItem(DataModel):
|
||||
self._red_ids = red_ids
|
||||
def get_red_ids(self):
|
||||
return self._red_ids
|
||||
|
||||
def set_bom_properties(self, properties) -> dict:
|
||||
""""
|
||||
Contains the properties of the BOM-positions(e.g. description, material etc.)
|
||||
"""
|
||||
self._bom_properties = properties
|
||||
|
||||
def get_bom_properties(self, property_name) -> dict:
|
||||
if property_name not in self._bom_properties:
|
||||
raise ValueError(f"Property '{property_name}' doesn't exist in BOM! Check property spelling!")
|
||||
else:
|
||||
return self._bom_properties[property_name]
|
||||
|
||||
# Methoden um die Verwendbarkeit einzelner Schalter auszugrauen
|
||||
def set_read_only_dict(self, data:dict):
|
||||
@@ -700,6 +712,30 @@ class CadItem(DataModel):
|
||||
return (False, missing)
|
||||
else:
|
||||
return (True, [])
|
||||
|
||||
def check_blacklist_completeness(self):
|
||||
""" Prüft, ob Baugruppen-id in Blacklist fehlt
|
||||
-> zutreffend, wenn in Stückliste beigestellte oder dispo-inaktive Stücklistenpositionen existieren
|
||||
"""
|
||||
teilenummer = self.get_gui_data("teilenummer")
|
||||
child_id = self.get_child_of_id(teilenummer)
|
||||
|
||||
if child_id is None: # Prüfung nur bei Teilenummern mit Stückliste sinnvoll
|
||||
return (True, {})
|
||||
|
||||
config = self._controller.get_config()
|
||||
blacklist_ids = set(config.get_blacklist())
|
||||
|
||||
ids_dispoaktiv_status = self.get_bom_properties("Dispoaktiv")
|
||||
ids_beistellung_status = self.get_bom_properties("Lieferantenbeistellung")
|
||||
|
||||
if not "False" in ids_dispoaktiv_status.values() or not "True" in ids_beistellung_status.values():
|
||||
return (True, {})
|
||||
|
||||
if teilenummer not in blacklist_ids:
|
||||
return (False, {teilenummer})
|
||||
else:
|
||||
return (True, {})
|
||||
|
||||
def check_improper_chars(self, invalid_chars):
|
||||
""" überprüft ob inder Oberfläche nicht erlaubte Zeichen eingetragen wurden"""
|
||||
|
||||
Reference in New Issue
Block a user