Mar 11, 2021

odoo 13 on ubuntu 20 ssl error, [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)

sudo vim /etc/ssl/openssl.cnf

at first line add

openssl_conf = default_conf

#

# OpenSSL example configuration file.

# This is mostly being used for generation of certificate requests.

#


# Note that you can include other files from the main configuration

# file using the .include directive.

#.include filename


at the end of line add 

                                # identifier (optional, default: sha1)

[ default_conf ]


ssl_conf = ssl_sect


[ssl_sect]


system_default = ssl_default_sect


[ssl_default_sect]

MinProtocol = TLSv1.2

CipherString = DEFAULT:@SECLEVEL=0


its to solve the error message [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)

Read more ...

Oct 1, 2019

RDS backup database with template


problems :

ERROR:  source database "targetDB" is being accessed by other users
DETAIL:  There are 6 other sessions using the database.


Solutions


postgres=> REVOKE CONNECT ON DATABASE targetDB FROM public;
REVOKE
postgres=> SELECT pg_terminate_backend(pg_stat_activity.pid)
postgres-> FROM pg_stat_activity
postgres-> WHERE pg_stat_activity.datname = 'targetDB';
 pg_terminate_backend 
----------------------
 t
 t
 t
 t
 t
 t
(6 rows)

postgres=> create database backutargetDB_oct template targetDB owner odoo;
CREATE DATABASE
postgres=> create database eisr template targetDB owner odoo;
CREATE DATABASE
postgres=> GRANT CONNECT ON DATABASE solusi TO public;

GRANT




Read more ...

Sep 9, 2019

SOLVED auth_session_timeout redirection looping issue



Related : https://github.com/OCA/server-tools/issues/1482



@api.model_cr_context
    def _auth_timeout_check(self):
        """Perform session timeout validation and expire if needed."""

        if not http.request:
            return

        session = http.request.session

        # Calculate deadline
        deadline = self._auth_timeout_deadline_calculate()

        # Check if past deadline
        expired = False
        if deadline is not False:
            path = http.root.session_store.get_session_filename(session.sid)
            try:

                expired = getmtime(path) < deadline
            except FileNotFoundError
                _logger.exception(
                        'File nya tidak ada %s, Path : %s',(path, http.request.httprequest.path)
                        )
            except OSError:
                _logger.exception(
                    'Exception reading session file modified time.',
                )
                # Force expire the session. Will be resolved with new session.

                expired = True





Read more ...

Aug 14, 2019

odoo add followers when task change followers


just a simple automation




partners_who_are_users = []
users = env['res.users'].search([])
for user in users:
  partners_who_are_users.append(user.partner_id.id)

followers = []
for partner in record.project_id.message_follower_ids.ids:
  if partner in partners_who_are_users:
    followers.append(partner)



followers.append(record.user_id.partner_id.id)
record.project_id.message_subscribe(followers)


Read more ...

SOLVED odoo 11 Domains no longer working with dynamic dates

regarding to :
https://github.com/odoo/odoo/issues/22956

on V10, we can use :

[["create_date","<",time.strftime('%Y-%m-%d')]]  


this is a simple solution,

update base_automation set filter_pre_domain='[["write_date","<=", datetime.datetime.now().replace(microsecond=0).replace(hour=0).replace(minute=0).replace(second=0).isoformat(" ").partition("+")[0]  ]]', filter_domain='[["write_date","<=", datetime.datetime.now().replace(microsecond=0).replace(hour=0).replace(minute=0).replace(second=0).isoformat(" ").partition("+")[0]  ]]' where id=5;

main idea is change "%" notation from strftime to native, make it pass the "eval" to be compiled.



Read more ...