Rational
We have CSV export from the client, this is useful for users to manipulate data outside Tryton for example in spreadsheet. But some experimented users may want to go further by automating the process. For that they may want to use spreadsheet functionality like IMPORTDATA from Google.
Proposal
I propose to add a generic entry point that returns CSV file like the export data on the client.
I think the URL could be generated automatically by the client on the export windows using the selected parameters. This will ease the learning of the URL syntax by the user.
The entry-point is of course be protected by authentication and the access rights will be enforced using the authenticated user. Any undefined locale settings is taken from the default value of the authenticated user.
The URL syntax is:
http(s)://<user>:<password>@<host>:<port>/<database>/data/<model>?l=en&d=[["id","=",1]]&o=name,asc&o=id,desc&f=id,f=name
The parameters are:
-
l
: language used, default: user language -
d
: JSON domain, default:[]
-
o
: list of the couple field name and direction to order, default: None -
s
: limit the number of record -
p
: number of page to skip (p * s = offset
) -
f
: list of field names (same as forModelStorage.export_data
) -
dl
: CSV delimiter, default,
-
qc
: quote char, default"
-
enc
: encoding, defaultUTF-8
-
loc
: Boolean to use locale formatting for date/time, number.