Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="product_details_inherit" inherit_id="website_sale.product">
<xpath expr="." position="inside">
<!-- Google AdSense script -->
<!-- <script async="async" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6346256437579351"-->
<!-- crossorigin="anonymous"></script>-->
<script async="async" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" crossorigin="anonymous"></script>
<!-- responsive_ad -->
def fix_account_bank_statement_line_link_moves(src_cr, dst_cr):
## SET CURRENCY_ID
# "UPDATE account_bank_statement_line AS l
SET_CURRENCY_QUERY = """
UPDATE account_bank_statement_line AS l
SET currency_id =
(CASE
WHEN l.currency_id IS NULL THEN COALESCE(j.currency_id, c.currency_id)
ELSE l.currency_id
version: '3.1'
services:
web:
image: odoo:16.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
To discard local changes on a file, you can do
git checkout yourfile
or, for all files using
git checkout -- .
You can also decide, for each file, if you want to keep your version or the repository version with
git checkout --ours yourfile # Your version
git checkout --theirs yourfile # Repository version
@yk2kus
yk2kus / docker-image-push.txt
Created June 23, 2019 22:11
How to push docker image
Create a repo on https://hub.docker.com
Build an image with docker build . -t username/repo_name:tagName
eg: docker build . -t yk2kus/odoo:odoo120
Push the image
docker push yk2kus/odoo:odoo120
""" Reserve stock moves by creating their stock move lines. A stock move is
considered reserved once the sum of `product_qty` for all its move lines is
equal to its `product_qty`. If it is less, the stock move is considered
partially available.
@yk2kus
yk2kus / .pypirc
Last active March 1, 2019 12:19
~/..pypirc
[distutils]
index-servers =
pypi
[pypi]
repository: https://upload.pypi.org/legacy/
username: yk2kus
password: *********
@yk2kus
yk2kus / postgres-import-export-csv.md
Created February 19, 2019 11:00 — forked from nepsilon/postgres-import-export-csv.md
Importing and Exporting CSV files with PostgreSQL — First published in fullweb.io issue #19

Importing and exporting CSV files with PostgreSQL

Let’s see how to use PostgreSQL to import and export CSV files painlessly with the COPY command.

Import CSV into table t_words:

COPY t_words FROM '/path/to/file.csv' DELIMITER ',' CSV;

You can tell quote char with QUOTE and change delimiter with DELIMITER.

@yk2kus
yk2kus / embedded-file-viewer.md
Created February 16, 2019 09:37 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@yk2kus
yk2kus / python-printJS-in-pdf.py
Created February 13, 2019 16:11 — forked from rms1000watt/python-printJS-in-pdf.py
Python script to add JS to pdf so the pdf will print immediately when opened
# IE users need: https://get.adobe.com/reader/
from PyPDF2 import PdfFileWriter, PdfFileReader
output = PdfFileWriter()
ipdf = PdfFileReader(open('old.pdf', 'rb'))
for i in xrange(ipdf.getNumPages()):
page = ipdf.getPage(i)
output.addPage(page)