WIP lookup commands
This commit is contained in:
parent
26a123bb1e
commit
0625b3e414
18
odoo-rpc.py
18
odoo-rpc.py
|
@ -123,6 +123,9 @@ def autolog():
|
||||||
# Update data through a record
|
# Update data through a record
|
||||||
#user.name = "Brian Jones"
|
#user.name = "Brian Jones"
|
||||||
|
|
||||||
|
def file_path( muid, format ):
|
||||||
|
return "%s/%s.%s" % ( FOLDER, muid, format )
|
||||||
|
|
||||||
def json_path( model, id ):
|
def json_path( model, id ):
|
||||||
return "%s/%s.json" % ( FOLDER, Muid(model, id) )
|
return "%s/%s.json" % ( FOLDER, Muid(model, id) )
|
||||||
|
|
||||||
|
@ -215,10 +218,21 @@ def fields( model, domains ):
|
||||||
stack = []
|
stack = []
|
||||||
current_exports = []
|
current_exports = []
|
||||||
|
|
||||||
|
def lookup_file( muid, format ):
|
||||||
|
filename = file_path( muid, format )
|
||||||
|
# print( field.ttype, field.relation, id, _filename )
|
||||||
|
if not os.path.exists( filename ):
|
||||||
|
return { 'file': filename, 'exists': False }
|
||||||
|
else:
|
||||||
|
return { 'file': filename, 'exists': True }
|
||||||
|
|
||||||
def lookup_model( muid ):
|
def lookup_model( muid ):
|
||||||
eprint( "> Lookup model: %s" % (muid) )
|
eprint( "> Lookup model: %s" % (muid) )
|
||||||
# _stack = []
|
recursive = False
|
||||||
|
if ( 'recursive' in opts and opts['recursive'] ): # or ( 'format' in opts and 'json' in opts['format'] ):
|
||||||
|
recursive = opts['recursive']
|
||||||
|
eprint( "> Recursive: %s" % (recursive) )
|
||||||
|
|
||||||
_tree = {}
|
_tree = {}
|
||||||
# _ctree = _tree
|
# _ctree = _tree
|
||||||
model, id = muid.split( '/' )
|
model, id = muid.split( '/' )
|
||||||
|
@ -267,7 +281,7 @@ def lookup_model( muid ):
|
||||||
return _tree
|
return _tree
|
||||||
|
|
||||||
def lookup_recs( model, domains ):
|
def lookup_recs( model, domains ):
|
||||||
eprint( "> Lookup recursif: %s %s" % (model,domains) )
|
eprint( "> Lookup many: %s %s" % (model,domains) )
|
||||||
if model in MODEL_IGNORE:
|
if model in MODEL_IGNORE:
|
||||||
eprint( 'IGNORED' )
|
eprint( 'IGNORED' )
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue