Skip to content

Instantly share code, notes, and snippets.

View ppa-odoo's full-sized avatar
🎯
Focusing

Prashant Panchal ppa-odoo

🎯
Focusing
View GitHub Profile
@ppa-odoo
ppa-odoo / FedexProcessShipmentRequest.py
Created June 13, 2023 07:23
how-to-add-customs-value-in-python-fedex-for-international-shipments: How to add customs value in python-fedex for international shipments?
#REF: https://stackoverflow.com/questions/58949887/how-to-add-customs-value-in-python-fedex-for-international-shipments
"""
This example shows how to create an international shipment and generate a waybill as output.
The example takes outset in a real practical use case, where electronic trade documents are
used and an existing PDF commercial invoice is added along with product descriptions via ETD.
Further, it adds event notifications to allow for emails to be sent to the end recipient.
The script is comprised of a FedExLabelHelper class with all core functions, and a use case
example with minimal dummy data
"""
from example_config import CONFIG_OBJ
#!/usr/bin/env python3
"""Print emails from a given date interval.
Usage:
$ %(prog)s <since_date> <before_date>
since_date < before_date
Date format: DD-Mon-YYYY e.g., 3-Mar-2014
@ppa-odoo
ppa-odoo / smile.py
Created December 5, 2022 12:49
try it and make your day beautiful, and try new one and share with me, I am also trying new, have nice day and enjoy python coding
from turtle import *
import time
color('orange')
begin_fill()
pensize(5)
left(50)
forward(133)
circle(50, 200)
right(140)
circle(50, 200)
@ppa-odoo
ppa-odoo / .gitignore
Created November 4, 2019 12:37
.gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
#!/bin/bash
# backup Location
dir="/home/dell/"
# Name of the backup files
date=`date +%d-%m-%Y`
databases=`psql -l -t | cut -d'|' -f1 | sed -e 's/ //g' -e '/^$/d'`
@ppa-odoo
ppa-odoo / templates_inherit_demo
Last active December 19, 2023 13:06
Odoo: How to inherit <templates> of web module?
REF LINK: https://www.odoo.com/forum/help-1/question/odoo10-how-to-inherit-templates-of-web-module-119140#answer-119142
This is main template:
<template id="template" xml:space="preserve">
<t t-name="DemoExample">
<div class="demo-one">
<p>odoo</p>
</div>
</t>
@ppa-odoo
ppa-odoo / __manifest__
Last active January 30, 2023 06:55
Odoo __manifest__ File
# -*- coding: utf-8 -*-
# Copyright <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Module name",
"summary": "Module summary",
"version": "11.0.1.0.0",
"development_status": "Alpha|Beta|Production/Stable|Mature",
"category": "Uncategorized",
"website": "https://github.com",
@ppa-odoo
ppa-odoo / GeoIP.txt
Last active January 30, 2023 06:56
GeoIP Configuration
sudo add-apt-repository ppa:maxmind/ppa
sudo apt update
sudo apt install libgeoip1 libgeoip-dev geoip-bin
sudo pip3 install GeoIP # For Python 3
sudo apt-get install geoip-database-contrib
==================================================
import GeoIP
geofile = config.get('geoip_database')
gio_data = GeoIP.open(geofile, GeoIP.GEOIP_STANDARD).record_by_addr(ip)
return gio_data
@ppa-odoo
ppa-odoo / jQuery upload image take the base64 code.html
Last active January 30, 2023 06:56
jQuery upload image take the base64 code
<!DOCTYPE html>
<html>
<head>
<metea charset="utf8">
<title></title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.js"></script>
<script type="text/javascript">
function readURL(input) {
if (input.files && input.files[0]) {
https://help.ubuntu.com/community/PostgreSQL
http://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu
Postgres
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo su postgres -c psql