From 5d227d2f61af2c051292ed226c91cd440d6280a4 Mon Sep 17 00:00:00 2001 From: Ulrich Date: Sun, 9 Aug 2026 20:56:24 +0200 Subject: [PATCH] =?UTF-8?q?Ausertung=20von=20schleifen=20und=20Helperfunkt?= =?UTF-8?q?ionen=20erg=C3=A4nzt=20in=20extract.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/5.0/currency.json | 27 +++++++++- data/5.0/ir.json | 33 ++++++++++++ data/5.2/currency.json | 27 +++++++++- data/5.2/ir.json | 47 ++++++++++++++++ data/5.4/currency.json | 15 ++++++ data/5.4/ir.json | 47 ++++++++++++++++ data/5.4/stock_lot.json | 61 +++++++++++++++++++++ data/5.6/currency.json | 15 ++++++ data/5.6/ir.json | 47 ++++++++++++++++ data/5.6/stock_lot.json | 61 +++++++++++++++++++++ data/5.8/currency.json | 15 ++++++ data/5.8/ir.json | 47 ++++++++++++++++ data/5.8/stock_lot.json | 61 +++++++++++++++++++++ data/6.0/currency.json | 15 ++++++ data/6.0/ir.json | 47 ++++++++++++++++ data/6.0/stock_lot.json | 61 +++++++++++++++++++++ data/6.2/currency.json | 15 ++++++ data/6.2/ir.json | 47 ++++++++++++++++ data/6.2/stock_lot.json | 61 +++++++++++++++++++++ data/6.4/currency.json | 15 ++++++ data/6.4/ir.json | 47 ++++++++++++++++ data/6.4/stock_lot.json | 61 +++++++++++++++++++++ data/6.6/currency.json | 15 ++++++ data/6.6/ir.json | 47 ++++++++++++++++ data/6.6/stock_lot.json | 61 +++++++++++++++++++++ data/6.8/currency.json | 15 ++++++ data/6.8/ir.json | 47 ++++++++++++++++ data/6.8/stock_lot.json | 61 +++++++++++++++++++++ data/7.0/ir.json | 14 +++++ data/7.0/party.json | 31 +++++++++++ data/7.0/stock_lot.json | 61 +++++++++++++++++++++ data/7.2/ir.json | 14 +++++ data/7.2/party.json | 31 +++++++++++ data/7.2/stock_lot.json | 61 +++++++++++++++++++++ data/7.4/ir.json | 14 +++++ data/7.4/party.json | 31 +++++++++++ data/7.4/stock_lot.json | 61 +++++++++++++++++++++ data/7.6/ir.json | 24 +++++++++ data/7.6/party.json | 31 +++++++++++ data/7.8/ir.json | 24 +++++++++ data/7.8/party.json | 31 +++++++++++ data/8.0/ir.json | 24 +++++++++ data/8.0/party.json | 31 +++++++++++ extract.py | 117 ++++++++++++++++++++++++++++++++++++++-- 44 files changed, 1713 insertions(+), 5 deletions(-) diff --git a/data/5.0/currency.json b/data/5.0/currency.json index ff64e3e..e5ccf65 100644 --- a/data/5.0/currency.json +++ b/data/5.0/currency.json @@ -1,5 +1,30 @@ { "version": "5.0", "module": "currency", - "files": [] + "files": [ + { + "module": "currency", + "file": "currency.py", + "class": "Currency", + "method": "__register__", + "line": 55, + "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 64, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + } + ] + } + ] } \ No newline at end of file diff --git a/data/5.0/ir.json b/data/5.0/ir.json index 54ff216..43d498d 100644 --- a/data/5.0/ir.json +++ b/data/5.0/ir.json @@ -607,6 +607,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 89, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 89, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/5.2/currency.json b/data/5.2/currency.json index 19b3cc6..c5a4c09 100644 --- a/data/5.2/currency.json +++ b/data/5.2/currency.json @@ -1,5 +1,30 @@ { "version": "5.2", "module": "currency", - "files": [] + "files": [ + { + "module": "currency", + "file": "currency.py", + "class": "Currency", + "method": "__register__", + "line": 53, + "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 62, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + } + ] + } + ] } \ No newline at end of file diff --git a/data/5.2/ir.json b/data/5.2/ir.json index 96d5a5b..74e1b8e 100644 --- a/data/5.2/ir.json +++ b/data/5.2/ir.json @@ -337,6 +337,20 @@ "method": "__register__", "line": 66, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 74, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -740,6 +754,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 91, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 91, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/5.4/currency.json b/data/5.4/currency.json index ef5e03f..0decdab 100644 --- a/data/5.4/currency.json +++ b/data/5.4/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 53, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 67, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/5.4/ir.json b/data/5.4/ir.json index f6c308a..179ed00 100644 --- a/data/5.4/ir.json +++ b/data/5.4/ir.json @@ -337,6 +337,20 @@ "method": "__register__", "line": 69, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 77, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -740,6 +754,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 91, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 91, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/5.4/stock_lot.json b/data/5.4/stock_lot.json index 2c0d292..ce67656 100644 --- a/data/5.4/stock_lot.json +++ b/data/5.4/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 55, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 55, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 62, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 62, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/5.6/currency.json b/data/5.6/currency.json index b524548..b5be96f 100644 --- a/data/5.6/currency.json +++ b/data/5.6/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 51, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 65, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/5.6/ir.json b/data/5.6/ir.json index 9630f32..af229fd 100644 --- a/data/5.6/ir.json +++ b/data/5.6/ir.json @@ -337,6 +337,20 @@ "method": "__register__", "line": 69, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 77, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -800,6 +814,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 94, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 94, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/5.6/stock_lot.json b/data/5.6/stock_lot.json index f365816..4016e48 100644 --- a/data/5.6/stock_lot.json +++ b/data/5.6/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 55, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 55, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 62, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 62, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/5.8/currency.json b/data/5.8/currency.json index 4d7b6fb..883176f 100644 --- a/data/5.8/currency.json +++ b/data/5.8/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 51, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 65, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/5.8/ir.json b/data/5.8/ir.json index b24b42c..64f32e6 100644 --- a/data/5.8/ir.json +++ b/data/5.8/ir.json @@ -337,6 +337,20 @@ "method": "__register__", "line": 71, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 79, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -800,6 +814,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/5.8/stock_lot.json b/data/5.8/stock_lot.json index edc09bd..2dda019 100644 --- a/data/5.8/stock_lot.json +++ b/data/5.8/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 55, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 55, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 62, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 62, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/6.0/currency.json b/data/6.0/currency.json index e239cce..7303aab 100644 --- a/data/6.0/currency.json +++ b/data/6.0/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 59, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 73, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/6.0/ir.json b/data/6.0/ir.json index 9ab8b80..4b1e16f 100644 --- a/data/6.0/ir.json +++ b/data/6.0/ir.json @@ -337,6 +337,20 @@ "method": "__register__", "line": 84, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 92, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -899,6 +913,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/6.0/stock_lot.json b/data/6.0/stock_lot.json index 9a11c9f..75c97e1 100644 --- a/data/6.0/stock_lot.json +++ b/data/6.0/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 91, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 91, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 98, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 98, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/6.2/currency.json b/data/6.2/currency.json index e0348fc..78f0768 100644 --- a/data/6.2/currency.json +++ b/data/6.2/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 61, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 75, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/6.2/ir.json b/data/6.2/ir.json index f7eefe9..7781088 100644 --- a/data/6.2/ir.json +++ b/data/6.2/ir.json @@ -337,6 +337,20 @@ "method": "__register__", "line": 86, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 94, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -899,6 +913,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/6.2/stock_lot.json b/data/6.2/stock_lot.json index 0469326..195c5e5 100644 --- a/data/6.2/stock_lot.json +++ b/data/6.2/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 88, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 88, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 95, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 95, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/6.4/currency.json b/data/6.4/currency.json index 5ff469e..11db312 100644 --- a/data/6.4/currency.json +++ b/data/6.4/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 59, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 73, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/6.4/ir.json b/data/6.4/ir.json index 2926ceb..0bf8e65 100644 --- a/data/6.4/ir.json +++ b/data/6.4/ir.json @@ -337,6 +337,20 @@ "method": "__register__", "line": 87, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 95, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -922,6 +936,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 90, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/6.4/stock_lot.json b/data/6.4/stock_lot.json index e73e405..196c81f 100644 --- a/data/6.4/stock_lot.json +++ b/data/6.4/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 86, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 86, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 93, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 93, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/6.6/currency.json b/data/6.6/currency.json index 7e03ef5..2b1707b 100644 --- a/data/6.6/currency.json +++ b/data/6.6/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 60, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 74, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/6.6/ir.json b/data/6.6/ir.json index e79eff9..ebb9534 100644 --- a/data/6.6/ir.json +++ b/data/6.6/ir.json @@ -313,6 +313,20 @@ "method": "__register__", "line": 92, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 100, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -834,6 +848,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 91, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 91, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/6.6/stock_lot.json b/data/6.6/stock_lot.json index 43131d1..74777b9 100644 --- a/data/6.6/stock_lot.json +++ b/data/6.6/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 86, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 86, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 93, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 93, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/6.8/currency.json b/data/6.8/currency.json index f43dd8b..c98cd83 100644 --- a/data/6.8/currency.json +++ b/data/6.8/currency.json @@ -9,6 +9,21 @@ "method": "__register__", "line": 72, "operations": [ + { + "object": "table_h", + "operation": "not_null_action", + "tables": [ + "currency_currency" + ], + "line": 86, + "args": [ + "col", + "'remove'" + ], + "kwargs": {}, + "code": "table_h.not_null_action(col, 'remove')", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/6.8/ir.json b/data/6.8/ir.json index 2c4e3a2..94158ee 100644 --- a/data/6.8/ir.json +++ b/data/6.8/ir.json @@ -313,6 +313,20 @@ "method": "__register__", "line": 92, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 100, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", @@ -834,6 +848,39 @@ "phase": "after_super", "condition": "table.column_exist('minimum_delay')" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "ir_trigger" + ], + "line": 96, + "args": [ + "*sql_table.update([sql_table.minimum_time_delay], [delay], where=sql_table.id == id_)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_))", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, + { + "object": "sql_table", + "operation": "update", + "tables": [ + "ir_trigger" + ], + "line": 96, + "args": [ + "[sql_table.minimum_time_delay]", + "[delay]" + ], + "kwargs": { + "where": "sql_table.id == id_" + }, + "code": "sql_table.update(\n [sql_table.minimum_time_delay],\n [(datetime.timedelta(hours=delay))],\n where=sql_table.id == id_)", + "phase": "after_super", + "condition": "table.column_exist('minimum_delay')" + }, { "object": "table", "operation": "drop_column", diff --git a/data/6.8/stock_lot.json b/data/6.8/stock_lot.json index a6ee0e5..2b6442e 100644 --- a/data/6.8/stock_lot.json +++ b/data/6.8/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 89, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 89, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/7.0/ir.json b/data/7.0/ir.json index abcb3c7..a8f248c 100644 --- a/data/7.0/ir.json +++ b/data/7.0/ir.json @@ -57,6 +57,20 @@ "method": "__register__", "line": 92, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 100, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", diff --git a/data/7.0/party.json b/data/7.0/party.json index 76176d7..77096c9 100644 --- a/data/7.0/party.json +++ b/data/7.0/party.json @@ -236,6 +236,37 @@ }, "code": "table.update([table.type], ['cn_ric'],\n where=(table.type == 'cn_rit'))", "phase": "after_super" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "party_identifier" + ], + "line": 793, + "args": [ + "*table.update([table.type], [new], where=table.type == old)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*table.update(\n [table.type], [new],\n where=table.type == old))", + "phase": "after_super" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "party_identifier" + ], + "line": 793, + "args": [ + "[table.type]", + "[new]" + ], + "kwargs": { + "where": "table.type == old" + }, + "code": "table.update(\n [table.type], [new],\n where=table.type == old)", + "phase": "after_super" } ] } diff --git a/data/7.0/stock_lot.json b/data/7.0/stock_lot.json index 017d039..2f3a12d 100644 --- a/data/7.0/stock_lot.json +++ b/data/7.0/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 89, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 89, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/7.2/ir.json b/data/7.2/ir.json index cd0f85c..27f6262 100644 --- a/data/7.2/ir.json +++ b/data/7.2/ir.json @@ -57,6 +57,20 @@ "method": "__register__", "line": 92, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 100, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", diff --git a/data/7.2/party.json b/data/7.2/party.json index 379c5ad..a33f68b 100644 --- a/data/7.2/party.json +++ b/data/7.2/party.json @@ -261,6 +261,37 @@ }, "code": "table.update([table.type], ['cn_ric'],\n where=(table.type == 'cn_rit'))", "phase": "after_super" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "party_identifier" + ], + "line": 818, + "args": [ + "*table.update([table.type], [new], where=table.type == old)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*table.update(\n [table.type], [new],\n where=table.type == old))", + "phase": "after_super" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "party_identifier" + ], + "line": 818, + "args": [ + "[table.type]", + "[new]" + ], + "kwargs": { + "where": "table.type == old" + }, + "code": "table.update(\n [table.type], [new],\n where=table.type == old)", + "phase": "after_super" } ] } diff --git a/data/7.2/stock_lot.json b/data/7.2/stock_lot.json index e94a9f8..24f5916 100644 --- a/data/7.2/stock_lot.json +++ b/data/7.2/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 89, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 89, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/7.4/ir.json b/data/7.4/ir.json index 9db6b90..bbbeadc 100644 --- a/data/7.4/ir.json +++ b/data/7.4/ir.json @@ -57,6 +57,20 @@ "method": "__register__", "line": 119, "operations": [ + { + "object": "table_h", + "operation": "drop_column", + "tables": [ + "ir_cron" + ], + "line": 127, + "args": [ + "column" + ], + "kwargs": {}, + "code": "table_h.drop_column(column)", + "phase": "after_super" + }, { "object": "table_h", "operation": "not_null_action", diff --git a/data/7.4/party.json b/data/7.4/party.json index f936842..0794c9d 100644 --- a/data/7.4/party.json +++ b/data/7.4/party.json @@ -262,6 +262,37 @@ "code": "table.update([table.type], ['cn_ric'],\n where=(table.type == 'cn_rit'))", "phase": "after_super" }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "party_identifier" + ], + "line": 836, + "args": [ + "*table.update([table.type], [new], where=table.type == old)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*table.update(\n [table.type], [new],\n where=table.type == old))", + "phase": "after_super" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "party_identifier" + ], + "line": 836, + "args": [ + "[table.type]", + "[new]" + ], + "kwargs": { + "where": "table.type == old" + }, + "code": "table.update(\n [table.type], [new],\n where=table.type == old)", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/7.4/stock_lot.json b/data/7.4/stock_lot.json index 8fc8e38..c6df5fb 100644 --- a/data/7.4/stock_lot.json +++ b/data/7.4/stock_lot.json @@ -36,6 +36,67 @@ "code": "template_lot_type.select(\n template_lot_type.template,\n distinct_on=template_lot_type.template)", "phase": "after_super", "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [], + "line": 89, + "args": [ + "*template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id).select(lot_type.code, where=template_lot_type.template == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "template_lot_type.join(lot_type, condition=template_lot_type.type == lot_type.id)", + "operation": "select", + "tables": [], + "line": 89, + "args": [ + "lot_type.code" + ], + "kwargs": { + "where": "template_lot_type.template == template_id" + }, + "code": "template_lot_type\n .join(lot_type,\n condition=template_lot_type.type == lot_type.id)\n .select(\n lot_type.code,\n where=template_lot_type.template == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "cursor", + "operation": "execute", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "*table.update([table.lot_required], [value], where=table.id == template_id)" + ], + "kwargs": {}, + "code": "(connection.cursor()).execute(*table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id))", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "product_template" + ], + "line": 96, + "args": [ + "[table.lot_required]", + "[value]" + ], + "kwargs": { + "where": "table.id == template_id" + }, + "code": "table.update(\n [table.lot_required], [(cls.lot_required.sql_format([t for t, in cursor]))],\n where=table.id == template_id)", + "phase": "after_super", + "condition": "table_h.table_exist(template_lot_type_table_name) and table_h.table_exist(lot_type_table_name)" } ] } diff --git a/data/7.6/ir.json b/data/7.6/ir.json index d5ad8cd..ae102b4 100644 --- a/data/7.6/ir.json +++ b/data/7.6/ir.json @@ -615,6 +615,30 @@ } ] }, + { + "module": "ir", + "file": "trigger.py", + "class": "Trigger", + "method": "__register__", + "line": 93, + "operations": [ + { + "object": "table_h", + "operation": "column_rename", + "tables": [ + "ir_trigger" + ], + "line": 98, + "args": [ + "name", + "name + '_'" + ], + "kwargs": {}, + "code": "table_h.column_rename(name, name + '_')", + "phase": "before_super" + } + ] + }, { "module": "ir", "file": "ui/view.py", diff --git a/data/7.6/party.json b/data/7.6/party.json index 29b6fc2..066a4f4 100644 --- a/data/7.6/party.json +++ b/data/7.6/party.json @@ -113,6 +113,37 @@ "method": "__register__", "line": 825, "operations": [ + { + "object": "cursor", + "operation": "execute", + "tables": [ + "party_identifier" + ], + "line": 834, + "args": [ + "*table.update([table.type], [new], where=table.type == old)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*table.update(\n [table.type], [new],\n where=table.type == old))", + "phase": "after_super" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "party_identifier" + ], + "line": 834, + "args": [ + "[table.type]", + "[new]" + ], + "kwargs": { + "where": "table.type == old" + }, + "code": "table.update(\n [table.type], [new],\n where=table.type == old)", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/7.8/ir.json b/data/7.8/ir.json index 63f3358..346332b 100644 --- a/data/7.8/ir.json +++ b/data/7.8/ir.json @@ -615,6 +615,30 @@ } ] }, + { + "module": "ir", + "file": "trigger.py", + "class": "Trigger", + "method": "__register__", + "line": 93, + "operations": [ + { + "object": "table_h", + "operation": "column_rename", + "tables": [ + "ir_trigger" + ], + "line": 98, + "args": [ + "name", + "name + '_'" + ], + "kwargs": {}, + "code": "table_h.column_rename(name, name + '_')", + "phase": "before_super" + } + ] + }, { "module": "ir", "file": "ui/view.py", diff --git a/data/7.8/party.json b/data/7.8/party.json index 0a06770..a21563f 100644 --- a/data/7.8/party.json +++ b/data/7.8/party.json @@ -113,6 +113,37 @@ "method": "__register__", "line": 844, "operations": [ + { + "object": "cursor", + "operation": "execute", + "tables": [ + "party_identifier" + ], + "line": 853, + "args": [ + "*table.update([table.type], [new], where=table.type == old)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*table.update(\n [table.type], [new],\n where=table.type == old))", + "phase": "after_super" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "party_identifier" + ], + "line": 853, + "args": [ + "[table.type]", + "[new]" + ], + "kwargs": { + "where": "table.type == old" + }, + "code": "table.update(\n [table.type], [new],\n where=table.type == old)", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/data/8.0/ir.json b/data/8.0/ir.json index f55cd97..65f5a62 100644 --- a/data/8.0/ir.json +++ b/data/8.0/ir.json @@ -615,6 +615,30 @@ } ] }, + { + "module": "ir", + "file": "trigger.py", + "class": "Trigger", + "method": "__register__", + "line": 92, + "operations": [ + { + "object": "table_h", + "operation": "column_rename", + "tables": [ + "ir_trigger" + ], + "line": 97, + "args": [ + "name", + "name + '_'" + ], + "kwargs": {}, + "code": "table_h.column_rename(name, name + '_')", + "phase": "before_super" + } + ] + }, { "module": "ir", "file": "ui/view.py", diff --git a/data/8.0/party.json b/data/8.0/party.json index e38d09a..e6ab7c8 100644 --- a/data/8.0/party.json +++ b/data/8.0/party.json @@ -113,6 +113,37 @@ "method": "__register__", "line": 859, "operations": [ + { + "object": "cursor", + "operation": "execute", + "tables": [ + "party_identifier" + ], + "line": 873, + "args": [ + "*table.update([table.type], [new], where=table.type == old)" + ], + "kwargs": {}, + "code": "(Transaction().connection.cursor()).execute(*table.update(\n [table.type], [new],\n where=table.type == old))", + "phase": "after_super" + }, + { + "object": "table", + "operation": "update", + "tables": [ + "party_identifier" + ], + "line": 873, + "args": [ + "[table.type]", + "[new]" + ], + "kwargs": { + "where": "table.type == old" + }, + "code": "table.update(\n [table.type], [new],\n where=table.type == old)", + "phase": "after_super" + }, { "object": "cursor", "operation": "execute", diff --git a/extract.py b/extract.py index 2f0dc63..6fc7c3b 100644 --- a/extract.py +++ b/extract.py @@ -109,6 +109,15 @@ class RegisterExtractor(ast.NodeVisitor): # Klasse, in der wir uns gerade befinden (für cls._table etc.) self.current_class = None + # Name -> FunctionDef aller Methoden der aktuellen Klasse, um + # Helper-Aufrufe aus __register__ heraus aufzulösen. + self.class_methods = {} + + # Aufruf-Kette der Helper-Methoden, in die wir gerade rekursiv + # abgestiegen sind (für Zyklenschutz und die "via"-Provenienz + # der gefundenen Operationen). + self.call_chain = [] + # -- Modul-/Klassenebene ------------------------------------------------ def visit_Module(self, node): @@ -124,9 +133,18 @@ class RegisterExtractor(ast.NodeVisitor): self.generic_visit(node) def visit_ClassDef(self, node): + # Alle Methoden der Klasse vormerken, damit __register__-Aufrufe an + # eigene Helper-Methoden (z. B. `cls._migrate_x(module_name)`) + # aufgelöst werden können. + methods = { + item.name: item + for item in node.body + if isinstance(item, (ast.FunctionDef, ast.AsyncFunctionDef)) + } + for item in node.body: if isinstance(item, ast.FunctionDef) and item.name == "__register__": - self.extract_register(node.name, item) + self.extract_register(node.name, item, methods) self.generic_visit(node) @@ -147,13 +165,18 @@ class RegisterExtractor(ast.NodeVisitor): # -- __register__ selbst ------------------------------------------------- - def extract_register(self, cls, func): + def extract_register(self, cls, func, methods): """Analysiert eine einzelne __register__-Methode.""" operations = [] self.table_vars = {} self.alias_vars = {} self.current_class = cls + # Für die Auflösung von Helper-Aufrufen (cls._migrate_x(...)) und + # als Zyklenschutz während der Rekursion in solche Helper. + self.class_methods = methods + self.call_chain = [] + model_name = self.model_names.get(cls) if model_name: self.table_vars["cls"] = model_name @@ -338,6 +361,13 @@ class RegisterExtractor(ast.NodeVisitor): `phase` wechselt von "before_super" auf "after_super", sobald der super().__register__(...)-Aufruf gefunden wird. `condition` trägt den Text einer umschließenden if-Bedingung mit, falls vorhanden. + + Steigt dabei in ALLE geschachtelten Blöcke ab (if/for/while/with/ + try/except/finally), nicht nur in if. Aufrufe innerhalb einer + for-Schleife, eines with-Blocks oder eines try/except wurden vorher + stillschweigend übersprungen, weil nur ast.If speziell behandelt + wurde und alle anderen Compound-Statements kein `.value`-Attribut + besitzen. """ for stmt in statements: @@ -351,10 +381,38 @@ class RegisterExtractor(ast.NodeVisitor): self.walk_statements(stmt.orelse, operations, phase, condition) continue + for body in self._nested_bodies(stmt): + self.walk_statements(body, operations, phase, condition) + value = getattr(stmt, "value", None) if value is not None: self.walk_expression(value, operations, phase, condition) + @staticmethod + def _nested_bodies(stmt): + """ + Liefert alle Statement-Listen, die direkt in `stmt` geschachtelt + sind (außer bei ast.If, das walk_statements separat behandelt, + weil dort zusätzlich die Bedingung mitgeführt wird). + """ + bodies = [] + + if isinstance(stmt, (ast.For, ast.AsyncFor, ast.While)): + bodies.append(stmt.body) + bodies.append(stmt.orelse) + elif isinstance(stmt, (ast.With, ast.AsyncWith)): + bodies.append(stmt.body) + elif isinstance(stmt, ast.Try) or ( + hasattr(ast, "TryStar") and isinstance(stmt, ast.TryStar) + ): + bodies.append(stmt.body) + for handler in stmt.handlers: + bodies.append(handler.body) + bodies.append(stmt.orelse) + bodies.append(stmt.finalbody) + + return bodies + def walk_expression(self, node, operations, phase, condition): if node is None: return @@ -365,11 +423,64 @@ class RegisterExtractor(ast.NodeVisitor): op["phase"] = phase if condition: op["condition"] = condition + if self.call_chain: + op["via"] = [dict(entry) for entry in self.call_chain] operations.append(op) + else: + helper = self.resolve_helper_call(node) + if helper: + method_name, func_node = helper + self.walk_into_helper( + method_name, func_node, node.lineno, operations, phase, condition + ) for child in ast.iter_child_nodes(node): self.walk_expression(child, operations, phase, condition) + def resolve_helper_call(self, node): + """ + Erkennt Aufrufe der Form `cls.(...)` / `self.(...)` + an eine Methode, die in derselben Klasse definiert ist (z. B. eine + ausgelagerte Migrationsmethode). Cross-Klassen-/Cross-Datei-Aufrufe + werden bewusst nicht aufgelöst. + """ + if not isinstance(node.func, ast.Attribute): + return None + + receiver = node.func.value + if not (isinstance(receiver, ast.Name) and receiver.id in ("cls", "self")): + return None + + method_name = node.func.attr + if method_name == "__register__": + return None + + func_node = self.class_methods.get(method_name) + if func_node is None: + return None + + return method_name, func_node + + def walk_into_helper(self, method_name, func_node, call_line, operations, phase, condition): + """ + Steigt in eine Helper-Methode ab, als wäre ihr Körper an der + Aufrufstelle inline eingefügt. Mit Zyklenschutz gegen (indirekt) + rekursive Helper-Aufrufe. + """ + if any(entry["method"] == method_name for entry in self.call_chain): + return + + self.call_chain.append({"method": method_name, "line": call_line}) + + # Tabellen-Variablen, die lokal in der Helper-Methode definiert + # werden (z. B. `table = cls.__table__()`), vorab einsammeln. + for stmt in func_node.body: + self.collect_table_assignment(stmt) + + self.walk_statements(func_node.body, operations, phase, condition) + + self.call_chain.pop() + def is_super_register(self, stmt): """True für `super(...).__register__(...)` als eigenständiges Statement.""" if not isinstance(stmt, ast.Expr): @@ -619,4 +730,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main()