Skip to content

Instantly share code, notes, and snippets.

View hari4274's full-sized avatar
🏠
Working from home

Hariprasath hari4274

🏠
Working from home
View GitHub Profile
@hari4274
hari4274 / odoo_db_backup.sh
Last active March 29, 2019 15:16
ODOO Database and File store Backup Script using pgdump
#bin/bash
DBNAME='odoo10_sample'
DATETIME=$(date +"%Y%m%d%H%M%S")
DBFILENAME=${DBNAME}_${DATETIME}
HOMEDIR=`echo $HOME`
MANAGEDIR='/tmp' # Here i am using tmp folder for test
BACKUPDIR=$MANAGEDIR'/DBBACKUP'
FILESTORE_PATH=$HOMEDIR'/.local/share/Odoo/filestore/'
@hari4274
hari4274 / groupby_sum_fields_in_python_default _and_pandas_ittertools.py
Last active May 25, 2020 13:36
Groupby and sum columns in python(default functionalities, Pandas and ittertools)
# -*- coding: utf-8 -*-
# Default Method
# Get Unique product details => group by reapit_product_id and sum by quantity
grpby_key = 'product_id'
sum_key = 'qty'
data = [
{'product_id': 1, 'desc': 'Desc1', 'qty': 2, 'unit_price': 2, 'total': 4},
@hari4274
hari4274 / ir_http.py
Created November 24, 2019 18:32
To enable session_id in session/authenticate JSON-RPC call in odoo13 and above
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
from odoo.http import request
class Http(models.AbstractModel):
_inherit = 'ir.http'