2022 m. spalio 21 d., penktadienis

Hiding view elements from specific view

 Add context in view:

       <field name="context">{ 'hide_field': 1}

        </field>

Update attribute:

       <xpath expr="//tree//field[@name='location_dest_id']" position="attributes">

                <attribute name="invisible">context.get('hide_field')</attribute>

            </xpath>

2022 m. spalio 18 d., antradienis

Odoo runing tests


Script path: /home/user/src/odoo15/odoo/odoo-bin 

Pycharm config just for testing

-i module_name --log-level=test --test-enable --stop-after-init

Pycham config running project with tests:

-c ../conf/project_name.conf --dev=xml --update extention1,extention2 --test-enable


# This test should only be executed after all modules have been installed. @tagged('-at_install', 'post_install')


2022 m. spalio 13 d., ketvirtadienis

Odoo 14/15 cheetsheet

# restore postgress db 
dropdb lcv && createdb lcv &&  psql lcv < lvc_dump_xml  

# find all odoo runiing processes
ps aux | grep -P [o]doo-bin.*conf

# odoo reports and pdf's reports debug 
cd /usr/local/bin; sudo mv wkhtmltopdf1 wkhtmltopdf

# kill all odoo processes
kill $(ps aux | grep "[o]doo" | awk '{print $2}')
pkill odoo

ps aux | grep python.*[o]doo_conf_file.conf | awk {'print $2'} | xargs kill -9



Resources:

https://gist.github.com/rockavoldy/46350ed3d37662ae9e2cc47ea7fb916a

Connecting to psql remotely dbeaver

The server requested SCRAM-based authentication, but no password was provided.
 Solution: Add progress password

 

$ sudo su - postgres
$ psql

 ALTER USER "postgres" WITH PASSWORD 'password';

 

 

FATAL: no pg_hba.conf entry for host "xx.xx.xx.xxx", user "postgres", database "postgres", SSL on

How to solve this error on dbeaver:

Find out where is your hba file:

$ sudo -u postgres psql 
postgres=# show hba_file;

 /etc/postgresql/13/main/pg_hba.conf

# Add at bottom your eg:  IP  111.111.11.11/21  trust
hostnossl    all          all            0.0.0.0/0  trust


Restarting service:
# /etc/init.d/postgresql restart
# service postgresql restart

Opening port
Firstly check if port is open:
$ namp -p 5432

Opening port to ubuntu 20.04
# nano /etc/postgresql/12/main/postgresql.conf

# Uncomment
Added listen_addresses = '*'

# Restart postgress Service
service postgresql restart