Skip to Content

Contributors

Re: Odoo Show

Wow! Great!
Congrats for the great work and thanks for sharing!

Ing. Juan José Scarafía

(+54 9 341) 3 278039

twitter: @jjscarafia

github: @jjscarafia



El mié, 5 oct 2022 a la(s) 05:47, Simon Maillard (notifications@odoo-community.org) escribió:
On 05/10/2022 00:02, David Vidal wrote:


> I have been working for fun on this little tool 


> (https://github.com/chienandalu/odooshow 


> <https://github.com/chienandalu/odooshow>) to facilitate the inspection 


> of the data of a recordset.

Hi,
Tested and adopted, It's awesome.
I used it from pytest to inspect objects, it will for sure save a lot of 
time when debugging or writing tests.

Just to share my happiness:


add to your test method:

```
import ipdb; ipdb.set_trace()
```

from your test server/vm/container/python ide:
```
$ pip3 install odooshow ipdb
$ cd /path/to/my_adddon
$ export PYTEST_ADDOPTS='--pdb --pdbcls=IPython.terminal.debugger:Pdb'
$ pytest -s -vv --odoo-database=tests 
--odoo-config=/var/lib/odoo/tests_odoo.conf --pdb 
tests/test_hr_timesheet_ovetime.py::TestHrOvertime::test_2_overtime_sheet_is_created_on_overtime
```

Let's play with odooshow from ipdb

```
ipdb> from odooshow import show
ipdb> show(self.OvertimePeriod.search([])
...
```

ps: Got an error if the object don't have URL (The same has Quentin 
spoke about).
I made a quick hack for now  but I will submit a clean PR today.


Thank you David for odooshow !

Regards,
Simon




-- 
Simon Maillard
simon@ogesta.fr - 0680587358

Parce que sinon ça rend la discussion incompréhensible.
 > Pourquoi ça ?
 >> Je préfère répondre en dessous.
 >>> Que faites-vous à la place ?
 >>>> Non.
 >>>>> Vous n'aimez pas répondre au-dessus ?

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


by Juan José Scarafía - 11:16 - 5 Oct 2022

Reference

  • Odoo Show
    I have been working for fun on this little tool (https://github.com/chienandalu/odooshow) to facilitate the inspection of the data of a recordset. Any time you're into the Odoo shell either debugging any process or entering the console in a production instance we can import the show method of the library and we will see a table with the default tree fields for that record. Something like this:

    image.png

    Even more, you'll get links to the records urls so you can inspect them directly in the browser! (only in consoles that support console links).

    By adding more attributes we can create more complex views by deciding which fields to show, grouping the records, etc. I'm working on documentation, for the moment you can see the code itself ;)

    You can see a demo here -> https://asciinema.org/a/525597

    image.png

    There's also limited support for OdooRPC, but some special cases need to be covered.

    To render the tables, I'm using the fantastic rich (https://github.com/Textualize/rich) which I can't stop recommending to everyone :)

    I hope you enjoy it! (PRs and issues are welcome :))

    David


    by David Vidal - 12:00 - 5 Oct 2022