lims: remove auxiliary records when updating modules

This commit is contained in:
Adrián Bernardi 2021-09-22 10:18:13 -03:00
parent c57e18ba78
commit e57b9d5e04
2 changed files with 18 additions and 0 deletions

View File

@ -2438,6 +2438,12 @@ class NotebookInternalRelationsCalc1Variable(ModelSQL):
repetition = fields.Integer('Repetition', readonly=True)
use = fields.Boolean('Use')
@classmethod
def __register__(cls, module_name):
super().__register__(module_name)
cursor = Transaction().connection.cursor()
cursor.execute('DELETE FROM "' + cls._table + '"')
class NotebookInternalRelationsCalc1(Wizard):
'Internal Relations Calculation'

View File

@ -2007,6 +2007,12 @@ class GenerateResultsReportResultAutNotebookLine(ModelSQL, ModelView):
line = fields.Many2One('lims.notebook.line', 'Notebook Line',
ondelete='CASCADE', select=True, required=True)
@classmethod
def __register__(cls, module_name):
super().__register__(module_name)
cursor = Transaction().connection.cursor()
cursor.execute('DELETE FROM "' + cls._table + '"')
# TODO: remove
class GenerateResultsReportResultAutExcludedNotebook(ModelSQL, ModelView):
@ -2066,6 +2072,12 @@ class GenerateResultsReportResultAutExcludedNotebookLine(ModelSQL,
line = fields.Many2One('lims.notebook.line', 'Notebook Line',
ondelete='CASCADE', select=True, required=True)
@classmethod
def __register__(cls, module_name):
super().__register__(module_name)
cursor = Transaction().connection.cursor()
cursor.execute('DELETE FROM "' + cls._table + '"')
# TODO: remove
class GenerateResultsReportResultMan(ModelView):