Skip to Content
Menu
This question has been flagged
1 Reply
4940 Views

I want to get data from foreign keys (what I believe in the codebase is called "subfields" [1]) of the account.move.line model.

I expected the field name format used in the "/web/export/csv" endpoint also worked for the XML-RPC operations, but it seems not to be the case.

This is an excerpt of my code:

# OpenERP 6.1.1
args = [('account_id', 'ilike', account_id), ]
line_ids = sock.execute(dbname, uid, pwd, 'account.move.line', 'search', args)
fields = ['id', 'move_id/name', 'move_id/ref', 'move_id/state', 'period_id', 'date', 'journal_id/name', 'account_id/code', 'account_id/name', 'ref', 'name', 'partner_id/name', 'debit', 'credit', 'amount_currency', 'currency_id/name', 'date_maturity', 'reconcile_id/name']
lines = sock.execute(dbname, uid, pwd, model, 'read', ids, fields)
pprint(lines[0])
# The resulting records do not contain these fields: "X/Y" (eg. move_id/state)
# {'amount_currency': 0.0,
# 'credit': 0.0,# 'date': '2016-04-29',
# 'date_maturity': False,# 'debit': 0.0,
# 'id': 186462,# 'name': '[35975.00882] 031003-03 Metallic Blank Plate for Panels',
# 'ref': 'DIM-MovSal-2016-04376'}

 

[1] https://github.com/odoo/odoo/blob/fc2e80cb4bcc450762c7ac5cb82a3e2d88062b38/addons/web/controllers/main.py#L1222

Avatar
Discard
Author Best Answer

I ended up making queries for the related information.

Avatar
Discard
Related Posts Replies Views Activity
1
Jan 24
1181
1
Jul 23
1679
0
Oct 22
2196
0
Apr 22
2418
0
Mar 22
1391