Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/controllers/odoo.crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export class OdooCRUD<T> {
this._keys = keys;
}

public count(): Promise<number> {
public count(query: any[]): Promise<number> {
return new Promise<number>((resolve, reject) => {
const params: any[] = [this._model, "search_count", [[]]];
const params: any[] = [this._model, "search_count", [query]];
this._odoo
.callRPC(params)
.then((value: any) => {
Expand All @@ -43,13 +43,13 @@ export class OdooCRUD<T> {
});
}

public searchRead(query: any[], limit = 10): Promise<T[]> {
public searchRead(query: any[], limit = 10, offset = 0): Promise<T[]> {
return new Promise<T[]>((resolve, reject) => {
const params: any[] = [
this._model,
"search_read",
[query],
{ fields: this._keys, limit: limit }
{ fields: this._keys, limit: limit, offset: offset }
];
this._odoo
.callRPC(params)
Expand Down