Skip to content

Installation Procedure

Martin 'Hasan' Bramwell edited this page Jan 12, 2014 · 7 revisions

Configure "git"

sudo apt-get -y install git
#
cd ~
mkdir -p ~/.ssh
cd ~/.ssh
rm -f id_rsa
rm -f id_rsa.pub
echo " * * * * * * *      Paste SSH *private* key here * * * * * * *"
echo "                          <ctrl-d> to finish"
cat > id_rsa
#
echo " * * * * * * *      Paste SSH *public* key here * * * * * * *"
echo "                          <ctrl-d> to finish"
cat > id_rsa.pub
#
cp id_rsa.pub authorized_keys
chmod 600 ./*
cd ~
chmod 700 .ssh
#
git config --global user.name "Martin H. J. Bramwell"
git config --global user.email [email protected]
git config --global push.default simple

Prerequisites

sudo apt-get -y install python-pip # unzip 
#
sudo pip install openerp-client-lib oauth2client Importing
#

Make a place to work

cd ~/
mkdir -p projects
cd projects

Obtain GData OpenERP data pump

git clone [email protected]:martinhbramwell/GData_OpenERP_Data_Pump.git

Obtain and install GSpread

git clone [email protected]:FleetingClouds/gspread.git
sudo pip install -e gspread
#

Obtain Authentication and then request Authorization

This step uses gspread/tests/get_google_oauth2_creds.py to prepare the tokens request to your expected end user. The required steps are documented here: How to get, use and refresh OAuth access tokens for gspread - Access and refresh tokens script

The credentials you need will be written to the file creds_oa.py

cd ~/projects/GData_OpenERP_Data_Pump/
cp ../gspread/creds_oa.py .
#

Startup the Data Pump

 ./pump.py

You should get a result like this . . .

Will try with OAuth credentials
The creds_*.py file(s) may now be deleted.
usage: gDataTools.py [-h] (-c | -k WORKBOOK_KEY) [-r START_ROW]
gDataTools.py: error: one of the arguments -c/--clean -k/--workbook_key is required

As the error says, the pump depends on a specially formatted file to learn what to pump into OpenERP. Specify that spreadsheet with its identification key.

Copy this spreadsheet and edit it to connect to your OpenERP : https://docs.google.com/spreadsheet/ccc?key=0AiVG6SoU001RdFdyc1NxOHN4eWZ6Q0lLMHVyWUpkaHc

The run the pump referring, by key, to your copy.

 ./pump.py -k 0AiVG6SoU001RdFdyc1NxOHN4eWZ6Q0lLMHVyWUpkaHc

You should get a result like this . . .

Connected to OpenERP database "bananarama" on server "erpserver.example.com".
Start work at row #4 in the "Tasks" sheet.
Found 0 tasks to process.

Finally, refer back to the README.md -- First time execution

Clone this wiki locally