Tardo / OdooTerminal

Webextension tool for Odoo
GNU Affero General Public License v3.0
119 stars 27 forks source link

[BUG] Failure escaping character in LIKE search #65

Closed yajo closed 2 years ago

yajo commented 2 years ago

First of all, check that you are using the latest version.

Basic Info. (please complete the following information):

Describe the bug The payload that is sent breaks the intention. I tried with double escape bar (\\) and the same happens.

It sends these literal info:

{"jsonrpc":"2.0","method":"call","params":{"args":[],"model":"ir.model.data","method":"search_read","kwargs":{"context":{"lang":"es_ES","tz":"Europe/Lisbon","uid":10,"allowed_company_ids":[1],"active_test":false},"domain":{"[[\"module\",\"":",","l10n_es\"],[\"name\",\"":"like\",\"1\\_%\"]]"},"fields":["display_name"]}},"id":637204415}

If you pipe that to jq, it will say: parse error: Invalid escape at line 1, column 290

Expected behavior The domain is sent like this: [['module','=','l10n_es'],['name','=like','1\_%']]

Additional context

My intention was to escape the literal _ in Postgres.

Tardo commented 2 years ago

Thanks for report! should be fixed in 8.5.1: https://github.com/Tardo/OdooTerminal/pull/67

I'm having problems getting the github CI operational. Sometimes it works and sometimes it doesn't, I guess it's because of limitations with the machine resources :/ Doing some research to see if I can stabilize it...

Tardo commented 2 years ago

Info. about escaped sequences: https://github.com/Tardo/OdooTerminal#-escaped-sequences