Zoook e-Sale documentation¶
Zoook e-Sale modules, and Django-Zoook: e-commerce system 100% designed and integrated for OpenERP.
This documentation covers version 6.1.1.0 of Zoook.
Note
Zoook e-Sale was originally developed by Zikzakmedia, and currently is unmaintained. This is a fork developed by Enterprise Objects Consulting, fully functional, with active development, free and open source, and with commercial support too.
Indices and tables¶
Introduction¶
Zoook is e-commerce OpenERP App without connector. Forget connectors and errors.
Zoook is a web store, developed in Python with Django framework, and is 100% compatible and designed to work with OpenERP.
The orders, the stock, postage and prices (to list just a few features) come straight from OpenERP.
One feature not available a lot of e-commerce is price rules are not same at ERP that e-commerce. You need to create new rules prices at e-commerce app and maintenance two or more rate prices. Same at stock, delivery, promotions... Zoook provides and integration e-sale and relation at client (CRM) or any model OpenERP available at web.
Remember, Django is SEO application and products and categories add new features to SEO. Also available cross sells and related products features.
Note
This documentation and the project is work in progress. Please contribute!
Architecture¶
The application is divided into two parts: the Django Web App, and the OpenERP modules part.
The Django-Zoook Application part is the webstore itself, and the modules in OpenERP is the part allows you to configure countries, payments and delivery available to each sale shop.
You can design payments related with Picking Policy, Order Policy or Invoiced Quantity (it isn’t same cash on delivery payment or Paypal payment).
Also the Zoook module in OpenERP is used to synchronize the catalog cache.
Connection with OpenERP¶
Zoook uses Pyro or XML-RPC protocol and OOOP (OpenObject on Python) and Paramiko libraries to connect with OpenERP.
Client browser <---HTTP---> Zoook e-Sale <---XML/RPC---> OpenERP
For example, when a customer reserves a product in the shopping cart, Zoook creates in real time a standard Sale Order object in Draft state in OpenERP. And when the user confirms the order, Zoook moves the state of this order to In Progress, and the workflow will be launched a Packing to manages the delivery of the goods to the customer.
Catalog cache¶
Zoook only synchronize as cache the catalog information, but all the operations are attended by OpenERP in real time.
The reason than Zoook are synchronized with OpenERP is because if your ERP is off connection, your e-commerce will be still available.
Also, a lot of communication is catalog search (users or search engines), this is an example from an e-commerce store:
Period Visits Real Orders Mar 1744 9 Feb 2227 7 Jun 2167 8
Zoook as Framework¶
Zoook is not only a shopping cart system, can be used as developement framework to construct any web application integrated with OpenERP.
The source code has everything you need to start a new project:
- Integrated with OpenERP with webservices (customers, sales, pickings, etc).
- Users in Django App are mapped as partners (customers) in OpenERP.
- Developed with the most popular web framework in Python: Django.
- Easy to modify and extend, compact and legible code.
Installation¶
This chapter contains the general installation procedure for deploying Zoook e-Sale, and configure an installed OpenERP instance to work with this system.
Requirements¶
This version of Zoook only works with OpenERP version 6.1.
The installation procedure for Zoook under Linux is explained in this chapter. The procedure is well tested on Ubuntu 12.04 LTS.
Environment tools¶
The followings tools and packages will be used to install Zoook:
- OpenERP 6.1
- python (2.6+)
- python-setuptools
- python-pip
- python-dev
- libjpeg8-dev
- zlib1g-dev
- bzr
- postgresql
- postgresql-client
- openssh-server
You have to install with apt-get
tool, or any other you use.
Django-Zoook App sources¶
To install the Django-Zoook application, you must download them
from the repository:
lp:~zoook-community/zoook-esale/django-zoook-6.1
.
Then install the following dependencies.
Python Packages dependecies¶
This is the list of Python packages dependencies, they can be installed with
apt-get
tool too, or with pip
command:
- django == 1.4.x
- django-localeurl
- django-south
- django-pagination
- psycopg2
- python-magic
- paramiko
- django-transmeta
- pillow
- django-inplaceedit
- django-maintenancemode
- Pyro
- OOP (https://github.com/eoconsulting/ooop)
In Linux packages systems, the Python packages starts with python-
prefix,
so by example, the django
package, is named python-django
.
Optionals:
- recaptcha-client
- django-filebrowser >= 3.5.2
- django-grappelli
- staticsfiles_ignoredebug (https://github.com/eoconsulting/django-staticsfiles-ignoredebug)
OpenERP modules dependency¶
You have to install the zoook
module, it’s available in the main
repository of Zoook e-Sale Project in Launchpad:
lp:~zoook-community/zoook-esale/zoook-6.1
Depends modules¶
The module zoook
depends of:
- account_payment_extension
- base
- base_external_mapping
- base_vat
- currency_numeric_code
- delivery
- django
- poweremail
- product_m2mcategories
- product_images_olbs
- product_attributes
- product_variant_name
- sale_multi_shop
- sale_payment
- sale_promotions
- web_wysiwyg
- web_display_html
- partner_title_pricelist
Optional:
- nan_product_pack
All this modules are in the dependencies branch
repository of Zoook e-Sale Project in Launchpad:
lp:~zoook-community/zoook-esale/zoook-extra-addons-6.1
Configuration¶
In this section will be describe how to configure Zoook and OpenERP.
Having finished the dependencies installation in OpenERP and Django, we will proceed with their parameterization and the connection between the boot components.
Django-Zoook Configuration¶
In this section will be configure the web shop part of Zoook.
Note
Zoook web shop is a Django project. Read first about Django framework. The official docs is a great documentation: https://docs.djangoproject.com/en/1.4
Checkout and install requeriments¶
In the Requirements guide are listed what you need, you must be install all, following the standard steps for each type of packages.
To download the latest version of Django-Zoook, go to any folder you want to save the repositories, and checkout it with Bazaar:
$ bzr branch lp:~zoook-community/zoook-esale/django-zoook-6.1 django-zoook
This will download all the source code in a new folder django-zoook.
Create Zoook Database¶
To manage users and databases in PostgreSQL will be use PSQL command line tool, but you can use other tools like the PgAdmin GUI, or the web tool phpPgAdmin.
To execute PSQL interpreter as postgres
user
(the root user in PostgreSQL):
$ sudo -u postgres psql
The system will ask your password, and then you will be at the PostgreSQL command line prompt:
postgres=#
To exit the psql:
postgres=# \q
At first create a PostgreSQL database for Zoook. In a development environment
you can use the user openerp
. This way you don’t have to create a new one.
In production its recommended to make sure that every user has an exclusive
access to the database.
The command to create a PostgreSQL user:
$ sudo -u postgres createuser --createdb --no-superuser --no-createrole --pwprompt zoook
This is mandatory, the Zoook database stores all the catalog cache, the registered users (mapped as client in OpenERP), and others configuration tables.
First enter with psql
command, and then create the database with:
postgres=# CREATE DATABASE dj_zoook OWNER zoook;
To verify the correct creation of the database, exit with \q
command, and
then enter with:
$ sudo -u postgres psql dj_zoook -U zoook
Password for user zoook:
psql (9.1.9)
Type "help" for help.
dj_zoook=>
Parameterization Django-Zoook¶
Django-Zoook is a Django application, so many parameters are standard of this framework.
Edit the file and adjust the parameters of the connection to OpenERP. You’ll have to configure all passages. The following ones are especially important for the interconnection with the OpenERP server.
DATABASES: Defines where and how Zoook finds its database. If you are
installing the environment in your local computer, verify the NAME
,
USER
, and PASSWORD
parameters:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dj_zoook',
'USER': 'zoook',
'PASSWORD': 'postgres',
'HOST': 'localhost',
'PORT': '5432',
}
}
OERP_CONF: Defines the connection to the XML-RPC service of OpenERP. In a local environment, check the first three parameters.
OERP_CONF = {
'username':'admin',
'password':'admin',
'dbname':'openerp',
'protocol':'xmlrpc', #xmlrpc
'uri':'http://localhost', #xmlrpc
'port':8069, #xmlrpc
# 'protocol':'pyro', #pyro
# 'uri':'localhost', #pyro
# 'port':8071, #pyro
}
Locale: Defines the languages of your web shop. They have to be the same as in OpenERP:
LANGUAGE_CODE = 'es'
LANGUAGES = (
('en', ugettext('English')),
('es', ugettext('Spanish')),
)
DEFAULT_LANGUAGE = 1
LOCALE_URI = True
LOCALEURL_USE_ACCEPT_LANGUAGE = True
LOCALES = {
'en':'en_US',
'es':'es_ES',
}
OERP_SALE: Indicates which OpenERP shop must be used in Zoook.
OERP_SALE = 2 #Sale Shop. All price, orders, ... use this Sale Shop ID.
OERP_SALES = [2] #Sale Shops. Orders by Sale Shops
Email: Emails notification are parsed by Poweremail in OpenERP, but are sent by Zoook with the Django framework support. This is an example with a Gmail connection:
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'myemailuserXXX'
EMAIL_HOST_PASSWORD = 'mypasswordXXX'
EMAIL_PORT = 587
Zoook uses the standard logging library in Python. If you want
to verify the log setup, check the logconfig.py
file.
By default the log output are located in ../django-zoook/log/zoook.log
file. Depending of the user’s system and file system configuration,
you will need to create manually the container directory (“log” folder),
and with the necessary permissions to get read/write access.
Note
When Zoook starts if you get a IOError
in the output console related
with the zoook.log
file, and the process is aborted, then you don’t have
the permissions to access the file, or the file cannot be created because
the container “log” folder don’t exist.
Create Zoook’s database tables¶
To generate the database structure, go to the django-zoook/django_zoook
folder with the command line. Then run:
$ python manage.py syncdb
The script will ask if you want to create a new super-user. Affirm and pass it the needed data for the account you’ll later want to administer Zoook with.
Create Zoook’s configuration¶
To generate the initial configuration, go to the django-zoook/django_zoook
folder with the command line. Then run:
$ ./configuration.py
The script will ask you some basic information, like the store name, slogan, etc.
Run !¶
Now you can run Zoook. Use the usual way in a normal Django App:
$ python manage.py runserver
The application will run in the port number 8000, and will accept only local connections. To get more options of how to start a Django application go to the official documentation.
To view the page open a web browser and type http://localhost:8000 in the URL bar and press enter.
The application will look like this:
Also Zoook has an Administrator page (Django Admin Site module), you can enter
with the /manager
URL, then the username and password of the super-user
will asked to access the page:
Zoook OpenERP module Configuration¶
In this section will configure the module of Zoook in our OpenERP instance.
Checkout and install requirements¶
In the Requirements guide are listed what you need, you must be install all following the standard steps for each type of packages.
To checkout the OpenERP modules and depends, go to any folder you want to store the repositories, and execute this:
$ bzr branch lp:~zoook-community/zoook-esale/zoook-6.1 zoook
$ bzr branch lp:~zoook-community/zoook-esale/zoook-extra-addons-6.1 zoook-extra-addons
You must be copy all the modules in these folders into the addons
folder
of OpenERP, or add the paths of these branchs into the OpenERP file
configuration. Go to OpenERP Documentation
to get more information about the configuration file.
Go to Settings > Modules > Update Modules List after copy or linking the modules into the addons path.
Then go to Settings > Modules > Modules, and search and install the module zoook: will be installed with all dependencies.
Create a Shop¶
Zoook is multi-shop, but not multitenancy: that means than you can have more than one shop configured in OpenERP, each with its own products, categories, and all shop in the same OpenERP database (and therefore the same instance), but in the Django Apps side, you must be have one instance by shop, each instance with its own Zoook database, configuration and Python installation (and each running in a different process and HTTP port).
To create a shop go to Sales > Configuration > Sales > Shop, by default one shop exist with the name “Shop 1”, you can use this, or create another. The shops objects are not only related to Zoook, you can configure several shops to reflect your business infrastructure. Then when you sale something in the Sale Order you can select in which shop you are. And when a customer buys something from Zoook, the shop configured for this Zoook instance will be appear in the order.
So to setup a Zoook shop in an existing shop or a new one, in the edit form check the “OpenERP e-Sale” field. There will be new sections in the form, related to Zoook.
Note
When you edit a register in OpenERP in most cases the ID in the database is not visible, but if you see in the URL, the parameter “id” has this ID. You have to get this shop ID to configure the OERP_SALE and OERP_SALES parameters of the Django-Zoook configuration.
You must be fill all the mandatory fields before save the shop. These are the important fields:
Root product Category: The root category of all the sub-categories will be displayed in the store. You must be create or select one (also with the “OpenERP e-Sale” check activated). Zoook support n-levels of sub-categories.
Email Sale Order: The Poweremail template will be
used to render the confirmation email of a Sale Order. To create the template,
you can use the example in the source code
of zoook
module.
Languages: Zoook is multi-language, you can configure the same languages of your OpenERP database in Zoook, and show your products in the store in multiples locales.
Delivery: Deliveries methods. You must be have one at least. If you don’t have delivery service, you can configure a “nodelivery” method, with a related delivery pricelist with zero cost price.
Payment: Supported customer payment methods. Can be virtual (like PayPal),
or not virtual like the “cashondelivery” method. You must be have one
at least. Each payment method has a related application to handle the
payment transaction. Check the supported methods by the Web Apps in the
django_zoook.payment
package.
SSH Connection: The SSH parameters to connect with Django-Zoook application. Fill this with the standard parameters needed in this type of connection. Check the following section about the SSH server and the necessary steps to get a successfully connection.
Configuring SSH Connection¶
First, you must be installed and running a SSH server (like OpenSSH) in the same host where Django-Zoook are. If it’s not the same host than the OpenERP server, you must be procure the access to this SSH server in Django-Zoook to OpenERP server (check the firewall configuration).
Also you must be import the SSH certificate in the “know hosts” list of consumer host, this can be done when you try to connect from the console: if the SSH client don’t recognize the certificate (it’s not a public key), will be ask you to import the key, or abort the connection.
The import of the certificate must be achieved even if the Django-Zoook daemon and the OpenERP daemon reside in the same host.
This is an example of connecting to your localhost through SSH command line tool, and import the certificate:
If you don’t perform this step, then Zoook module won’t connect with Django-Zoook. After these steps, in OpenERP go to the shop configuration, and in the “SSH Connection” click the “Test Connection” button to check if the configuration are OK.
Product Configurations¶
After configure the Shop, you have to configure some categories (in the three of the root category), and configure the products. Each product and category must be checked in the “OpenERP e-Sale” field to be exported. In the product form, the categories must be configured in the “Extra Categories” tab (the “Category” field is not used by Zoook).
Also remember, the shop where the product will be exported must be configured in the section “Website” of the tab “e-Sale”, remember than Zoook is multi-shop and the shop must be specified, or will not be exported.
Note
You can attach many images for each product, but for the moment Zoook
only supports Links pictures. The pics stored in the database (uploaded)
will be exported incorrectly. The link’s images are exported well, and
resized and cached by Zoook in the django_zoook/static/catalog
folder.
Export the catalog¶
Once finished the initial catalog setup, you have to export all the data to Zoook webshop. To do the task go to Sales > Configuration > Sales > Shop menu, and enter to the shop to synchronize. In “Actions” tab in the bottom section, click in the buttons to export, in the same order are showed, depending of the data you want to export. If it’s the first export, click in the “Global configuration” before the other export tasks.
After export the catalog, a category page will look like this:
Note
When you export data, only the newest information are exported according to the last exportation date. If the process fails, the date will be updated anyway, and you won’t export the information again, at least you first edit, or modify manually the last exportation field.
Also the delete operations are not exported, so if you delete a product,
you must be delete from the Django Admin Site of Zoook (/manager
URL),
or you can edit the “Active” field or the “Visibility” field of the
product to deactivate.
Configuring Poweremail¶
This is the OpenERP module responsible to send emails when a client confirms an order, or when a user is registered or changes their password.
A good guide of this module is here.
Note
Install poweremail module only from
lp:~zoook-community/zoook-esale/zoook-extra-addons-6.1
, this version
has some important fixes to work with Zoook.
Go to Poweremail > Configuration > All accounts, and create a new account, the following example is a SMTP Outgoing account in Gmail:
- Name: A name or brief description
- Server: smtp.gmail.com
- SMTP Port: 587
- Use SSL/TLS: False
- Use TLS: True
- Email ID: xxx@gmail.com (Gmail account id)
- User Name: xxx@gmail.com
- Password: Gmail password
- Related Name: The OpenERP user owner of this account, the same used in Zoook
- Company Mail A/c: No
This account will be used to send email notifications when you add a Zoook user to an existing client in OpenERP (Django tab in partner form), or when you reset also from OpenERP the Zoook user password.
The emails sent by the shop are procesed by Poweremail, but dispatched by Zoook with the Django API. So, you have to configure the email account in Django Zoook App too, in the config.py file.
The process of defining templates is used to configure email for a specific model, like the Sale Order object, or the Reset Password wizard object.
To create a new template go to Poweremail > Templates > Email Templates, and click in Create button.
In the folder util/poweremail-templates-examples of zoook module you will be find the necessary templates for each type of object where Zoook launchs emails, you can use a custom text/HTML for this emails, or send to the clipboard the content of this examples and paste into the OpenERP form, in the Body (HTML) field.
This is an example of template for Sales Order:
- Body (HTML): The content of sale.order-email-en.html example template
- Model: Sales Order (sale.order)
- Recepient (To):
${object.partner_id.dj_email or object.partner_order_id.email}
- Default BCC: A email to recibe the Sale Order notifications, like myemail@company.com (optional)
- Default Subject:
My Shop - Sale Order Ref ${object.name} - ${object.shop_id.name or object.company_id.name}
- Language:
${object.partner_id.lang}
- Templating Language: Mako Templates
After create this template, you have to setup in the shop configuration field.
Example for Create User wizard:
- Body (HTML): The content of zoook.create.user.wizard-email-en.html example template
- Model: zoook.create.user.wizard
- Recepient (To):
${object.email}
- Default Subject:
My Shop - New User
- Templating Language: Mako Templates
Example for Reset User (reset password create) wizard:
- Body (HTML): The content of zoook.reset.user.wizard-email-en.html example template
- Model: zoook.reset.user.wizard
- Recepient (To):
${object.partner_id.dj_email}
- Default Subject:
My Shop - Reset User Password
- Templating Language: Mako Templates
Screenshots¶
Catalog list¶
Catalog list, viewing a category in grid mode.
![]()
Product details¶
Product information and pictures.
![]()
Product gallery¶
Product gallery plugin.
![]()
Wishlist¶
Customer products like.
![]()
Checkout¶
Shopping cart confirmation.
![]()
OpenERP product setup¶
Configuring the product SEO.
![]()
OpenERP shop options¶
Shop export and setup options.
![]()
Zoook login¶
User can login or create an account.
![]()
Zoook Customer Orders¶
Users can see their history orders.
![]()
Zoook Customer Order¶
Users can see the details of their history orders.
![]()
Product Price Update¶
Users can see the price of the products according with their price list.
![]()
Product Variants¶
Products can have variants like color, size, etc.
![]()
Resgistration form¶
Users can register in the web shop.
![]()
User Profile¶
Users can edit their profile information.
![]()
Zoook Change password¶
Validation are applying.
![]()
About Zoook e-Sale¶
The Project¶
Zoook e-Sale was originally developed by Zikzakmedia, and currently is unmaintained. This is a fork developed by Enterprise Objects Consulting, fully functional, with active development, free and open source, and with commercial support too.
The home page of this project are in Launchpad.
Who are using Zoook?¶
These are a few sites using Zoook:
- Kikai Labs: Online store for sale 3D printers.
- AvanzOsc E-Shop: Online shop to sale consulting services.
- Comomio.com: Online community to sale pet services, this site uses Zoook as base framework.
If you are using Zoook as E-commerce or as framework tool, please send an email to the mailing list in Launchpad to be added to this list.
Versioning¶
This is the version 6.1.1.0 of Zoook e-Sale.
The number version is composed of two parts, separated by dots:
- The major version: corresponding with the OpenERP targeted. This version works with OpenERP 6.1, so, the major version of this release is 6.1.
- The minor version: this is the stable build release, now the 1.0.
Authors¶
- Mariano Ruiz <mrsarm@gmail.com> (Enterprise Objects Consulting)
- Raimon Esteve (Zikzakmedia)
Source Code¶
The source code of Zoook modules, Django Zoook, this documentation and some of the dependencies are in the Launchpad Project.