Added config folder with TSV columns for each model

This commit is contained in:
DiG 2022-02-05 21:20:58 +01:00
parent 113c5bf2b0
commit a4473cc7d0
2 changed files with 19 additions and 14 deletions

View File

@ -14,11 +14,14 @@ with open(".modelignore", "r") as file:
conf_files = os.listdir( CONFDIR )
keyword = 'your_keyword'
COLS = {
'': [ 'id', 'name', 'create_uid' ], # default
}
for file in conf_files:
if os.path.isfile( os.path.join(CONFDIR,file) ):
if file.endswith('.tsv'):
eprint( 'Conf file: ', file )
# eprint( 'Conf file: ', file )
f = open( os.path.join(CONFDIR,file), 'r' )
eprint( file[:-4], f.split() )
COLS[file[:-4]] = f.read().split()
f.close()

View File

@ -1,12 +1,14 @@
from __future__ import print_function
import json as JSON
from config import *
# TABLE VIEW COLUMNS
cols = {
'': [ 'id', 'name', 'create_uid' ], # default
'ir.model': [ 'id', 'model' ],
'ir.model.fields': [ 'id', 'name', 'ttype', 'create_uid', 'relation', 'display_name', 'complete_name' ],
}
# cols = {
# '': [ 'id', 'name', 'create_uid' ], # default
# 'ir.model': [ 'id', 'model' ],
# 'ir.model.fields': [ 'id', 'name', 'ttype', 'create_uid', 'relation', 'display_name', 'complete_name' ],
# 'ir.module.module': [ 'id', 'name', 'display_name', 'application', 'write_uid', 'write_date', 'dependencies_id' ],
# }
import os
# import locale
@ -38,10 +40,10 @@ def json( obj ):
def render_tsv( model, list ):
if model in cols:
_cols = cols[model]
if model in COLS:
_cols = COLS[model]
else:
_cols = cols['']
_cols = COLS['']
tsv( *_cols )
@ -50,10 +52,10 @@ def render_tsv( model, list ):
def render_csv( model, list ):
if model in cols:
_cols = cols[model]
if model in COLS:
_cols = COLS[model]
else:
_cols = cols['']
_cols = COLS['']
csv( *_cols )