Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
5663 Visninger

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
Kassér
Forfatter Bedste svar

I ended up making queries for the related information.

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
jan. 24
3360
1
jul. 23
3414
0
okt. 22
3355
0
apr. 22
3252
0
mar. 22
2453