@marcfargas/odoo-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +27 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +152 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/accounting.d.ts +16 -0
- package/dist/commands/accounting.d.ts.map +1 -0
- package/dist/commands/accounting.js +363 -0
- package/dist/commands/accounting.js.map +1 -0
- package/dist/commands/attendance.d.ts +14 -0
- package/dist/commands/attendance.d.ts.map +1 -0
- package/dist/commands/attendance.js +339 -0
- package/dist/commands/attendance.js.map +1 -0
- package/dist/commands/config.d.ts +12 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +159 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/mail.d.ts +12 -0
- package/dist/commands/mail.d.ts.map +1 -0
- package/dist/commands/mail.js +236 -0
- package/dist/commands/mail.js.map +1 -0
- package/dist/commands/modules.d.ts +14 -0
- package/dist/commands/modules.d.ts.map +1 -0
- package/dist/commands/modules.js +351 -0
- package/dist/commands/modules.js.map +1 -0
- package/dist/commands/records.d.ts +15 -0
- package/dist/commands/records.d.ts.map +1 -0
- package/dist/commands/records.js +591 -0
- package/dist/commands/records.js.map +1 -0
- package/dist/commands/schema.d.ts +16 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +381 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/state.d.ts +14 -0
- package/dist/commands/state.d.ts.map +1 -0
- package/dist/commands/state.js +373 -0
- package/dist/commands/state.js.map +1 -0
- package/dist/commands/timesheets.d.ts +15 -0
- package/dist/commands/timesheets.d.ts.map +1 -0
- package/dist/commands/timesheets.js +453 -0
- package/dist/commands/timesheets.js.map +1 -0
- package/dist/commands/url.d.ts +12 -0
- package/dist/commands/url.d.ts.map +1 -0
- package/dist/commands/url.js +149 -0
- package/dist/commands/url.js.map +1 -0
- package/dist/help/extra-help.d.ts +18 -0
- package/dist/help/extra-help.d.ts.map +1 -0
- package/dist/help/extra-help.js +207 -0
- package/dist/help/extra-help.js.map +1 -0
- package/dist/middleware/auth.d.ts +29 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +68 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/common-params.d.ts +90 -0
- package/dist/middleware/common-params.d.ts.map +1 -0
- package/dist/middleware/common-params.js +169 -0
- package/dist/middleware/common-params.js.map +1 -0
- package/dist/middleware/safety.d.ts +30 -0
- package/dist/middleware/safety.d.ts.map +1 -0
- package/dist/middleware/safety.js +64 -0
- package/dist/middleware/safety.js.map +1 -0
- package/dist/output/errors.d.ts +69 -0
- package/dist/output/errors.d.ts.map +1 -0
- package/dist/output/errors.js +193 -0
- package/dist/output/errors.js.map +1 -0
- package/dist/output/formatter.d.ts +80 -0
- package/dist/output/formatter.d.ts.map +1 -0
- package/dist/output/formatter.js +285 -0
- package/dist/output/formatter.js.map +1 -0
- package/dist/output/stream-writer.d.ts +33 -0
- package/dist/output/stream-writer.d.ts.map +1 -0
- package/dist/output/stream-writer.js +74 -0
- package/dist/output/stream-writer.js.map +1 -0
- package/dist/parsing/domain-parser.d.ts +61 -0
- package/dist/parsing/domain-parser.d.ts.map +1 -0
- package/dist/parsing/domain-parser.js +427 -0
- package/dist/parsing/domain-parser.js.map +1 -0
- package/dist/parsing/json-arg.d.ts +48 -0
- package/dist/parsing/json-arg.d.ts.map +1 -0
- package/dist/parsing/json-arg.js +165 -0
- package/dist/parsing/json-arg.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `odoo records` command group — generic CRUD on any Odoo model.
|
|
4
|
+
*
|
|
5
|
+
* Commands:
|
|
6
|
+
* records search <model> Filter + list records [READ]
|
|
7
|
+
* records get <model> <id> Fetch a single record [READ]
|
|
8
|
+
* records create <model> Create a record [WRITE]
|
|
9
|
+
* records write <model> <id> Update records (batch) [WRITE]
|
|
10
|
+
* records delete <model> <id> Delete a record [DESTRUCTIVE]
|
|
11
|
+
* records count <model> Count matching records [READ]
|
|
12
|
+
* records call <model> <method> Call arbitrary method [WRITE]
|
|
13
|
+
*/
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.buildRecordsCommand = buildRecordsCommand;
|
|
19
|
+
const commander_1 = require("commander");
|
|
20
|
+
const debug_1 = __importDefault(require("debug"));
|
|
21
|
+
const auth_1 = require("../middleware/auth");
|
|
22
|
+
const safety_1 = require("../middleware/safety");
|
|
23
|
+
const common_params_1 = require("../middleware/common-params");
|
|
24
|
+
const formatter_1 = require("../output/formatter");
|
|
25
|
+
const errors_1 = require("../output/errors");
|
|
26
|
+
const domain_parser_1 = require("../parsing/domain-parser");
|
|
27
|
+
const json_arg_1 = require("../parsing/json-arg");
|
|
28
|
+
const extra_help_1 = require("../help/extra-help");
|
|
29
|
+
const stream_writer_1 = require("../output/stream-writer");
|
|
30
|
+
const log = (0, debug_1.default)('odoo-cli:records');
|
|
31
|
+
function buildRecordsCommand() {
|
|
32
|
+
const records = new commander_1.Command('records').description('Generic CRUD on any Odoo model').addHelpText('after', `
|
|
33
|
+
Safety levels:
|
|
34
|
+
READ search, get, count, call (read methods)
|
|
35
|
+
WRITE create, write, call (mutating methods) — requires --confirm
|
|
36
|
+
DESTRUCTIVE delete — requires --confirm
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
odoo records search res.partner --fields id,name --limit 10
|
|
40
|
+
odoo records get crm.lead 42
|
|
41
|
+
odoo records create res.partner --data '{"name":"Acme"}' --confirm
|
|
42
|
+
odoo records write crm.lead 42 --data '{"stage_id":5}' --confirm
|
|
43
|
+
odoo records delete crm.lead 42 --confirm
|
|
44
|
+
odoo records count res.partner --filter active=true
|
|
45
|
+
odoo records call sale.order action_confirm --ids 42 --confirm
|
|
46
|
+
`);
|
|
47
|
+
// --help-extra
|
|
48
|
+
records.option('--help-extra', 'Show extended skill documentation for records');
|
|
49
|
+
records.hook('preAction', async (thisCommand) => {
|
|
50
|
+
const opts = thisCommand.opts();
|
|
51
|
+
if (opts.helpExtra) {
|
|
52
|
+
await (0, extra_help_1.showHelpExtra)('records');
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
records.addCommand(buildSearchCommand());
|
|
57
|
+
records.addCommand(buildGetCommand());
|
|
58
|
+
records.addCommand(buildCreateCommand());
|
|
59
|
+
records.addCommand(buildWriteCommand());
|
|
60
|
+
records.addCommand(buildDeleteCommand());
|
|
61
|
+
records.addCommand(buildCountCommand());
|
|
62
|
+
records.addCommand(buildCallCommand());
|
|
63
|
+
return records;
|
|
64
|
+
}
|
|
65
|
+
// ── Helper: resolve domain from flags ────────────────────────────────
|
|
66
|
+
async function resolveDomain(opts) {
|
|
67
|
+
let base = [];
|
|
68
|
+
if (opts.domainFile) {
|
|
69
|
+
base = await (0, domain_parser_1.readDomainFile)(opts.domainFile);
|
|
70
|
+
}
|
|
71
|
+
else if (opts.domainJson) {
|
|
72
|
+
base = (0, domain_parser_1.parseDomainJson)(opts.domainJson);
|
|
73
|
+
}
|
|
74
|
+
else if (opts.domain) {
|
|
75
|
+
base = (0, domain_parser_1.parseDomainArg)(opts.domain);
|
|
76
|
+
}
|
|
77
|
+
const filterTerms = opts.filter ? (0, domain_parser_1.parseFilterArgs)(opts.filter) : [];
|
|
78
|
+
return (0, domain_parser_1.combineDomains)(base, filterTerms);
|
|
79
|
+
}
|
|
80
|
+
// ── records search ───────────────────────────────────────────────────
|
|
81
|
+
function buildSearchCommand() {
|
|
82
|
+
const search = new commander_1.Command('search')
|
|
83
|
+
.description('Filter and list records [READ]')
|
|
84
|
+
.argument('<model>', 'Odoo model name (e.g., res.partner, crm.lead)')
|
|
85
|
+
.addHelpText('after', `
|
|
86
|
+
Examples:
|
|
87
|
+
odoo records search crm.lead --fields id,name,stage_id --limit 20
|
|
88
|
+
odoo records search res.partner --filter active=true --count
|
|
89
|
+
odoo records search sale.order --domain '[("state","=","sale")]' --format csv
|
|
90
|
+
odoo records search account.move --all --format ndjson > invoices.ndjson
|
|
91
|
+
`);
|
|
92
|
+
(0, common_params_1.addAuthOptions)(search);
|
|
93
|
+
(0, common_params_1.addSearchOptions)(search);
|
|
94
|
+
(0, common_params_1.addPaginationOptions)(search);
|
|
95
|
+
(0, common_params_1.addOutputOptions)(search);
|
|
96
|
+
search.option('--count', 'Print count instead of records');
|
|
97
|
+
search.action(async (model) => {
|
|
98
|
+
const opts = search.optsWithGlobals();
|
|
99
|
+
log('records search %s opts=%O', model, opts);
|
|
100
|
+
let client;
|
|
101
|
+
try {
|
|
102
|
+
client = await (0, auth_1.createAuthClient)(opts);
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
process.exit((0, errors_1.handleError)(err));
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
const domain = await resolveDomain(opts);
|
|
109
|
+
const fields = (0, common_params_1.parseFields)(opts.fields);
|
|
110
|
+
const format = (0, formatter_1.resolveFormat)(opts.format);
|
|
111
|
+
const effectiveLimit = (0, common_params_1.resolveLimit)(opts);
|
|
112
|
+
const pageSize = opts.pageSize ?? 500;
|
|
113
|
+
// --count shorthand
|
|
114
|
+
if (opts.count) {
|
|
115
|
+
const count = await client.searchCount(model, domain);
|
|
116
|
+
await (0, stream_writer_1.writeStdout)(String(count) + '\n');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
log('search domain=%O fields=%O limit=%d offset=%d', domain, fields, effectiveLimit, opts.offset);
|
|
120
|
+
if (effectiveLimit === 0 || opts.all) {
|
|
121
|
+
// Paged fetch — stream for ndjson/csv, buffer for json/table
|
|
122
|
+
const searchFn = (offset, limit) => client.searchRead(model, domain, {
|
|
123
|
+
fields: fields.length > 0 ? fields : undefined,
|
|
124
|
+
offset,
|
|
125
|
+
limit,
|
|
126
|
+
order: opts.order,
|
|
127
|
+
});
|
|
128
|
+
if (format === 'ndjson') {
|
|
129
|
+
let firstPage = true;
|
|
130
|
+
for await (const page of (0, formatter_1.pagedSearchRead)(searchFn, pageSize)) {
|
|
131
|
+
await (0, formatter_1.formatNdjson)(page);
|
|
132
|
+
if (firstPage && page.length > 0)
|
|
133
|
+
firstPage = false;
|
|
134
|
+
}
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (format === 'csv') {
|
|
138
|
+
// headerCols is captured from the first record and reused for all pages
|
|
139
|
+
// to prevent column mismatch when different pages return different field sets.
|
|
140
|
+
let headerCols = null;
|
|
141
|
+
for await (const page of (0, formatter_1.pagedSearchRead)(searchFn, pageSize)) {
|
|
142
|
+
for (const rec of page) {
|
|
143
|
+
const flat = (0, formatter_1.flattenRecord)(rec);
|
|
144
|
+
if (!headerCols) {
|
|
145
|
+
headerCols = Object.keys(flat);
|
|
146
|
+
await (0, stream_writer_1.writeStdout)((0, stream_writer_1.toCsvRow)(headerCols) + '\n');
|
|
147
|
+
}
|
|
148
|
+
await (0, stream_writer_1.writeStdout)((0, stream_writer_1.toCsvRow)(headerCols.map((c) => flat[c] ?? '')) + '\n');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
// json/table: buffer all pages
|
|
154
|
+
const allRecords = [];
|
|
155
|
+
for await (const page of (0, formatter_1.pagedSearchRead)(searchFn, pageSize)) {
|
|
156
|
+
allRecords.push(...page);
|
|
157
|
+
}
|
|
158
|
+
await (0, formatter_1.render)(allRecords, format);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
const records = await client.searchRead(model, domain, {
|
|
162
|
+
fields: fields.length > 0 ? fields : undefined,
|
|
163
|
+
offset: opts.offset,
|
|
164
|
+
limit: effectiveLimit,
|
|
165
|
+
order: opts.order,
|
|
166
|
+
});
|
|
167
|
+
await (0, formatter_1.render)(records, format);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
process.exit((0, errors_1.handleError)(err));
|
|
172
|
+
}
|
|
173
|
+
finally {
|
|
174
|
+
client?.logout();
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
return search;
|
|
178
|
+
}
|
|
179
|
+
// ── records get ──────────────────────────────────────────────────────
|
|
180
|
+
function buildGetCommand() {
|
|
181
|
+
const get = new commander_1.Command('get')
|
|
182
|
+
.description('Fetch a single record [READ] (default fields: id, display_name)')
|
|
183
|
+
.argument('<model>', 'Odoo model name')
|
|
184
|
+
.argument('<id>', 'Record ID')
|
|
185
|
+
.addHelpText('after', `
|
|
186
|
+
Default fields: id, display_name. Use --fields to request more.
|
|
187
|
+
|
|
188
|
+
Examples:
|
|
189
|
+
odoo records get crm.lead 42
|
|
190
|
+
odoo records get res.partner 7 --fields id,name,email,phone
|
|
191
|
+
odoo records get sale.order 88 --format json
|
|
192
|
+
`);
|
|
193
|
+
(0, common_params_1.addAuthOptions)(get);
|
|
194
|
+
(0, common_params_1.addOutputOptions)(get);
|
|
195
|
+
get.action(async (model, idStr) => {
|
|
196
|
+
const opts = get.optsWithGlobals();
|
|
197
|
+
const id = parseInt(idStr, 10);
|
|
198
|
+
if (isNaN(id)) {
|
|
199
|
+
process.stderr.write(`✗ Error: Invalid ID '${idStr}'\n`);
|
|
200
|
+
process.exit(errors_1.EXIT_CODES.USAGE_ERROR);
|
|
201
|
+
}
|
|
202
|
+
log('records get %s %d', model, id);
|
|
203
|
+
let client;
|
|
204
|
+
try {
|
|
205
|
+
client = await (0, auth_1.createAuthClient)(opts);
|
|
206
|
+
}
|
|
207
|
+
catch (err) {
|
|
208
|
+
process.exit((0, errors_1.handleError)(err));
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
// Default: id + display_name only
|
|
212
|
+
const fields = (0, common_params_1.parseFields)(opts.fields);
|
|
213
|
+
const effectiveFields = fields.length > 0 ? fields : ['id', 'display_name'];
|
|
214
|
+
const format = (0, formatter_1.resolveFormat)(opts.format);
|
|
215
|
+
const records = await client.read(model, [id], effectiveFields);
|
|
216
|
+
if (records.length === 0) {
|
|
217
|
+
process.stderr.write(`✗ Error: ${model}#${id} not found\n`);
|
|
218
|
+
process.exit(errors_1.EXIT_CODES.NOT_FOUND);
|
|
219
|
+
}
|
|
220
|
+
await (0, formatter_1.renderSingle)(records[0], format);
|
|
221
|
+
}
|
|
222
|
+
catch (err) {
|
|
223
|
+
process.exit((0, errors_1.handleError)(err));
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
client?.logout();
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
return get;
|
|
230
|
+
}
|
|
231
|
+
// ── records create ───────────────────────────────────────────────────
|
|
232
|
+
function buildCreateCommand() {
|
|
233
|
+
const create = new commander_1.Command('create')
|
|
234
|
+
.description('Create a record [WRITE — requires --confirm]')
|
|
235
|
+
.argument('<model>', 'Odoo model name')
|
|
236
|
+
.addHelpText('after', `
|
|
237
|
+
Examples:
|
|
238
|
+
odoo records create res.partner --data '{"name":"Acme Corp"}' --confirm
|
|
239
|
+
echo '{"name":"Test"}' | odoo records create project.project --data-file - --confirm
|
|
240
|
+
odoo records create crm.lead --data '{"name":"New Lead"}' --confirm --dry-run
|
|
241
|
+
`);
|
|
242
|
+
(0, common_params_1.addAuthOptions)(create);
|
|
243
|
+
(0, common_params_1.addWriteOptions)(create);
|
|
244
|
+
(0, common_params_1.addOutputOptions)(create);
|
|
245
|
+
create.option('--data <json>', 'Field values as JSON object');
|
|
246
|
+
create.option('--data-file <file>', "Read --data from file ('-' for stdin)");
|
|
247
|
+
create.action(async (model) => {
|
|
248
|
+
const opts = create.optsWithGlobals();
|
|
249
|
+
log('records create %s', model);
|
|
250
|
+
try {
|
|
251
|
+
(0, safety_1.requireConfirm)('WRITE', opts, `records create ${model}`);
|
|
252
|
+
}
|
|
253
|
+
catch (err) {
|
|
254
|
+
process.exit((0, errors_1.handleError)(err));
|
|
255
|
+
}
|
|
256
|
+
let values;
|
|
257
|
+
try {
|
|
258
|
+
if (opts.dataFile) {
|
|
259
|
+
values = await (0, json_arg_1.readJsonFile)(opts.dataFile, '--data-file');
|
|
260
|
+
}
|
|
261
|
+
else if (opts.data) {
|
|
262
|
+
values = (0, json_arg_1.parseJsonArg)(opts.data, '--data');
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
process.stderr.write('✗ Error: --data or --data-file is required for create\n');
|
|
266
|
+
process.exit(errors_1.EXIT_CODES.USAGE_ERROR);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
process.exit((0, errors_1.handleError)(err));
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const context = opts.context ? (0, json_arg_1.parseJsonArg)(opts.context, '--context') : {};
|
|
275
|
+
if (opts.dryRun) {
|
|
276
|
+
(0, safety_1.printDryRun)(model, 'create', [values], { context });
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
let client;
|
|
280
|
+
try {
|
|
281
|
+
client = await (0, auth_1.createAuthClient)(opts);
|
|
282
|
+
}
|
|
283
|
+
catch (err) {
|
|
284
|
+
process.exit((0, errors_1.handleError)(err));
|
|
285
|
+
}
|
|
286
|
+
try {
|
|
287
|
+
const format = (0, formatter_1.resolveFormat)(opts.format);
|
|
288
|
+
const id = await client.create(model, values, context);
|
|
289
|
+
if (format === 'json' || format === 'ndjson') {
|
|
290
|
+
await (0, stream_writer_1.writeStdout)(JSON.stringify({ id }) + '\n');
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
process.stderr.write(`✓ Created ${model} id=${id}\n`);
|
|
294
|
+
await (0, stream_writer_1.writeStdout)(String(id) + '\n');
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
catch (err) {
|
|
298
|
+
process.exit((0, errors_1.handleError)(err));
|
|
299
|
+
}
|
|
300
|
+
finally {
|
|
301
|
+
client?.logout();
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
return create;
|
|
305
|
+
}
|
|
306
|
+
// ── records write ────────────────────────────────────────────────────
|
|
307
|
+
function buildWriteCommand() {
|
|
308
|
+
const write = new commander_1.Command('write')
|
|
309
|
+
.description('Update records — batch by comma-separated IDs [WRITE — requires --confirm]')
|
|
310
|
+
.argument('<model>', 'Odoo model name')
|
|
311
|
+
.argument('<ids>', 'Record ID or comma-separated IDs (e.g., 1,2,3)')
|
|
312
|
+
.addHelpText('after', `
|
|
313
|
+
Examples:
|
|
314
|
+
odoo records write crm.lead 42 --data '{"stage_id":5}' --confirm
|
|
315
|
+
odoo records write res.partner 1,2,3 --data '{"active":false}' --confirm
|
|
316
|
+
odoo records write crm.lead 42 --data '{"name":"New Name"}' --confirm --dry-run
|
|
317
|
+
`);
|
|
318
|
+
(0, common_params_1.addAuthOptions)(write);
|
|
319
|
+
(0, common_params_1.addWriteOptions)(write);
|
|
320
|
+
write.option('--data <json>', 'Field values to update as JSON object');
|
|
321
|
+
write.option('--data-file <file>', "Read --data from file ('-' for stdin)");
|
|
322
|
+
write.action(async (model, idsStr) => {
|
|
323
|
+
const opts = write.optsWithGlobals();
|
|
324
|
+
let ids;
|
|
325
|
+
try {
|
|
326
|
+
ids = (0, json_arg_1.parseIds)(idsStr);
|
|
327
|
+
}
|
|
328
|
+
catch (err) {
|
|
329
|
+
process.exit((0, errors_1.handleError)(err));
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
log('records write %s ids=%O', model, ids);
|
|
333
|
+
try {
|
|
334
|
+
(0, safety_1.requireConfirm)('WRITE', opts, `records write ${model} [${ids.join(',')}]`);
|
|
335
|
+
}
|
|
336
|
+
catch (err) {
|
|
337
|
+
process.exit((0, errors_1.handleError)(err));
|
|
338
|
+
}
|
|
339
|
+
let values;
|
|
340
|
+
try {
|
|
341
|
+
if (opts.dataFile) {
|
|
342
|
+
values = await (0, json_arg_1.readJsonFile)(opts.dataFile, '--data-file');
|
|
343
|
+
}
|
|
344
|
+
else if (opts.data) {
|
|
345
|
+
values = (0, json_arg_1.parseJsonArg)(opts.data, '--data');
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
process.stderr.write('✗ Error: --data or --data-file is required for write\n');
|
|
349
|
+
process.exit(errors_1.EXIT_CODES.USAGE_ERROR);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
catch (err) {
|
|
354
|
+
process.exit((0, errors_1.handleError)(err));
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const context = opts.context ? (0, json_arg_1.parseJsonArg)(opts.context, '--context') : {};
|
|
358
|
+
if (opts.dryRun) {
|
|
359
|
+
(0, safety_1.printDryRun)(model, 'write', [ids, values], { context });
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
let client;
|
|
363
|
+
try {
|
|
364
|
+
client = await (0, auth_1.createAuthClient)(opts);
|
|
365
|
+
}
|
|
366
|
+
catch (err) {
|
|
367
|
+
process.exit((0, errors_1.handleError)(err));
|
|
368
|
+
}
|
|
369
|
+
try {
|
|
370
|
+
await client.write(model, ids, values, context);
|
|
371
|
+
process.stderr.write(`✓ Updated ${model} ids=[${ids.join(',')}]\n`);
|
|
372
|
+
}
|
|
373
|
+
catch (err) {
|
|
374
|
+
process.exit((0, errors_1.handleError)(err));
|
|
375
|
+
}
|
|
376
|
+
finally {
|
|
377
|
+
client?.logout();
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
return write;
|
|
381
|
+
}
|
|
382
|
+
// ── records delete ───────────────────────────────────────────────────
|
|
383
|
+
function buildDeleteCommand() {
|
|
384
|
+
const del = new commander_1.Command('delete')
|
|
385
|
+
.description('Delete a record [DESTRUCTIVE — requires --confirm]')
|
|
386
|
+
.argument('<model>', 'Odoo model name')
|
|
387
|
+
.argument('<ids>', 'Record ID or comma-separated IDs')
|
|
388
|
+
.addHelpText('after', `
|
|
389
|
+
Always fetches display_name before deleting for confirmation display.
|
|
390
|
+
Batch delete shows count: "Delete 12 records from crm.lead?"
|
|
391
|
+
|
|
392
|
+
Examples:
|
|
393
|
+
odoo records delete crm.lead 42 --confirm
|
|
394
|
+
odoo records delete res.partner 1,2,3 --confirm
|
|
395
|
+
odoo records delete crm.lead 42 --confirm --dry-run
|
|
396
|
+
`);
|
|
397
|
+
(0, common_params_1.addAuthOptions)(del);
|
|
398
|
+
del.addOption((0, common_params_1.confirmOption)());
|
|
399
|
+
del.addOption((0, common_params_1.dryRunOption)());
|
|
400
|
+
del.action(async (model, idsStr) => {
|
|
401
|
+
const opts = del.optsWithGlobals();
|
|
402
|
+
let ids;
|
|
403
|
+
try {
|
|
404
|
+
ids = (0, json_arg_1.parseIds)(idsStr);
|
|
405
|
+
}
|
|
406
|
+
catch (err) {
|
|
407
|
+
process.exit((0, errors_1.handleError)(err));
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
log('records delete %s ids=%O', model, ids);
|
|
411
|
+
try {
|
|
412
|
+
(0, safety_1.requireConfirm)('DESTRUCTIVE', opts, `records delete ${model} [${ids.join(',')}]`);
|
|
413
|
+
}
|
|
414
|
+
catch (err) {
|
|
415
|
+
process.exit((0, errors_1.handleError)(err));
|
|
416
|
+
}
|
|
417
|
+
if (opts.dryRun) {
|
|
418
|
+
(0, safety_1.printDryRun)(model, 'unlink', [ids]);
|
|
419
|
+
process.stderr.write(`DRY RUN: Would delete ${model} ids=[${ids.join(',')}]\n`);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
let client;
|
|
423
|
+
try {
|
|
424
|
+
client = await (0, auth_1.createAuthClient)(opts);
|
|
425
|
+
}
|
|
426
|
+
catch (err) {
|
|
427
|
+
process.exit((0, errors_1.handleError)(err));
|
|
428
|
+
}
|
|
429
|
+
try {
|
|
430
|
+
// Fetch names first for display
|
|
431
|
+
const records = await client.read(model, ids, ['id', 'display_name']).catch(() => []);
|
|
432
|
+
if (ids.length === 1 && records.length > 0) {
|
|
433
|
+
process.stderr.write(`Deleting ${model}#${ids[0]} (${records[0].display_name})\n`);
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
process.stderr.write(`Deleting ${ids.length} records from ${model}\n`);
|
|
437
|
+
}
|
|
438
|
+
await client.unlink(model, ids);
|
|
439
|
+
process.stderr.write(`✓ Deleted ${model} ids=[${ids.join(',')}]\n`);
|
|
440
|
+
}
|
|
441
|
+
catch (err) {
|
|
442
|
+
process.exit((0, errors_1.handleError)(err));
|
|
443
|
+
}
|
|
444
|
+
finally {
|
|
445
|
+
client?.logout();
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
return del;
|
|
449
|
+
}
|
|
450
|
+
// ── records count ────────────────────────────────────────────────────
|
|
451
|
+
function buildCountCommand() {
|
|
452
|
+
const count = new commander_1.Command('count')
|
|
453
|
+
.description('Count matching records [READ]')
|
|
454
|
+
.argument('<model>', 'Odoo model name')
|
|
455
|
+
.addHelpText('after', `
|
|
456
|
+
Always outputs a bare integer to stdout.
|
|
457
|
+
|
|
458
|
+
Examples:
|
|
459
|
+
odoo records count res.partner --filter active=true
|
|
460
|
+
COUNT=$(odoo records count crm.lead --filter stage_id.name=Won)
|
|
461
|
+
`);
|
|
462
|
+
(0, common_params_1.addAuthOptions)(count);
|
|
463
|
+
(0, common_params_1.addSearchOptions)(count);
|
|
464
|
+
count.action(async (model) => {
|
|
465
|
+
const opts = count.optsWithGlobals();
|
|
466
|
+
log('records count %s', model);
|
|
467
|
+
let client;
|
|
468
|
+
try {
|
|
469
|
+
client = await (0, auth_1.createAuthClient)(opts);
|
|
470
|
+
}
|
|
471
|
+
catch (err) {
|
|
472
|
+
process.exit((0, errors_1.handleError)(err));
|
|
473
|
+
}
|
|
474
|
+
try {
|
|
475
|
+
const domain = await resolveDomain(opts);
|
|
476
|
+
const n = await client.searchCount(model, domain);
|
|
477
|
+
await (0, stream_writer_1.writeStdout)(String(n) + '\n');
|
|
478
|
+
}
|
|
479
|
+
catch (err) {
|
|
480
|
+
process.exit((0, errors_1.handleError)(err));
|
|
481
|
+
}
|
|
482
|
+
finally {
|
|
483
|
+
client?.logout();
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
return count;
|
|
487
|
+
}
|
|
488
|
+
// ── records call ─────────────────────────────────────────────────────
|
|
489
|
+
function buildCallCommand() {
|
|
490
|
+
const call = new commander_1.Command('call')
|
|
491
|
+
.description('Call an arbitrary model method [WRITE — requires --confirm for mutations]')
|
|
492
|
+
.argument('<model>', 'Odoo model name')
|
|
493
|
+
.argument('<method>', 'Method name (e.g., action_confirm)')
|
|
494
|
+
.addHelpText('after', `
|
|
495
|
+
Examples:
|
|
496
|
+
odoo records call sale.order action_confirm --ids 42 --confirm
|
|
497
|
+
odoo records call sale.order action_cancel --ids 42,43 --confirm
|
|
498
|
+
odoo records call account.move action_post --ids 101 --kwargs '{"force_whole_entry":true}' --confirm
|
|
499
|
+
odoo records call sale.order action_confirm --ids 42 --dry-run
|
|
500
|
+
`);
|
|
501
|
+
(0, common_params_1.addAuthOptions)(call);
|
|
502
|
+
call.option('--ids <n,n,...>', 'Record IDs (comma-separated)');
|
|
503
|
+
call.option('--args <json>', 'Positional args as JSON array (default: [])');
|
|
504
|
+
call.option('--kwargs <json>', 'Keyword args as JSON object (default: {})');
|
|
505
|
+
call.option('--read-only', 'Treat this as a read-only call (skips --confirm requirement)');
|
|
506
|
+
call.addOption((0, common_params_1.confirmOption)());
|
|
507
|
+
call.addOption((0, common_params_1.dryRunOption)());
|
|
508
|
+
call.addOption((0, common_params_1.contextOption)());
|
|
509
|
+
(0, common_params_1.addOutputOptions)(call);
|
|
510
|
+
call.action(async (model, method) => {
|
|
511
|
+
const opts = call.optsWithGlobals();
|
|
512
|
+
log('records call %s.%s readOnly=%s', model, method, opts.readOnly);
|
|
513
|
+
// All methods are WRITE by default. Pass --read-only to skip --confirm.
|
|
514
|
+
// Custom Odoo modules can have methods named read_xxx that mutate data,
|
|
515
|
+
// so we cannot safely infer safety from method names.
|
|
516
|
+
const level = opts.readOnly ? 'READ' : 'WRITE';
|
|
517
|
+
if (level === 'WRITE') {
|
|
518
|
+
try {
|
|
519
|
+
(0, safety_1.requireConfirm)('WRITE', opts, `records call ${model}.${method}`);
|
|
520
|
+
}
|
|
521
|
+
catch (err) {
|
|
522
|
+
process.exit((0, errors_1.handleError)(err));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
let args = [];
|
|
526
|
+
let kwargs = {};
|
|
527
|
+
try {
|
|
528
|
+
if (opts.args)
|
|
529
|
+
args = (0, json_arg_1.parseJsonArray)(opts.args, '--args');
|
|
530
|
+
if (opts.kwargs)
|
|
531
|
+
kwargs = (0, json_arg_1.parseJsonArg)(opts.kwargs, '--kwargs');
|
|
532
|
+
if (opts.context) {
|
|
533
|
+
const ctx = (0, json_arg_1.parseJsonArg)(opts.context, '--context');
|
|
534
|
+
kwargs = { ...kwargs, context: ctx };
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
catch (err) {
|
|
538
|
+
process.exit((0, errors_1.handleError)(err));
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
// Prepend IDs to args if --ids provided
|
|
542
|
+
let ids;
|
|
543
|
+
if (opts.ids) {
|
|
544
|
+
try {
|
|
545
|
+
ids = (0, json_arg_1.parseIds)(opts.ids);
|
|
546
|
+
}
|
|
547
|
+
catch (err) {
|
|
548
|
+
process.exit((0, errors_1.handleError)(err));
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
const callArgs = ids ? [ids, ...args] : args;
|
|
553
|
+
if (opts.dryRun) {
|
|
554
|
+
(0, safety_1.printDryRun)(model, method, callArgs, kwargs);
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
let client;
|
|
558
|
+
try {
|
|
559
|
+
client = await (0, auth_1.createAuthClient)(opts);
|
|
560
|
+
}
|
|
561
|
+
catch (err) {
|
|
562
|
+
process.exit((0, errors_1.handleError)(err));
|
|
563
|
+
}
|
|
564
|
+
try {
|
|
565
|
+
const result = await client.call(model, method, callArgs, kwargs, { safetyLevel: level });
|
|
566
|
+
const format = (0, formatter_1.resolveFormat)(opts.format);
|
|
567
|
+
if (result !== null && result !== undefined) {
|
|
568
|
+
if (Array.isArray(result)) {
|
|
569
|
+
await (0, formatter_1.render)(result.filter((r) => typeof r === 'object'), format);
|
|
570
|
+
}
|
|
571
|
+
else if (typeof result === 'object') {
|
|
572
|
+
await (0, stream_writer_1.writeStdout)(JSON.stringify(result, null, 2) + '\n');
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
await (0, stream_writer_1.writeStdout)(String(result) + '\n');
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
process.stderr.write(`✓ ${model}.${method}() completed\n`);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
catch (err) {
|
|
583
|
+
process.exit((0, errors_1.handleError)(err));
|
|
584
|
+
}
|
|
585
|
+
finally {
|
|
586
|
+
client?.logout();
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
return call;
|
|
590
|
+
}
|
|
591
|
+
//# sourceMappingURL=records.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../src/commands/records.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;AAwCH,kDAuCC;AA7ED,yCAAoC;AACpC,kDAA0B;AAC1B,6CAAsE;AACtE,iDAAmE;AACnE,+DAWqC;AACrC,mDAO6B;AAC7B,6CAA2D;AAC3D,4DAMkC;AAClC,kDAA2F;AAC3F,mDAAmD;AACnD,2DAAgE;AAEhE,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,kBAAkB,CAAC,CAAC;AAEtC,SAAgB,mBAAmB;IACjC,MAAM,OAAO,GAAG,IAAI,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,CAAC,IAAI,CAAC,IAAA,oBAAW,EAAC,GAAG,CAAC,CAAC,CAAC;QACjC,CAAC;gBAAS,CAAC;YACT,MAAM,EAAE,MAAM,EAAE,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `odoo schema` command group — model and field introspection.
|
|
3
|
+
*
|
|
4
|
+
* Wraps @marcfargas/odoo-introspection.
|
|
5
|
+
*
|
|
6
|
+
* Commands:
|
|
7
|
+
* schema models List all models [READ]
|
|
8
|
+
* schema fields <model> List fields for a model [READ]
|
|
9
|
+
* schema describe <model> Human-readable model summary [READ]
|
|
10
|
+
* schema codegen <model> Generate TypeScript interface [READ]
|
|
11
|
+
*
|
|
12
|
+
* All commands are READ — no mutations.
|
|
13
|
+
*/
|
|
14
|
+
import { Command } from 'commander';
|
|
15
|
+
export declare function buildSchemaCommand(): Command;
|
|
16
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,kBAAkB,IAAI,OAAO,CAiC5C"}
|