The Tryton Framework

As I was working on implementing the Maestro project in OpenERP v7, I came across a fundamental problem (for me) with product serialization. The out-of-box experience in OpenERP for managing serialized goods does not provide a consistent flow for receipt of serializing goods from a vendor or internal production, to the issue of serialized goods to a customer, and then the return serialized goods from the customer if necessary. It’s not that OpenERP isn’t technically capable, but the required software development is beyond the scope of the Maestro project.

However, the solution may lie in a close cousin to OpenERP – the Tryton framework. From tryton.org,

(Tryton) Is a three-tiers high-level general purpose application platform under the license GPL-3 written in Python and using PostgreSQL as database engine.

It is the core base of a complete business solution providing modularity, scalability and security.

The Tryton framework was created by forking OpenERP v4.1 (when it was called TinyERP). The fork included both the server daemon and the desktop client. While OpenERP is concerned with being a superior ERP-like application, Tryton strives to be a superior framework for building ERP-like applications. The desktop client can be used by end-users, and is certainly up to the task, but some situations may find a simplified user interface more suitable (possibly web-type), tailored specifically to the end-user’s needs.

The Tryton framework and desktop client are licensed under the GPL v3. Although the GPL may not be considered as business-friendly as the BSD, MIT or Apache-style permissive licenses, it is far friendlier than the AGPL – which is the license used by OpenERP after v4.1.

I’ve collected my my notes on Tryton in the Maestro project repo.

Serialized workflow in OpenERP

I apologize if you are hoping for all the answers, but maybe you’ll find one or two. I’m just a guy trying to model enterprise workflows using OpenERP. If you’re feeling generous, please share your thoughts, or maybe download the SCC database, get something working and share how.

I envision a whole library of worked examples for newb like me, showing how various workflows can be implemented in OpenERP, a set of worked “happy paths,” or an “OpenERP Workflow Recipes for Dummies” if you will. I’ve started a project on GitHub with the source PLM data (csv files containing hierarchical product structure with suppliers), where the recipes and related data could also be hosted. Does something like this already exist, maybe on LaunchPad?

The SCC database was created using a BitNami OpenERP v7 virtual machine, with the following apps installed:

  • Remove openerp.com bindings
  • Sales Management
  • CRM
  • MRP
  • Project Management
  • Issue Tracker
  • Base Import
  • Document Management System (install wizard reports config will be based on installed modules)

Business Model

The Swift Construction Company (SCC) manufactures a radio receiver called an  Aircraft Wireless.  The SCC buys an assembled electronics circuit board (Part Number 20000003) in lots of 10 from Trilogy-Net.  The circuit boards are used to manufacture Aircraft Wireless units (PN 10000003). When circuit boards from Trilogy-Net arrive at the SCC, they are inspected and, if acceptable, identified with a serial number and stored on a shelf. One of the SCC’s customers is B&E Submarines, who some time ago purchased an Aircraft Wireless system from the SCC to evaluate.

The products (part numbers), customer (B&E) and supplier (Trilogy-Net) have been created. Two BoMs have been created, one for the finished Aircraft Wireless product (PN 10000003) and one for a spare parts kit (PN 60000001), which includes the electronics circuit board (PN 20000003).

Scenario 1

Explore serial numbers in the context of a customer purchase. B&E Submarines desires to purchase a spare parts kit for the Aircraft Wireless unit they previously purchased. A serialized circuit board is used in the assembly of the spare parts kit (preferably a phantom-type BoM to make the parts in it visible), which is then sold and delivered to B&E.

Sometime later, Ed Bentley calls from B&E. He says he found a circuit board, but he doesn’t know if it’s the circuit board from the spares kit. He’s not sure but he thinks the original board might have failed, and he swapped it with the one from the spare parts kit. Ed wants to know if the serial number on the board is the same as the board shipped in the spare parts kit he bought.

Scenario 2

Explore serial numbers in the context of a project. B&E Submarines plans to upgrade 5 of their submarines with Aircraft Wireless systems. A contract is negotiated between the SCC and B&E, and the SCC initiates a Project to capture all related activity (of which the physical receiver units are only one portion). Complete radio receivers PN 10000003 are manufactured, each with its own serial number – traceable to the serialized electronics circuit board inside. The completed radio receivers are sold and delivered to B&E as part of the overall project.

Sometime later, Ed Bentley calls from B&E. He has a circuit board in his hand again, and wants to know where the serial number came from. Ed asks if the circuit board was from one of the 5 receivers delivered as part of the upgrade project.

Download SCC Database

Download current SCC OpenERP Database

 

Maestro has been re-scoped

The Maestro project has been re-scoped as a data set for demonstrating and testing ERP and ERP-like applications. The current implementation target for Maestro is OpenERP, and development of a Maestro standalone application based on the Yii PHP framework has been temporarily suspended.

This decision was based on the amount of work still needed to achieve a minimum viable feature set developing from scratch, and  the opportunities that become possible by building on OpenERP. I want to sincerely thank Maestro contributors Serge and Mark for their excellent work, and for helping me better understand the challenges of developing a Maestro application from scratch.

When I come up for air, I’ll post more on my experiences sp far with OpenERP, but I can tell you now I’m excited!

Installing OpenERP 7.0 using BitNami OpenERP 7.0 Stack

Fred Blauer recommended I take a look at OpenERP based on my described use case of PLM, Manufacturing, and Inventory Management.

I have been casually following OpenERP since v4.x (it was called TinyERP then), but had never configured a server – primarily because OpenERP used separate server and client, and I wanted a pure server system. However, I was pleasantly surprised when I took a look at the current OpenERP 7.0. OpenERP is now a pure web application, and BitNami has a free OpenERP Stack, including an Ubuntu-based virtual machine (in VMware format but also supported by VirtualBox). I’ll get the vm running first on my Win7 laptop with VirtualBox, and describe my experiences using OpenERP in a future post.

Create server

  • Download BitNami OpenERP Stack virtual machine (vm) to a Windows machine on my local network.
  • Using VirtualBox, create a new vm with characteristics: Linux/Ubuntu 64b OS with 1.5GB RAM, but do not configure a boot drive. I originally tried the suggested 512MB RAM, but the system was thrashing (as seen by memory use in ‘top’), with very poor performance.
  • Extract the files from the downloaded vm zip file into the directory VirtualBox created for the new vm.
  • Configure the new vm using VirtualBox Manager.
    • Network: Bridged (to have access from other machines in my network).
    • Storage: bitnami-openerp-7.0-3-ubuntu-12.04.vmdk (included in the BitNami vm download and copied to the vm directory).
  • Boot the new vm.

After booting, the console will display the server IP address and other helpful information (the IP address shown will likely differ in your environment):

*** Welcome to the BitNami OpenERP Stack ***
*** Built using Ubuntu 12.04 - Kernel 3.2.0-31-virtual (tty1). ***
*** You can access the application at 192.168.10.124 ***
*** The default username and password is 'user' and 'bitnami'. ***
*** Please refer to http://wiki.bitnami.com/Virtual_Machines for details. ***

******************************************************************************
*  To access the console, please use user 'bitnami' and password 'bitnami'.  *
*                                                                            *
*                                 WARNING                                    *
*  For security reasons, upon your first login, you will be prompted to      *
*  change the default password.                                              *
******************************************************************************

linux login:

If you copied the system drive for the vm from one host computer to another, the vm may report “The machine could not configure the network interface” after booting. This will occur if VIrtualBox provides a different Ethernet MAC ID on the second computer than on the first, and Ubunto creates a new Ethernet interface for a new interface MAC ID but is still configured for the interface on the first computer. Got it? “ifconfig -a” shows the Ethernet devices identified during boot, and “dmesg | grep eth” will show the network interface renaming. In this case, edit /etc/network/interfaces to specify the appropriate network interface (e.g. eth1 instead of eth0). See: http://www.howtogeek.com/168143/fixing-failed-to-bring-up-eth0-in-ubuntu-virtual-machine/ and http://gist.github.com/percursoaleatorio/6881040.

Login to the VirtualBox terminal using the provided username/password (bitnami/bitnami), and set a new password when prompted e.g. appleton (i.e. bitnami/appleton).

Enable ssh login

  • Configure sshd for remote login and scp file transfer.
$ sudo cp /etc/init/ssh.conf.back /etc/init/ssh.conf
$ sudo start ssh

PostgreSQL

My initial goal was to use pgadmin3 for viewing and managing PostgreSQL databases on the vm from my laptop.

  • Edit postgresql.conf so PostgreSQL will listen on all IP addresses.
$ sudo vi /opt/bitnami/postgresql/data/postgresql.conf
...
listen_addresses = '*'                  # what IP address(es) to listen on;
...
  • Restart PostgreSQL. I tried using pg_ctl but it wouldn’t initially run because of missing libraries. I solved this by adding the BitNami common libraries and the PostgreSQL libraries to LD_LIBRARY_PATH in ~/.bashrc (and logged out and back in again).
$ vi ~/.bashrc
...
# for BitNami Stack PostgreSQL
LD_LIBRARY_PATH=/opt/bitnami/postgresql/lib:/opt/bitnami/common/lib
export LD_LIBRARY_PATH
...

However, this just led to other problems – the user to run pg_ctl as, whether the unset environment variable PGDATA is an issue, etc. I’m sure this isn’t how BitNami intends this to work (fwiw, /opt/bitnami/ctlscript.sh seems to be the intended control point for everything), but

Finally I just rebooted the vm, but pgadmin3 still wouldn’t connect. Perhaps it’s a firewall problem…

However, the PostgreSQL psql cli utility can be used (the password for the bitnami_openerp database is ‘bitnami’):

bitnami@linux:~$ psql bitnami_openerp
Password:
psql.bin (9.2.4)
Type "help" for help.

bitnami_openerp=# help
You are using psql, the command-line interface to PostgreSQL.
Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit
bitnami_openerp=#

For more information on psql, see the PostgreSQL psql documentation.

Configure OpenERP

The BitNami OpenERP stack vm includes a database called bitnami_openerp (Administrator username/password: user/bitnami). I’m going to create a new database from scratch and install the basic modules needed to support Maestro workflows.

Access the vm from a workstation browser. The IP address for the vm is shown in the vm terminal window after booting (or after logging out).

  • Create a new database (company). The PostgreSQL master (super-administrator) password is “bitnami”, and I’ll use “appleton” for the new database password. OpenERP will create a new database with an administrative user (username/password: admin/appleton) and a demo user (username/password: demo/demo), and will login to the database as the administrator.

You will likely see a “timezone mismatch” warning in the top bar of the window. This is because the timezone set in your user preferences (which was configured by BitNami when they created the OpenERP stack) is different from the timezone your browser believes you are in (which comes from your workstation). You can access your user preferences by clicking the drop-down menu beside your username in the top bar of the window.

Install the following OpenERP applications using the Modules > Apps menu:

        • MRP (Manufacturing Orders, Bill of Materials, Routing)
        • Project Management (Projects, Tasks)
        • Issue Tracker (Support, Bug Tracker, Helpdesk)
        • Warehouse Management (Inventory, Logistic, Storage)

You will be prompted for your OpenERP user id and password (free to register) to start, and for any required configurations as each application is installed. Applications often have dependency applications, which will be automatically installed.

If you want to experiment with pre-defined demo data, select Manage Databases in the login screen and create a new database selecting “Install Demo Data”. The new database will be configured with a basic set of applications and demo data.

Still to do

Now that I’ve got OpenERP installed, the top items on my To Do list are:

  • Learn how OpenERP works! Create a couple users, import Maestro bills of materials, manufacture some serialized items using un-controlled, batch controlled and serialized raw material, etc.
  • Learn more about host OpenERP and Python web applications in general using WSGI by examining the BitNami OpenERP Stack (/opt/bitnami/apache2/conf/httpd.conf includes a WSGI reference).
  • Install OpenERP on FreeBSD. As of 2014-03-20, there is a binary package available for OpenERP 7.0, but it will still take time to understand how to make it usable.

Related information

For more information on OpenERP, a great reference is the OpenERP Book.

 

Updated since first posting 2013-07-22.

Northwind on MySQL

The Northwind sample database provided with Microsoft Access is an excellent tutorial schema for managing small business customers, orders, inventory, purchasing, suppliers, shipping, and employees. My problem was that I wanted to experiment with it using MySQL and the Yii Framework.

I found a number of MySQL ports of Northwind on the internet, but none with all 20 tables in the current version, or that included foreign key constraints. The only solution was to make my own.

I’ve put the results on GitHub should anyone else be in similar need: http://github.com/dalers/northwind

 

Fish Creek Provincial Park Videography

Following up on my New Years Day 2014 Bicycling Ride post, my friend Ian reported he was able to find my winter biking video on YouTube directly by searching for “fish creek park calgary”, and then filtering for the most recent upload (at the time, it was at the bottom of the first page – with 14 views!).

Trying the search myself, I was amazed at the variety of fish creek videography being produced – and how many local videographers there are!

Here’s an “Ice Cave” exploration, reminiscent of Gerry Anderson’s Supermarionation.

 

Watch these snow boats fly east along a frozen Fish Creek towards the Ranch. Amazing that a propeller works in snow!

 

I don’t think I’ve ever encountered an RC plane flying in FCPP before.

 

This last one seems inspired by Wayne’s World and Home Improvement.

New Year’s Day 2014 Bicycle Ride

I’ve gone for a bike ride on New Year’s Day for about 5 years now, and this year was no different – except this time I’ve got video to show, my first YouTube video!

Video in 720p format was captured by a Contour Roam2, a really nice HD-quality video Action Camera. Editing and rendering was done using Microsoft’s free Movie Maker 2012, a very satisfactory experience. The transitions and most of the titles were added automatically using a Smart Theme, and the Add music button conveniently linked to free content (legally free!). The edited project was rendered and uploaded to YouTube using the Movie Maker YouTube plugin. After uploading, YouTube suggested video stabilization – which I agreed to.

FWIW, Contour has an interesting back story. They unfortunately closed doors August 2013, and remind me a lot of IVL Technologies, a similar sized tech company I had the pleasure of working  for 1993 to 1997. BloombergBusinessWeek had an interesting post mortem article on Contour , with a few tips for all tech entrepreneurs.

Column Types in Yii Migrations

I can never remember the abstract column types Yii supports, and never seem to get the right search string for google, but I’ll remember my own blog post.

Yii Database Abstract Column Types

Physical types are given in brackets using MySQL syntax.

  • pk: auto-incremental primary key type (“int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY”).
  • string: string type (“varchar(255)”).
  • text: a long string type (“text”).
  • integer: integer type (“int(11)”).
  • boolean: boolean type (“tinyint(1)”).
  • float: float number type (“float”).
  • decimal: decimal number type (“decimal”).
  • datetime: datetime type (“datetime”).
  • timestamp: timestamp type (“timestamp”).
  • time: time type (“time”).
  • date: date type (“date”).
  • binary: binary data type (“blob”).

If the abstract type contains two or more parts separated by spaces (e.g. “string NOT NULL”), then only the first part will be converted, and the rest of the parts will be appended to the conversion result. For example, ‘string NOT NULL’ is converted to ‘varchar(255) NOT NULL’.

I have shamelessly plagiarized this list from the Yii manual. Also see the Yii manual’s excellent article on migrations, and queirozf.com has a nice list of tips.

 

Calgary Tech Groups

I wrote up a list of tech groups I’m following for a colleague and thought it might be worth sharing.

The local ‘nix groups are CUUG (Calgary Unix Users Group, www.cuug.ab.ca) and Calgary LUG (Linux Users Group, http://clug.ca/). CUUG tends to focus more on server-side topics such as networking and security, whereas CLUG (at least from meeting topics and mailing list conversation) tends to focus more on distros, desktop apps and device interconnectivity.

CAMUG (Calgary Agile Method’s Users Group, www.calgaryagile.com). They cover a broad spectrum of software topics in their meetings and workshops, with a small-a-agile hook (e.g. developing software in an agile way using Git and GitHub, developing software in an agile way using Ruby…). CAMUG can draw 50-100 people for a popular topic, and their session last night on Appsec with Jim Bird was great!

The ASQ (American Society of Quality). The Calgary chapter (http://www.asqcalgary.org/ee/) seems mostly interested in manufacturing quality systems (i.e. enterprise stuff) and meets at night monthly in the NE. The topics have been hit and miss for my interests, but they’ve had excellent topics/speakers when I’ve attended.

The SQDG (Software Quality Discussion Group, http://www.sqdg.ca/) meets monthly downtown during lunch, and focuses on software testing practices. They’ve had some good topics, but I haven’t been to a session in over a year now. Again, the topics are hit and miss for my interests but the ones I’ve attended have been excellent with good networking opportunities.

Calgary Protospace (http://protospace.ca/) seem most interested in low-level hardware and firmware hacking, but the system drive failed in a NAS array a few years ago and all the family photos were temporarily unavailable (my wife said I lost them). A unix networking specialist I met through protospace helped me reconstruct the array and save my marriage.

Mobile Mondays (https://twitter.com/momoyyc) host a mobile-related hackathon the first Monday night of every month.

Startup Calgary (http://startupcalgary.ca/) is a government/industry coalition I like to follow not only for their own events, but also because they aggregate what everyone else is doing into a nice regular email they send me.

Calgary democamp (http://democampcalgary.com/) organize DemoCamps periodically for tech entrepreneurs to demo shiny new apps that will change the world <wink>. I’ve only been to one, but it was a packed house and very interesting set of presentations.

There are also a number of Calgary-area tech MeetUp groups, such as the Calgary WordPress MeetUp Group, the Calgary PHP AND NOT PHP Meetup Group, Pixels and Pints, PyYYC (Python) and more. Do some poking around for your interests, and contribute to the success of a community.

Maestro project now on GitHub

Maestro is now on GitHub. See the README.md for an overview of the project (and Getting Started instructions), and the wiki for project documentation. Unfortunately, there’s not much else yet other than the migration file for the schema, which should be stable (at least for a while).

In order, the immediate goals are to:

  • Complete the demo data set and load scripts
  • Auto-generate CRUD MVC code
  • Host a demo system on dalescott.net
  • Complete a basic read-only Part module

After a number of abortive attempts trying to adapt existing projects, this time it feels right – not too hot and not too cold. If you need to know what’s going on in, ask the Maestro!