Category Archives: Development

Hosting php apps on apache using php-fpm

Here are notes from some research I did a while back on using php-fpm with Apache and Nginx. dalescott.net will likely never reach traffic levels where it would benefit, so I’m staying with Apache 2.2 and mod_php for now.

php-fpm

  • http://php-fpm.org
    • project site, code now included in php
  • http://php.net/manual/en/install.fpm.php
    • discusses fpm but does not include specific install or config instructions (some posts though)

Apache

  • Google: apache+mod_proxy+fcgi+php
  • Google: apache+php+php-fpm+freebsd
  • TODO: add references etc to blog post on same topic

Project docs

  • http://wiki.apache.org/httpd/PHP-FPM
  • http://httpd.apache.org/docs/current/mod/mod_proxy_fcgi.html
  • http://httpd.apache.org/docs/current/mod/mod_proxy.html

Blogs, tutorials, and forums

  • http://www.howtoforge.com/using-php5-fpm-with-apache-2.4-mod_proxy_fcgi-module-on-fedora-18
  • http://garajau.com.br/blog/2013/12/apache-2-4-and-php-fpm-using-mod_proxy_fcgi
  • http://www.binarytides.com/setup-apache-php-fpm-mod-proxy-fcgi-ubuntu
  • http://jkroon.blogs.uls.co.za/it/security/using-php-fpm-and-mod_proxy_fcgi-to-optimize-and-secure-lamp-servers
  • http://www.rodrigocalado.com.br/famp-instalando-o-apache-2-4-php-5-5-mysql-5-6-no-freebsd-9-x-9-2-release/
    • Need to translate (Spanish? Italian?)
  • http://www.janoszen.com/2013/04/29/setting-up-apache-with-php-fpm/
  • http://forum.nginx.org/read.php?3,172673
    • nginx forum, but discusses Apache2, php-fpm, FastCGI
    • also see referenced post http://forum.nginx.org/read.php?3,131665,144226#msg-144226
  • http://www.hosting.com/support/linux/configure-apache-to-use-php-fpm/
    • Configure Apache to use PHP-FPM
  • http://funcptr.net/2010/11/14/apache-mod_fastcgi-and-php-with-php-fpm/
  • http://harold.internal.org/tag/freebsd/
    • Apache with PHP-FPM, chroots and per-vhost UIDs
  • http://www.yiiframework.com/doc/guide/1.1/en/quickstart.apache-nginx-config
    • tcp port

Nginx

Google: nginx+PHP+php-fpm+freebsd

Blogs, tutorials, and forums

  • http://arstechnica.com/series/web-served
    • nginx, php, php-fpm, ….
    • VERY detailed
    • uses tcp port to communicate with php-fpm
  • http://blog.bobbyallen.me/2013/01/05/install-nginx-mysql-php-apc-and-memcached-on-freebsd-9-0
    • uses tcp port to communicate with php-fpm
    • provides nginx.conf file (downloadable)
    • intended use FuelPHP framework
  • http://blog.secaserver.com/2011/07/freebsd-nginx-php-fastcgi-installation
    • uses tcp port with php-fpm
  • http://fendyhussain.wordpress.com/2012/11/23/freebsd-nginx-with-php5
    • uses fastcgi (not fpm)
  • http://till.klampaeckel.de/blog/archives/44-Nginx+PHP+FastCGI-Testing-your-web-application-with-bleeding-edge-PHP.html
    • uses fastcgi
  • http://www.defcon1.org/html/nginx.html
    • installing nginx with PHP FPM on FreeBSD 8.x-9.0
    • uses fastcgi
  • http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-debian-wheezy
    • discusses both unix sockets and tcp port config with fpm
  • http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-ubuntu-12.10
  • http://www.yiiframework.com/wiki/153/using-yii-with-nginx-and-php-fpm
    • describes unix sockets on BSD for better performance (but must use tcp sockets with Linus due to kernel bug/issue)
  • http://www.yiiframework.com/doc/guide/1.1/en/quickstart.apache-nginx-config
    • tcp port
  • http://bin63.com/how-to-install-nginx-and-php-fpm-on-freebsd

Maestro-Tryton in Closed-Alpha

I have written before about the Tryton framework. dalescott.net now includes a Tryton server and an “scc” database for implementing Maestro with Tryton – or Maestro-Tryton.

Maestro-Tryton is in Closed-Alpha, and will publicly available when all basic SCC master data has been included – Users, Products, Bills-of-Materials (BOMs), Suppliers, Customers and Projects.

If you are interested in collaborating on the Maestro project, please leave a comment and I’ll contact you. You can access the Maestro project on GitHub to access the source data, read the Maestro project wiki, and submit wiki articles, updates, issues and other work to the project.

Configuring Git

I needed to configure Git on a new server recently (no GUI), and couldn’t remember my typical configuration.

Disable Output Color-Coding

Many developers can’t live without color-coded command-line output, but you may find (as I do) that less than perfect color vision combined with high ambient lighting and some screen glare results in a display that is essentially incompressible. To disable color-coded command line output from Git:

$ git config --global color.ui false
$ git config --global color.diff false
$ git config --global color.status false
$ git config --global color.branch false
$ git config --global color.interactive false

Ignore File-Mode Changes

Git may report that executable files (e.g. shell scripts) have been modified based on differences in file mode interpretation between Unix and Windows systems. If the mode of a file is set to executable and committed to a Git repository in a Unix environment, and then the repository cloned into a Windows environment, the file will be reported by Git in Windows as having been modified – based on its mode. This is the result of subtle differences between a Unix file system and a Windows file system. Committing the “modified” file in Windows and pushing the repository changes back to the Unix repository will result in the file not being executable in Unix (until its file mode is set back to executable).

If this is an issue for you, set your Windows global Git config (~/.gitconfig) to ignore file mode changes (but first, check that your global configuration will not be overridden by a repository configuration).

Check your global and local configs:

$ git config --global core.filemode
$ cd gitrepo
$ git config core.filemode

Set configuration to ignore file mode changes:

$ git config --global core.filemode false
$ cd gitrepo
$ git config core.filemode false

Flattening a directory structure on Windows

The other day I needed to copy all the files within a hierarchical directory structure in a shared network directory into a single directory. Here’s how I did it.

1) install the following GnuWin32 utilities from http://gnuwin32.sourceforge.net/packages.html (this is much simpler than and add the bin directory (c:\Program Files\GnuWin32\bin) to your PATH environment variable.

  • CoreUtils
  • FindUtils
  • sed

2) Check the shared network directory for files with the same name, and either change names or delete files before copying. My shared network directory is mapped as I:\Share.

C:\>I:
I:\>cd I:\Share
I:\Share>"c:\Program Files\GnuWin32\bin\find.exe" . -type f | sed "s/.*\///" | sort | uniq -d

The full path to “find” is needed because, although the GnuWin32 bin directory is on my command path, the Windows “find” command is found on my path before the GnuWin32 “find”. This can take some time – 15 minutes on a 5 year old laptop with a shared directory having 170k files and 22K directories!

3) Copy the files into a new “files” directory on X-drive:

I:\Share>mkdir X:\files
I:\Share>cp `find . -type f` X:\files

Done!

P.S. Thanks to ldenneau for the idea (http://ask.metafilter.com/62308/Easy-Windows-directory-flattening-with-minimal-tools)

Using Tryton for Maestro Workflows

This article is part of a series on the Tryton framework, and complements the Maestro project on GitHub. This article explores a number of Maestro workflows using Tryton.

This article is a work in process.

Background

The Swift Construction Company (SCC) manufactures a radio receiver called an Aircraft Wireless. The SCC buys assembled electronics circuit boards (part number 20000003) in lots of 5 from Trilogy-Net. The circuit boards are used in the assembly of Aircraft Wireless units (part number 10000003). When circuit boards arrive from Trilogy-Net at the SCC, they are inspected, identified with a serial number and stocked in inventory. The SCC has a number of customers for Aircraft Wireless units, including B&E Submarines who purchased an Aircraft Wireless system to evaluate.

Product Structure

10000003 ASSY,MKTG,AIRCRAFT WIRELESS
|--- 90000012 EARPH,MONO,HI-Z,3.5MM
|--- 50000001 DOC,USER,AIRCRAFT WIRELESS
|--- 80000005 BOX,SHIPPING,5X4X2,CARDBOARD,WHITE
\--- 10000001 ASSY,AIRCRAFT WIRELESS
     |--- 10000002 ENCL,AIRCRAFT WIRELESS
     |    \--- 80000001 BOX,IP54,4.74X3.13X2.17",ALUM,BLK,SCREWS
     |--- 20000003 PCA,AIRCRAFT WIRELESS
     |    |--- 20000001 IND,830UH,AIRCRAFT WIRELES
     |    |    |--- 90000001 WIRE,MAGNET,38AWG,POLY
     |    |    |--- 90000002 MAG,FERRITE ROD,1/4IN X 4IN,MATL=61
     |    |    \--- 90000003 TAPE,ELECTRICAL,3/4",BLUE,VINYL
     |    |--- 20000002 PCB,AIRCRAFT WIRELESS
     |    |--- 90000004 CONN,PHONE,F,MONO,PCB,3.5MM
     |    |--- 90000005 CAPV,150-230PF,TOP ADJUST,PCB
     |    |--- 90000006 DIO,SIG,GERM,0A95,AXIAL,D0-7,GLASS
     |    |--- 90000007 CAP,ELEC,10UF,16V,20%,RADIAL,ROHS
     |    |--- 90000008 CAP,CER,33PF,100V,10%,RADIAL,ROHS
     |    |--- 90000009 CAP,CER,3300PF,100V,10%,RADIAL,ROHS
     |    |--- 90000010 RES,AXIAL,2.0M,0.4W,1%,MF,ROHS
     |    \--- 90000011 RES,AXIAL,5.6M,0.4W,1%,MF,ROHS
     |--- 80000003 SCREW,MACHINE,PHIL,4-40X1/4,SS
     |--- 80000004 WASHER,FLAT,4-40
     |--- 80000006 STANDOFF,HEX,4-40,0.5"L,ALUM
     |--- 80000007 WASHER,LOCK,#4,INTERNAL TOOTH
     |--- 90000014 CONN,BINDING POST BANANA,INSUL,GRN
     |--- 90000015 CONN,BINDING POST BANANA,INSUL,YEL
     |--- 90000016 CONN,RING,16-22AWG,#4,RED
     |--- 90000017 WIRE,STRANDED,16AWG,GREEN,POLY
     \--- 90000018 WIRE,STRANDED,16AWG,YELLOW,POLY

60000001 ASSY,FIELD SPARES,AIRCRAFT WIRELESS
|--- 90000012 EARPH,MONO,HI-Z,3.5MM Maplin LB25C
|--- 20000003 PCA,AIRCRAFT WIRELESS Trilogy-Net SCC:20000003
\--- 50000001 DOC,USER,AIRCRAFT WIRELESS

Workflows

Serialized Stock Purchased by a Customer

This workflow explores serialized stock 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 is the circuit board from the spares kit. Ed is 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.

Serialized Stock Consumed by a Project

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 within. 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.

Create, sell, ship, and return a field spares kit

  • Create manufacturing order
  • Issue material to order (serialized PCA)
  • Deliver order to customer
  • Return order from customer
  • Return material to stock (serialized PCA)

Related Topics

Visual display of model

  • Start Tryton client and connect to tryton database.
  • Access Administration > Models and select a model to view the schema for.
  • Select the report icon on the toolbar followed by the “Graph” action.
  • Select the number of levels to display.

Importing Maestro data into Tryton

This article is part of a series on the Tryton framework, and complements the Maestro project on GitHub. This article explores importing basic Maestro data into Tryton.

This article is a work in process. The built-in csv import capability in Tryton can be used to import basic data such as users (see the Maestro project), but more complex importing (e.g. product attributes, Bills-of-Materials) must be done by coding using the Proteus library.

Load Users

To be completed – see Maestro project

Load Units of Measure

To be completed – see Maestro project

Load Suppliers

To be completed – currently loading individual suppliers manually.

Load Customers

To be completed – currently loading individual customers manually.

Load Products

To be completed – see Maestro project

Load Projects

To be completed.

Load Serialized Stock

To be completed.

Installing Tryton server on FreeBSD

This article is part of a series on the Tryton framework, and complements the Maestro project on GitHub. This article describes installing the Tryton server on FreeBSD.

2014-06-30 – updated after installing Tryton server on dalescott.net (FreeBSD-9.2-RELEASE).

Create a virtual machine

I generally use VirtualBox on Windows, but these instructions should generally apply to any virtualizing environment on any host OS.

First, download a FreeBSD-10.0-RELEASE ISO file. The “bootonly” ISO will download the fastest, but the virtual machine must have an active internet connection for install and the install will take the longest. The “dvd1″ ISO will take longer to download, but the virtual machine will not need an active internet connection for install and the install will complete faster. Use the 64-bit “amd64″ version instead of the 32-bit “i386″ version on newer 64-bit compatible hardware.

Create a new virtual machine:

  • 512MB RAM (preferably up to 2G if available if host has at least 8GB)
  • may need to disable VT-x/AMD-V on older systems (e.g. Lenovo ThinkPad T61 and Dell Latitude D630 laptops).
  • configure bridged network connection (accessible from any system on local network) or NAT (accessible from the host only, with appropriate port forwarding – normally TCP port 8000 for Tryton, 22 for ssh and 5432 for PostgreSQL).

Install and update FreeBSD OS

Boot vm from boot CD/DVD and follow the standard install procedure, including creating an admin user and including it in the wheel group.

I generally use ssh keys only for remote login for security, and to avoid having to type passwords. Copy the public ssh key for the admin user to ~/.ssh, edit /etc/ssh/sshd_config to add “AllowUsers adminusername” (if I’m more interested in convenience than security I will also add “PermitRootLogin YES”), and restart sshd.

Check for and install available FreeBSD OS updates, and install the pkg packaging system port. pkg is sometimes called “pkgng” to differentiate it from the older pkg_* packaging utilities, which will be removed in the next FreeBSD release.

# freebsd-update fetch
# freebsd-update install
# pkg update   

You can check the installed packages for reported vulnerabilities (-F is required for initial use only to download a new vulnerability database).

# pkg audit -F

Install PostgreSQL RDBMS

Postgresql files will be owned by user “pgsql”, who alsos own the server process.

# pkg install postgresql93-server-9.3.4
# echo "postgresql_enable=YES" >> /etc/rc.conf
# /usr/local/etc/rc.d/postgresql initdb
# /usr/local/etc/rc.d/postgresql start

Edit /usr/local/pgsql/data/postgresql.conf and configure PostgreSQL to listen on all addresses (my vm will be on my test LAN, with no access from the internet).

listen_addresses = '*'

Edit /usr/local/pgsql/data/pg_hba.conf and add host connection permission. I’m going to allow access by all ipv4 addresses on my local LAN (your requirements may be different).

host all all 192.168.10.0/24 md5

Add a “tryton” super-user to PostgreSQL. You must be system root to do this.

# su pgsql
$ createuser -sdrP tryton
Enter password for new role:
Enter it again:
$
$ exit

The “tryton” super-user password will be entered in trytond.conf (the trytond daemon configuration file) and used by Tryton to manage its PostgreSQL databases.

Restart the PostgreSQL server.

# /usr/local/etc/rc.d/postgresql restart

You should now be able to connect to the PostgreSQL server (“-W” causes psql to prompt for the “tryton” user password).

# psql --username=tryton -W --list

If you edited postgresql.conf and pg_hba.conf as indicated here, you should now also be able to connect from a remote system (e.g. using pgAdmin).

Install Tryton dependencies

Install the Python 2.7 package manager “pip” (Tryton does not support Python v3, although it is being worked on by the Tryton project team). Pkg will install Python and any other dependencies required by pip.

# pkg install py27-pip

Install FreeBSD package dependencies.

# pkg install libxml2
# pkg install libxslt

Install the Graphviz FreeBSD package, required to display models and workflow graphs in the Tryton client.

# pkg install graphviz

Install the python hgnested package using pip. hgnested is a Mercurial DVCS add-on required for Tryton development, and will install mercurial as a dependency.

# pip install hgnested

Install the Python pydot package, the Python interface to Graphviz.

# pip install pydot

Install the Python psycopg2 package, the Python interface to PostgreSQL.

# pip install psycopg2

Install Tryton

Install trytond, the Trytond server daemon python package.

# pip install trytond

Update FreeBSD periodic databases

I don’t know if installing packages triggers the periodic databases to update, but since I often don’t run a virtual machine long enough to cross day, week or month boundaries (when they update automatically), I typically manually update them after major system changes.

# periodic daily
# periodic weekly
# periodic monthly

Create a trytond system user

A “tryton” system user is created to execute the trytond daemen. The tryton user home directory (/home/tryton) created will be configured as the root of the Tryton file system for storing document attachments.

root@casper:~ # adduser
Username: tryton
Full name: trytond system user
Uid (Leave empty for default):
Login group [tryton]:
Login group is tryton. Invite tryton into other groups? []:
Login class [default]:
Shell (sh csh tcsh bash rbash nologin) [sh]:
Home directory [/home/tryton]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]: no
Username   : tryton
Password   : <disabled>
Full Name  : tryton system user
Uid        : 1002
Class      :
Groups     : tryton
Home       : /home/tryton
Home Mode  :
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (tryton) to the user database.
Add another user? (yes/no): no
Goodbye!

Create a Tryton log directory

# mkdir /var/log/trytond
# chown -R tryton:tryton /var/log/trytond

Create a json-rpc data directory

# mkdir /var/run/trytond
# chown -R tryton:tryton /var/log/trytond

Create and edit trytond.conf

trytond.conf contains configuration parameters read by the Tryton server daemon trytond when it starts, and includes such site-specific data as:

  • computer addresses to respond to (jsonrpc).
  • username and password for the PostgreSQL “tryton” super-user.
  • Tryton “administrator” password (required to create, drop, backup or restore a database).
  • specify FreeBSD-specific directory paths

Unfortunately, the pip install for trytond currently does not copy trytond.conf to a suitable location (or any location). Download the trytond server distribution from PyPi, extract and copy trytond/etc/trytond.conf to /usr/local/etc/trytond.conf.

Edit parameters in /usr/local/etc/trytond.conf using the following as reference:

jsonrpc = *:8000,0.0.0.0:8000
jsondata_path = /var/run/trytond

db_type = postgresql
db_host = localhost
db_port = 5432
db_user = tryton
db_password = appleton

admin_passwd = appleton

pidfile = /var/run/trytond/trytond.pid
logfile = /var/log/trytond/trytond.log

data_path = /home/tryton

Install Tryton modules onto the server

In this context, installing Tryton modules means installing modules onto the server from their remote repositories. This makes them available for use in a Tryton database.

Install the following modules using pip. Some modules will be installed as dependencies of others, so do not be concerned if pip reports a module has already been installed.

# pip install trytond_company
# pip install trytond_dashboard
# pip install trytond_product
# pip install trytond_product_attribute
# pip install trytond_production
# pip install trytond_project
# pip install trytond_project_plan
# pip install trytond_purchase
# pip install trytond_sale
# pip install trytond_stock
# pip install trytond_stock_lot
# pip install trytond_stock_split

Start trytond

You can start trytond as root from the command line:

/usr/local/bin/trytond -c /usr/local/etc/trytond.conf &

However, I would prefer to create an rc.d startup script so that tryton starts automatically after booting. I’m using a basic rc.d startup script created by Christoph Larsen for the GNU Health project, which also uses the Tryton framework. It doesn’t support status, but will do for now. Copy the following code to /usr/local/etc/rc.d/trytond

#!/bin/sh

#
# PROVIDE: trytond
# REQUIRE: DAEMON
# BEFORE:  LOGIN
#
# Created by: Christoph H. Larsen
# http://lists.gnu.org/archive/html/health-dev/2011-11/msg00008.html
#

. /etc/rc.subr

name=trytond
rcvar=`set_rcvar`

load_rc_config $name

: ${trytond_enable="NO"}
: ${trytond_user="tryton"}
: ${trytond_group="tryton"}

start_cmd=${name}_start
stop_cmd=${name}_stop
restart_cmd=${name}_restart
status_cmd=${name}_status

command="/usr/local/bin/trytond"
required_files="/usr/local/etc/trytond.conf"

trytond_start() {
  su tryton -c "$command --config=/usr/local/etc/trytond.conf" &
}

trytond_stop() {
if [ -f /var/run/${name}/${name}.pid ]; then
  kill `cat /var/run/${name}/${name}.pid`
  fi
}

trytond_restart() {
  if [ -f /var/run/${name}/${name}.pid ]; then
  kill `cat /var/run/${name}/${name}.pid`
  sleep 1
  fi
  su tryton -c "$command --config=/usr/local/etc/trytond.conf" &
}

run_rc_command "$1"

Make /usr/local/etc/rc.d/trytond executable

# chmod u+x /usr/local/etc/rc.d/trytond

Add trytond_enable to /etc/rc.conf

# echo "trytond_enable=YES" >> /etc/rc.conf

Start trytond

# /usr/local/etc/rc.d/trytond start

Create and configure a new Tryton database

Download and install the Tryton desktop client for your system. Launch the Tryton client and access menu: File > Databases > New database.

Enter the Tryton server admin password (“admin_passwd” in trytond.conf) in the password field, then click Change beside the IP address and change the address to that of your server.

You must enter the password first, before changing the server address, because the Tryton client will attempt to connect to the server immediately after the server address is changed, and will report “Unable to connect” if the admin password was not already entered.

Enter the name of the database to create (e.g. “scc”) and the admin password for the database, then click Create.

Login to the new database as user “admin” and the password you entered to create the database. The Module Configuration Wizard will run automatically after login to configure the new database.

  • Add user (e.g. “Dale Scott”, login “dale”), optionally add permissions (you may need to update user permissions after installing modules, so this is optional at this point),
    • add Permissions: “Administration” (which will be the only permission group available)
    • add Rule: Read, Write, Create, Delete, Model: View Search (which will be the only rule available available)

Install Tryton modules into the database

Mark modules for install

The Tryton modules previously installed to the server will not be installed in a Tryton database.

In the Tryton client, access the menu: Administration > Modules > Modules. Mark the following modules for install (double-click in the Mark for Install column):

  • dashboard
  • product
  • product-attribute
  • production
  • project
  • project-plan
  • purchase
  • sale
  • stock
  • stock-lot
  • stock-split

Install marked modules

There are two ways to install the marked modules, you can either:

  • Select Launch Action icon in the Modules menu bar and then Perform Pending Installation/Upgrade, or
  • Execute the Perform Pending Installation/Upgrade Wizard from the main Tryton menu.

After the install/upgrade completes, the Module Configuration wizard runs and will query you to configure the installed modules.

Create a Company

A company is a type of ‘party’. To identify a party as a company in a new database you must first create a new party, then select it as the new company.

  • Name
    • Swift Construction Company
  • Addresses
    • Name: Default
    • Street: 1 Swift Way
    • Zip: 13054
    • City: Shopton
    • Country: United States
    • Subdivision: New York
  • Language
    • English

Configure Company

  • Enter Company > Currency
    • US Dollar
  • On the Company > Employees > Party view
    • select the new company (e.g. Swift Construction Company)
    • select Add

Create Chart of Accounts

  • Company: Swift Construction Company
  • Account Template: Minimal Account Chart
  • Create Default Properties
    • Default Receivable Account: Main Receivable
    • Default Payable Account: Main Payable

You will need to reload the menu in the Tryton client if it isn’t now displaying menu choices for the new modules (i.e. access menu: User > Menu Reload (Ctrl-T).

The Tryton server has been installed and you can connect to it from a Tryton client. You have also created a new Tryton database with the modules necessary to implement Maestro workflows.

References

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!