This is the scale service for La Chouette COOP.
You will need :
- docker
 - docker-compose
 
It could make your life better:
- Pycharm (Python IDE)
 - Insomnia (test API)
 
docker-compose buildThis service needs a configuration file.
odoo:
  url: https://sas.lachouettecoop.fr  # odoo URL
  db: dbsas                           # database used by odoo
  user: ...                           # username
  passwd: ...                         # password
  categories:
    fruits:                           # categories to show in UI
      - 337                           # list of corresponding cqteg_id
    legumes:
      - 418
  unp:                                # Unnecessary name parts (remove from product name in UI)
    - vrac
    - au kg
    - 1 kg
printer:                              # Printer IP
  ip: 192.168.70.106
scale:
  ip: 192.168.70.118:1240             # Scale IP
core:                                 # All options for development
  allow_all_origins: true
  cors_allowed_origins: "*"
  mock_printer: true
  mock_scale: trueThen run
docker-compose up -dAPI will be accessible to http://localhost:5000/
curl http://localhost:5000/pingIt shall respond {"name":"balance-coop","status":"ok"}
poetry install
poetry run python main.pyWe use a Bizerba scale. This product can stream its screen on the port 1240. We use this stream to get weight and tare. This option shall be activated on the device (5->3->8->3->2->6).
We use an Epson TM T88v-i. It's a network printer.
