code: def map_to_linear(self, with_stocks: bool=False):
          
          result = []
  
          for ac in self.model.classes:
              rows = self.__get_ac_tree(ac, with_stocks)
              result += rows
          return result
docs: Maps the tree to a linear representation suitable for display