This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run not as root | |
# ./install_posbox_in_pc.sh | |
# No LSB modules are available. | |
# Distributor ID: Ubuntu | |
# Description: Ubuntu 18.04.5 LTS | |
# Release: 18.04 | |
# Codename: bionic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run not as root | |
# ./install_posbox_in_pc.sh | |
# No LSB modules are available. | |
# Distributor ID: Ubuntu | |
# Description: Ubuntu 18.04.3 LTS | |
# Release: 18.04 | |
# Codename: bionic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
from odoo import tools | |
@api.model | |
def _default_image(self): | |
image_path = get_module_resource('hr', 'static/src/img', 'default_image.png') | |
return tools.image_resize_image_big(base64.b64encode(open(image_path, 'rb').read())) | |
image = fields.Binary( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from odoo.tools import misc | |
@api.model | |
def _get_default_faq(self): | |
with misc.file_open('website_forum/data/forum_default_faq.html', 'r') as f: | |
return f.read() | |
faq = fields.Html('Guidelines', default=_get_default_faq, translate=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from odoo.modules.module import get_module_resource | |
. | |
. | |
. | |
def pdf_file(self): | |
path_pdf = get_module_resource('module', 'files', 'file.pdf') | |
print(path_pdf) | |
# Out | |
# /home/user/addons/bo_btn_download_file/files/file.pdf | |
return open(path_pdf, 'rb').read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Odoo 10 Open Source ERP and CRM (Test Env) | |
Requires=postgresql.service | |
After=network.target postgresql.service | |
[Service] | |
Type=simple | |
PermissionsStartOnly=true | |
SyslogIdentifier=odev10-server | |
User=odev10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run this as the odoo* user! | |
# create dir logs | |
WDIR=/opt/odev10/log | |
# path virtualenv | |
VIRTUALENV_DIR=/opt/odev10/virt_odev10 | |
source $VIRTUALENV_DIR/bin/activate |