An Odoo 10 module which generates BAN-PT accreditation reports for STEI ITB from existing data.
An Odoo 10 add-on module which generates BAN-PT accreditation reports for STEI ITB from existing data on Odoo.
src/itb_academic
dan src/itb_hr
mengandung kode yang diberikan oleh product owner
, sehingga seharusnya tidak diperhitungkan dalam pengukuran jumlah baris kode. Kedua direktori tersebut di-commit sementara untuk mempermudah automated testing dan konfigurasi CI.Prerequisites: Docker Engine and Docker Compose must be installed; Internet access for pulling dependencies and Docker images (note: proxy might cause problems).
Note: Docker commands might need root privileges/sudo. If this happens, you probably need to add your user to the docker
group.
docker-compose up
to start the application and its supporting services (PostgreSQL). Docker will download images if necessary. Wait until all tests are done.admin
as the username and password.docker-compose stop
.docker-compose up
or docker-compose up -d
to run in the background (if you don’t need to recreate containers, you can also use docker-compose start
).docker ps
to see list of running containers.docker exec -it <container_name> /bin/sh
or docker-compose exec -it <service_name> /bin/sh
to get a shell on a running container.docker-compose down
. To remove the containers and reset all data volumes (persistent data) too, run docker-compose down -v
.Note: these steps are not needed if using the Docker development container.
Settings
page by clicking the menu in the top menu bar. Go to Users
page by clicking the menu in the left sidebar. Add new users as needed. Don’t forget to give access rights to the users (for this module, tick BAN-PT Report Generator / Manager
for full access or BAN-PT Report Generator / Viewer
for read only access to the reports).code_generator
: Python script for generating views and other data files from models.config
: Odoo config for development.src
: source for addon modules.src/banpt_report_generator/models
: model files - define data schema and queries.src/banpt_report_generator/security
: security (groups, access rights) configuration.src/banpt_report_generator/views
: define Odoo views - how to display the data.master
branch (git checkout master
). Create a new branch (git checkout -b <BRANCH_NAME>
). Branch name for a table must be equal to the table code in lower case and with -
replaced with _
and .
removed (e.g. 3a_311
).src/banpt_report_generator/models
directory.cd code_generator
, then python code_generator.py
. Don’t forget to return to the main directory using cd ..
.Ctrl+c
any running Docker Compose processes, then docker-compose up
again).pylint src/banpt_report_generator
(requires pylint
to be installed, see Linting section below). Fix all errors or warnings.docker-compose -f docker-compose.test.yml up --abort-on-container-exit
, ensure there are no ERROR
lines. Fix all errors.git add --all
), commit (git commit -m <COMMIT_MESSAGE>
, and push changes to Git (git push -u origin <BRANCH_NAME>
), then make a new pull request to master
on Github.Restart the Docker containers if they are running (Ctrl+c
any running Docker Compose processes, then docker-compose up
again). The banpt_report_generator
module will be upgraded automatically.
Prerequisite: pylint.
To lint, run ./lint.sh
.
If there are any errors or warning, fix the source code before committing.
Place your tests in the src/banpt_report_generator/tests
directory, then import it in src/banpt_report_generator/tests/__init__.py
.
To run tests, run docker-compose -f docker-compose.test.yml up --abort-on-container-exit
. Check if there are any ERROR
when the test finishes.
For convenience, to see only relevant test output, use docker-compose -f docker-compose.test.yml up --abort-on-container-exit | grep banpt_report_generator
.
For automated testing, to return with a non-zero exit code on test failure, use docker-compose -f docker-compose.test.yml up --abort-on-container-exit | grep FAIL; test $? -eq 1
.
Automatically create views, imports, manifest, and model access files from model files.
To run, cd code_generator
, then python code_generator.py
.
Check changes first by running a Git diff before committing.
A pgAdmin 4 container is provided on port 5050. Use odoo
as the username and password.
After login, add new server. Use postgres
as the hostname, odoo
as the user and password.
Note: to use the pgAdmin instance for backup or restore, add /usr/bin
as the PostgreSQL binary path in the Preferences
menu in pgAdmin. Exported files are in the /var/lib/pgadmin/storage/odoo
directory in the pgadmin
container by default. Use docker cp <PGADMIN_CONTAINER_NAME>:/var/lib/pgadmin/storage/odoo/<FILE_NAME> <DESTINATION_FILE_NAME>
to copy exported files from the container to the host.
docker-compose up
).Tables | Column |
---|---|
hr_employee | nik |
itb_hr_assignment | standard_id |
itb_hr_award | standard_id |
itb_hr_duty_employee | standard_id |
itb_hr_duty_employee | research_group_id |
itb_hr_project | standard_id |
itb_hr_publication | standard_id |
itb_hr_training | standard_id |
docker ps
(should be like banptreports_postgres_1
).docker exec -i <POSTGRESQL_CONTAINER_NAME> createdb -U odoo <DESTINATION_DB>
.docker exec -i <POSTGRESQL_CONTAINER_NAME> psql -U odoo -v ON_ERROR_STOP=1 <DESTINATION_DB> < <FILE_TO_IMPORT_FROM_HOST>
.docker-compose down -v && docker-compose up
).prodi
field of hr.employee
modelgelar
field in itb.hr_education
modelitb_academic_program
sks_mk_dalam_kurikulum_inti
field in itb.academic_catalog
modelsks_mk_dalam_kurikulum_institusional
field in itb.academic_catalog
modelbobot_tugas
field in itb.academic_catalog
modelkelengkapan_sap
field in itb.academic_catalog
modelbobot_tugas
field in itb.academic_catalog
model