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
image: docker:19.03 | |
variables: | |
REPOSITORY_URL: <AWS_ACCOUNT_ID>.dkr.ecr.<REGION_NAME>.amazonaws.com/<ECR_REPOSITORY_NAME> | |
REGION: <REGION_NAME> | |
TASK_DEFINITION_NAME: <TASK_DEFINITION_NAME> | |
CLUSTER_NAME: <CLUSTER_NAME> | |
SERVICE_NAME: <SERVICE_NAME> | |
CPU: <CPU> | |
MEMORY: <MEMORY> |
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
Widget: | |
Widget is different or alternate representation to display a screen, fields and attributes in odoo. | |
Widget allows to change view using different rendering templates and also allows to design as you want. | |
Example: | |
widget_name.js |
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
-- turn off paging (less/more) | |
psql> \pset pager off | |
/* | |
Pager usage is off. | |
*/ | |
-- find an object name by id | |
SELECT OID, relname |
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
image: docker:latest | |
variables: | |
REPOSITORY_URL: xxx.dkr.ecr.us-west-2.amazonaws.com/xxx | |
REGION: us-west-2 | |
TASK_DEFINTION_NAME: xxx | |
CLUSTER_NAME: xxx | |
SERVICE_NAME: xxx | |
services: |
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
version: '3' | |
services: | |
db: | |
image: postgres:13 | |
volumes: | |
- db-data:/var/lib/postgresql/data/pgdata | |
ports: | |
- 5432:5432/tcp | |
environment: | |
- POSTGRES_PASSWORD=odoo |
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 | |
# Install docker | |
apt-get update | |
apt-get install -y cloud-utils apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
apt-get update |
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
# Installing Odoo on AWS | |
These are the steps I ran to get Odoo up and running on AWS using the free tiers (for now). | |
## Setup servers | |
### Create DB | |
Create an Postgres DB on Amazon RDS: | |
https://us-east-2.console.aws.amazon.com/rds/home?region=us-east-2#launch-dbinstance:ct=dbinstances: | |
### Create Server |
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
# -*- coding: utf-8 -*- | |
from odoo import http | |
from odoo.http import request | |
from odoo.addons.web.controllers.main import serialize_exception,content_disposition | |
import base64 | |
class Binary(http.Controller): | |
@http.route('/web/binary/download_document', type='http', auth="public") |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.