parameters: (self, sobject)
return_statement: return unique_sobject
docstring: get unique sobject in the existing table when installing plugin
docstring_summary: get unique sobject in the existing table when installing plugin
docstring_tokens: get unique sobject in the existing table when installing plugin
function: def get_unique_sobject(self, sobject):
          '''get unique sobject in the existing table when installing plugin'''
          base_st = sobject.get_base_search_type()
          cols = self.UNIQUE_DICT.get(base_st, ['code'])
  
          search = Search( sobject.get_base_search_type(), sudo=True )
          has_filter = False
          for col in cols:
              value = sobject.get_value(col)
              if value:
                  search.add_filter(col, value)  
                  has_filter = True
              else:
                  search.add_filter(col, None)
  
          # ensure there is some filtering before getting sobject
          if has_filter:
              unique_sobject = search.get_sobject()
          else:
              unique_sobject = None
          return unique_sobject
function_tokens: def get_unique_sobject ( self , sobject ) : base_st = sobject . get_base_search_type ( ) cols = self . UNIQUE_DICT . get ( base_st , [ 'code' ] ) search = Search ( sobject . get_base_search_type ( ) , sudo = True ) has_filter = False for col in cols : value = sobject . get_value ( col ) if value : search . add_filter ( col , value ) has_filter = True else : search . add_filter ( col , None ) # ensure there is some filtering before getting sobject if has_filter : unique_sobject = search . get_sobject ( ) else : unique_sobject = None return unique_sobject