Skip to content

Commit

Permalink
Merge pull request #661 from gisce/feature/61124_exclude_deactivated_…
Browse files Browse the repository at this point in the history
…model_m_registers

IMP excluir de los ids a consumir las bajas de modelo M
  • Loading branch information
ecarreras authored Jul 15, 2024
2 parents 13b57ec + 4c4fca7 commit 6512236
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
10 changes: 9 additions & 1 deletion libcnmc/cir_8_2021/FB1.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def get_sequence(self):
'&', ('active', '=', False),
('data_baixa', '!=', False),
('active', '=', True)]
# Excloure els registres que es troben de baixa i el model es 'M'
search_params += [
'|', ('model', '!=', 'M'), ('data_baixa', '=', False)
]

obj_lat = self.connection.GiscedataAtTram
ids = obj_lat.search(
Expand All @@ -114,6 +118,10 @@ def get_sequence(self):
'&', ('active', '=', False),
('data_baixa', '!=', False),
('active', '=', True)]
# Excloure els registres que es troben de baixa i el model es 'M'
search_params += [
'|', ('model', '!=', 'M'), ('data_baixa', '=', False)
]

obj_lbt = self.connection.GiscedataBtElement
ids = obj_lbt.search(
Expand All @@ -135,7 +143,7 @@ def consumer(self):

fields_to_read = [
'baixa', 'data_pm', 'data_industria', 'coeficient', 'cini', 'propietari', 'tensio_max_disseny_id', 'name',
'origen', 'final', 'perc_financament', 'longitud_cad', 'cable', 'linia', 'model', 'model', 'punt_frontera',
'origen', 'final', 'perc_financament', 'longitud_cad', 'cable', 'linia', 'model', 'punt_frontera',
'tipus_instalacio_cnmc_id', 'data_baixa', 'baixa', 'longitud_cad', 'data_pm', 'circuits',
'id_regulatori', 'municipi',
]
Expand Down
4 changes: 4 additions & 0 deletions libcnmc/cir_8_2021/FB2.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ def get_sequence(self):
'&', ('active', '=', False),
('data_baixa', '!=', False),
('active', '=', True)]
# Excloure els registres que es troben de baixa i el model es 'M'
search_params += [
'|', ('model', '!=', 'M'), ('data_baixa', '=', False)
]

forced_ids = get_forced_elements(self.connection, "giscedata.cts")

Expand Down
4 changes: 4 additions & 0 deletions libcnmc/cir_8_2021/FB4.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def get_sequence(self):
'&', ('active', '=', False),
('data_baixa', '!=', False),
('active', '=', True)]
# Excloure els registres que es troben de baixa i el model es 'M'
search_params += [
'|', ('model', '!=', 'M'), ('data_baixa', '=', False)
]

forced_ids = get_forced_elements(self.connection, "giscedata.cts.subestacions.posicio")

Expand Down
5 changes: 4 additions & 1 deletion libcnmc/cir_8_2021/FB6.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def get_sequence(self):
('cini', '=like', 'I26%'),
('inventari', '=', 'fiabilitat'),
]

# Excloure els registres que es troben de baixa i el model es 'M'
search_params += [
'|', ('model', '!=', 'M'), ('data_baixa', '=', False)
]
return self.connection.GiscedataCellesCella.search(search_params, 0, 0, False, {'active_test': False})

def get_node_vertex(self, element_name):
Expand Down

0 comments on commit 6512236

Please sign in to comment.