Montag, 15. August 2011

Project Results

For those who don't want to read this stuff, at the end of this post are some vids and pics.

The project results are the following modules:

Tryton Synchronize Module

The module provides synching capabilities in both, in and out direction.
The algorithm behind is quite simple: For each synch the system stores the latest time stamp. This time stamp is used to determine changed records on the remote system. The foreign ids are stored in a translation table where they can be looked up for example when existing records changed.
The fields of the models can be set up to the users needs like default values to reduce network traffic or if the field should be synched at all. The fields also have a match_field flag which is used if it is desired, that the system should try to find records by matching the fields content. All fields with match flag will be compared to determine the appropriate records.
This is useful with standard models like uom or uom.category. With this models maybe the name field is enough to determine the right record, if no matching record found it will be created. So standard records / uom wont be created.

For looking up translations the id of the source record,
the model and the server is used as primary key. This enables using the same translations for multiple synchs with different configurations of the synch-model.
For example the product.category model:
Its in a tree structure realized with a parent field referencing itself.
For synching this model at the first time all fields except the parent field can be pulled. This pulling will create all translations needed for the next synch. Because both synching configurations use the same server and model, the same translations are used and all parent fields are now translatable.

The communication with extern systems are handled through a simple interface which can be implemented quite easy for other systems like other ERP systems or databases. (see synchronize_mysql)

The direction of synchronizing can be changed if the both connection instances are exchanged with each other.

For providing ready to use configurations the existing trytond xml system was not flexible enough to create the needed records. Because of this a simple xml import method was added to the synchronize module. This import method can be used by other modules to provide configurations (see synchronize_product)

Available at:
http://hg.holtzberg.de/synchronize


The Synchronize Product Module
The module provides a ready to use synchronize configuration for synching products.

Available at:
http://hg.holtzberg.de/synchronize_product

The Synchronize MySQL Module
The module provides a sample implementation of the connection interface to synch with a MySQL database.
For each MySQL server record, translations for the tryton fields have to be added. Translation means:
  • Tryton model name to the corresponding SQL statement / table name
  • Tryton field name to SQL field name / SQL
Available at:
http://hg.holtzberg.de/synchronize_mysql


The POS Price Label Module
Provides reports for printing barcode labels from PDF. Products have to be added to Printjobs which can be printed out.

Available at:
http://hg.holtzberg.de/pos_price_label

The POS Cash Module
The module provides simple data structures which should be easy to synch. In this structures are the cashing transactions stored.
The idea is to implement all the logic of the POS-System in a trytond module.
All manipulations are made through RPC methods which a client can easily call without thinking about logic. For this methods some wizards are provided to enable testing on the standard Tryton GTK client.

The module also handles the hardware like printer and customer display with ESC/POS commands. (see ESC/POS module)

Available at:
http://hg.holtzberg.de/pos_cash

The POS Client
For simplicity a separate client was written with the new PySide Qt binding. The client runs full screen and calls the RPC methods mentioned before.
The client can easily be styled with Qt style sheets. This is useful if a small display is used or in other environments.

Available at:
http://hg.holtzberg.de/pos_client

The Python ESC/POS Module
For the communications with the hardware the python-escpos module (http://code.google.com/p/python-escpos/) is used and was extended with some display functionality. Also some not working bar code types have been added to the module.

Available at:
http://hg.holtzberg.de/escpos

Pics and Vids
Setting up the POS
POS in action
Final receipt

Finally
I had fun with working on this project and want to thank my mentor Udo Spallek for supporting me very well. Also thanks to all the others on tryton IRC channel. Also thanks to Google for providing such a cool stipend.

Keine Kommentare:

Kommentar veröffentlichen