Tardo / OdooTerminal

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

Env variables for `ACTIVE_ID` and `ACTIVE_MODEL` #131

Closed ivantodorovich closed 3 months ago

ivantodorovich commented 6 months ago

First of all, I wanna thank you for this amazing tool ❤️ I have integrated it into my flow and it has saved me quite a lot of time already


Is your feature request related to a problem? Please describe. Not really a problem, just something I wish it was possible. I often use this tool to read hidden or missing fields on a record form. For example, I navigate to a sale.order record, get the id from the browser URL, and use read sale.order ID field1,field2

Describe the solution you'd like I'd like to be able to execute something like read $ACTIVE_MODEL $ACTIVE_ID field1,field2, where ACTIVE_MODEL and ACTIVE_ID would be inferred from the page.


Is this something you'd be interested in? I'd be happy to contribute to make it happen (any pointers to get me started would be welcomed, too)

Tardo commented 6 months ago

Thanks! Sounds like a good idea! I'm just finishing tuning the use of FlowJS. As soon as I have it ready (should be this weekend) I'll get on this.

Tardo commented 5 months ago

I think the best way to approach it is with a command. Something like ares (active resource) and, for example: search -m $(ares -m)

Then enhance TraSH to have lambda functions and be able to do something like: $ACTIVE_MODEL = lambda: ares -m (not final syntax xD) and then be able to use $ACTIVE_MODEL

Tardo commented 4 months ago

I have this ready... I have to see the compatibility with different Odoo versions of the new “url” command.

TraSH already supports functions and logical operations :) Anybody asked for it? Anybody needs it? No! but that's life. fuunc

ivantodorovich commented 4 months ago

That's looking great! I can't wait to give it a try ^^ Thanks ❤️

Tardo commented 3 months ago

finally the syntax is: $$RMOD - Active model $$RID - Active ID