Skip to content

Instantly share code, notes, and snippets.

@em230418
em230418 / gist:80d28cbb141ad47414813af8b99a46fc
Last active July 11, 2019 08:39
Собрать все requirements.txt из vendor
cat `find vendor -name "requirements.txt" | grep -v odoo/cc` /dev/null
@em230418
em230418 / 1204.sh
Created July 19, 2019 07:05
Убрать # -*- coding: utf-8 -*- во всех файлах из текущего каталога
#!/usr/bin/env bash
sed -i '/#\ -\*-\ coding: utf-8\ -\*-/d' `grep -rn . -e "coding: utf-8" -l`
@em230418
em230418 / test.py
Last active September 10, 2019 06:04
Что выводить для развертки и тестирования
#!/usr/bin/env python3
from os.path import join, abspath
import sys
sys.path.append("/home/noroot/maintainer-quality-tools/travis")
DBNAME = "a697"
VENDOR_DIR = "vendor"
ADDONS_PATH_TO_TEST = join(VENDOR_DIR, "it-projects-llc/pos-addons")
@em230418
em230418 / merge.sh
Last active November 19, 2019 08:01
Как правильно сливать
#!/usr/bin/env bash
# git checkout 11.0
# git merge --no-ff 10.0
git reset *.pot
git checkout --ours *.pot
git checkout --ours .travis.yml
# взгляни на *.po файлы. Там недолжно быть всякой фигни
rm `git ls-files --others --exclude-standard | grep ".pot" | paste -sd " " -`
@em230418
em230418 / upgrade_8_to_12.sh
Created October 2, 2019 07:09
Скрипт для миграции odoo 8 на odoo 12 (недоработанный)
#!/usr/bin/env bash
TMP_DIR=/home/noroot/tmp
OULIB_PATH=/home/noroot/Projects/c8/openupgradelib
OU9_PATH=/home/noroot/Projects/c8/ou9
OU10_PATH=/home/noroot/Projects/c8/ou10
OU11_PATH=/home/noroot/Projects/c8/ou11
OU12_PATH=/home/noroot/Projects/c8/ou12
#!/bin/bash
# ORGANIZATION GITHUB URL
ORG=it-projects-llc
UPSTREAM_URL_GIT=https://github.com/$ORG
# DEVELOPER INFO
USERNAME=em230418
# WHERE TO CLONE
@em230418
em230418 / 1.sh
Last active October 24, 2019 11:43
# пишет, какие файлы поменялись по сравнению с веткой 11.0
git diff --name-only 11.0 | grep -v ".po" | grep "/" | sed 's/\/.*//' | sort -u
# можно еще так, чтобы сразу test_*.py
git diff --name-only 11.0 | grep -v ".po" | grep "/" | sed 's/\/.*//' | sort -u | sed 's/.*/"\0",/'
#!/usr/bin/env python3
from pprint import pprint
from time import sleep
import xml.etree.ElementTree as ET
def write_header(f):
f.write('''<?xml version="1.0" encoding="UTF-8"?>
<odoo>
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
engrus_name = fields.Char(compute="_compute_translated_names")
vi_name = fields.Char(compute="_compute_translated_names")
en_name = fields.Char(compute="_compute_translated_names")
ru_name = fields.Char(compute="_compute_translated_names")
diff --git a/addons/web/static/src/views/helpers/sample_server.js b/addons/web/static/src/views/helpers/sample_server.js
index 63b090149c1..41ee14b88af 100644
--- a/addons/web/static/src/views/helpers/sample_server.js
+++ b/addons/web/static/src/views/helpers/sample_server.js
@@ -309,7 +309,7 @@ export class SampleServer {
*/
_getRandomDate(format) {
const delta = Math.floor((Math.random() - Math.random()) * SampleServer.DATE_DELTA);
- return luxon.DateTime.local().plus({ hours: delta }).toFormat(format);
+ return luxon.DateTime.local().plus({ hours: delta }).toFormat(format, {numberingSystem: 'latn'});