Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
from dash import Dash, dash_table, dcc, html
import plotly.express as px
countries = [
{
'name': 'Egypt',
'imf_economy_classification': {
@kerbrose
kerbrose / first_try.yaml
Created December 6, 2024 22:45
ast-grep rules
id: match-specific-function
language: python
rule:
kind: function_definition
regex: def action_confirm
inside:
kind: block
has:
regex: sale.order
$path = "file_list.csv"
$csv = Import-Csv -Delimiter "," -path $path
foreach($line in $csv)
{
$filenewname = ($line.name + "." + $line.format)
Write-Host $filenewname
rename-item -path $line.path -NewName $filenewname
}
#!/bin/bash
xml_split -v -l 1 ./ir_model_fields_3.xml
for name in $(ls | egrep -i 'ir_model_fields_3-*'); do
sed -i -e '2i<odoo>\' $name
sed -i -e '$a</odoo>\' $name
done
to install correct version of wkhtmltopdf for odoo
https://github.com/wkhtmltopdf/packaging/issues/114#issuecomment-1118762067
https://github.com/wkhtmltopdf/packaging/files/8632951/wkhtmltox_0.12.5-1.jammy_amd64.zip
https://github.com/wkhtmltopdf/packaging/files/8632973/wkhtmltox_0.12.1.4-1.jammy_amd64.zip
@kerbrose
kerbrose / gissah-ksa.code-workspace
Last active September 8, 2024 06:21
vscode useful setting.json
{
"folders": [
{
"path": ".."
},
{
"path": "../../odoo_16"
},
{
"path": "../../enterprise_16"
@kerbrose
kerbrose / odoo_recompute.py
Created November 15, 2021 12:05
odoo recompute fields & commit
model = env['sale.order']
env.add_to_compute(model._fields['amount_total'], model.search([]))
model.recompute()
self.env.cr.commit()
find . -name "*.pyc" -exec rm -f {} \;
git ls-files --deleted | xargs git add
sudo apt update && sudo apt upgrade -y
sudo apt-get install adduser apt-transport-https build-essential ca-certificates calibre curl \
fonts-font-awesome fonts-inconsolata fonts-roboto-unhinted git gnupg-agent \
gsfonts init-system-helpers jing libbz2-dev libffi-dev libjpeg-dev libjs-underscore \
libldap2-dev liblzma-dev libncursesw5-dev libpq-dev libreadline-dev libsasl2-dev \
libsqlite3-dev libssl-dev libxml2-dev libxmlsec1-dev libxslt1-dev llvm lsb-base make \
postgresql postgresql-client python3-dev software-properties-common tk-dev wget xfonts-75dpi \
xz-utils zlib1g-dev
@kerbrose
kerbrose / odoo_dev.sql
Last active November 13, 2024 14:57
useful psql commands
# used to delete a view that contains a removed field
delete from ir_ui_view where position('FIELD_NAME' in arch_db)>0;
# in odoo 16 ir_ui_view becomes a jsonb
delete from ir_ui_view where arch_db->>'en_US' ilike '%FIELD_NAME%' ;
update ir_ui_view set active = FALSE where position('FIELD_NAME' in arch_db)>0;