Table Of Contents

Previous topic

3.5. gdoc – Google Document Application

Next topic

3.7. pdfgen – PDF generation

This Page

Languages

Previous versions

1.2
1.1

3.6. oerp – OpenERP Application

That applications adds an “ERP” tab on all parts to export an official BOM to OpenERP.

3.6.1. Dependencies

The oerp application depends on oerplib (tested version: 0.5.0).

It is installable through pip or easy_install:

  • pip install oerplib

3.6.2. settings.py

To enable the oerp application, it must be enabled in the settings file: add 'openPLM.apps.oerp' to the list of installed applications (INSTALLED_APPS).

At the end of the settings.py file, adds the following settings:

OERP_HOST = "openerp.example.com"
OERP_DATABASE = "oerp_database" # name of the database
OERP_USER = "admin" # an user who can create a product and a BOM
OERP_PASSWORD = "OERP_USER password"
OERP_PROTOCOL = "netrpc" # or "xmlrpc"
OERP_PORT = 8070
OERP_HTTP_PROCOLE = "http" # or "https"
OERP_HTTP_PORT = 8069

The OpenERP server must have the MRP module installed.

3.6.3. Synchronizing the database

Run ./manage.py migrate oerp.

3.6.4. Creating required units

You must import a list of units of measure into OpenERP. OpenPLM ships with a CSV file (oerp/product.uom.csv) that can be imported into OpenERP.

Once all units are imported into OpenERP. You must run the following command:

  • ./manage.py createuom

This should create a file named oerp/_unit_to_uom.py that should contain something like this:

UNIT_TO_UOM = {
    "dL" : 42,
    "dm" : 43,
    "kg" : 2,
    "g" : 3,
    "cm" : 40,
    "cL" : 39,
    "mm" : 48,
    "-" : 1,
    "m" : 7,
    "L" : 11,
    "km" : 44,
    "m3" : 45,
    "mL" : 47,
    "dg" : 41,
    "cg" : 38,
    "mg" : 46,
}

The order and the numbers may differ but its important that all units are present.

Note

Currently the mole unit is not supported.

3.6.5. Testing

To test this application, create a new part an officialize it. An ERP tab should be available. Click on this tab and then, on the Publish on OpenERP button. A pop-up asking your password (of your openPLM account) should appear. Fill the form and validate. If no error occurs, a list of links related to the created product should appear.