Showing posts with label erp. Show all posts
Showing posts with label erp. Show all posts

Wednesday, November 11, 2020

odoo 14: point of sale show qty_available

 

edit /odoo/addons/point_of_sale/static/src/xml/Screens/ProductScreen/ProductItem.xml line 9 as below:

            <div class="product-img">
                <img t-att-src="imageUrl" t-att-alt="props.product.display_name" />

                <span class="qty_available">
                    <t t-esc="props.product.qty_available" />
                </span>

                <span class="price-tag">
                    <t t-esc="price" />
                </span>

            </div>

edit /odoo/addons/point_of_sale/static/src/css/pos.css add at line about 1202

.pos .product .qty_available {
    position: absolute;
    top: 2px;
    left: 2px;
    vertical-align: top;
    color: white;
    line-height: 13px;
    background: #7f82ac;
    padding: 2px 5px;
    border-radius: 2px;
}

Tuesday, November 10, 2020

odoo 14: point of sale filter pos with on hand quantity

 

we only want to show product with on hand quantity

edit /odoo/addons/point_of_sale/static/src/js/models.js

start at line 413, edit line 419 var domain
        model:  'product.product',
        fields: ['display_name', 'lst_price', 'standard_price', 'categ_id', 'pos_categ_id', 'taxes_id',
                 'barcode', 'default_code', 'to_weight', 'uom_id', 'description_sale', 'description',
                 'product_tmpl_id','tracking', 'write_date', 'available_in_pos', 'attribute_line_ids'],
        order:  _.map(['sequence','default_code','name'], function (name) { return {name: name}; }),
        domain: function(self){
            var domain = ['&', '&', '&', ['sale_ok','=',true],['available_in_pos','=',true],'|',['company_id','=',self.config.company_id[0]],['company_id','=',false], ['qty_available', '>', 0]]; // edit here

add '&' and ['qty_available', '>', 0] like above

reference:

https://www.odoo.com/forum/help-1/question/automatically-remove-products-from-pos-when-products-are-out-of-stock-in-v8-0-123229

Friday, October 23, 2020

Odoo14: POS import products with category

Inventory Product Category

Create product category to import

For example my csv file

"External ID"    "Name"    "Parent Category/External ID"
"cat_besi_kayu"    "Cat Besi / Kayu"    "product.product_category_all"
"cat_besi_kayu_junior"    "Cat Besi / Kayu Junior"    "cat_besi_kayu"

Note:

  • first line is header
  • tab separator and "" string delimiter
  • product.product_category_all is build in root for all categories.

From Inventory -> Configuration -> Product Categories -> Favorites -> Import records, load your category csv file to import. Test it first before real import.

POS Product Category

Create POS product category to import

For example my csv file

"External ID"    "Category Name"    "Parent Category/External ID"
"all"    "All"    ""
"cat_besi_kayu"    "Cat Besi / Kayu"    "all"
"cat_besi_kayu_junior"    "Cat Besi / Kayu Junior"    "cat_besi_kayu"

Note:

  • first line is header
  • tab separator and "" string delimiter
  • product.product_category_all is build in root for all categories.

From Point of Sale -> Configuration -> Products -> POS Product Categories -> Favorites -> Import records, load your category csv file to import. Test it first before real import.

Product

Create products to import

For example my csv file

"ID";"Name";"Sales Price";"Cost";"Quantity On Hand";"Available in POS";"Can be Purchased";"Can be Sold";"Customer Taxes/Amount";"Description";"Product Category / External ID";"Product Type";"Point of Sale Category/Parent Category"
"Junior_66_NP657";"Junior 66 NP657";"80000";"75000";"0";"1";"1";"1";"0";"Septia Brown* Junior 66 Cat Besi/Kayu *0.2L 0.94L 3.785L 20L TC";"cat_besi_kayu_junior";"Storable Product";"cat_besi_kayu_junior"

Note:

  • first line is header
  • ; separator and "" string delimiter
  • cat_besi_kayu_junior is external ID from product category csv file.

From Inventory -> Configuration -> Products -> Products -> Favorites -> Import records, load your product csv file to import. Test it first before real import.

Sunday, September 6, 2020

odoo 13: FATAL: role "odoo" does not exist

symptom:

# tail /var/log/odoo/odoo-server.log
...
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "odoo" does not exist - - -

Solution:

1. su as postgres user in your Debian

# su - postgres

2. run psql

$ psql
psql (11.7 (Debian 11.7-0+deb10u1))
Type "help" for help.

3. create role odoo to connect and exit

postgres=# create role odoo login createdb;
CREATE ROLE
postgres=# \q

Thursday, September 3, 2020

odoo 13: install on low end laptop Fujitsu MH330 Intel(R) Atom(TM) CPU N455 @ 1.66GHz RAM 2GB (Maximum)

 

Guide: Worker number calculation

    Rule of thumb : (#CPU * 2) + 1
    Cron workers need CPU
    1 worker ~= 6 concurrent users

cpu: 1 core (1 core 2 thread) Intel(R) Atom(TM) CPU N455 @ 1.66GHz
workers = 2+1

CPU time needs to be loonger to finish the task, we triple it.

Configuration:

workers = 3
;max_cron_threads = 2 ;default
;limit_time_cpu = 60 ;default
;limit_time_real = 120 ;default
max_cron_threads = 1
limit_time_cpu = 240
limit_time_real = 360

To install pos module, follow these sequence:

  1. Inventory
  2. Invoicing
  3. POS

Reference:

  • https://gist.github.com/Guidoom/d5db0a76ce669b139271a528a8a2a27f
  • https://www.odoo.com/documentation/13.0/setup/deploy.html

Monday, August 31, 2020

odoo 13: point of sale (clean install)

First time you open odoo http://localhost:8069/web/database/selector, you need to create database for your store

Database Name    : castore
Email    : <your valid email>
Password    : ****
Phone number    :
Language    :English
Country    : Indonesia

Note: Default buildin user is "Administrator".

Note: you can select Language Indonesia if you wish
It takes sometime to complete, depend on your hardware. In my small laptop Asus Eee PC 1215B RAM 8GB, it takes about 2-3 minutes.

Configure Preferences
go to Administrator (drop down) -> Preferences
Timezone    : Asia/Jakarta
and save.

Configure your company (store),
go to Settings -> Users & Companies -> Companies -> My Company -> Edit
Company Name    : <your company/store>
Currency    : IDR
and Save.

Add Apps, go to Apps
Apps -> Point of Sale -> Install (will install Inventory and Invoicing)
Apps -> Sales -> Install

Configure products
Inventory -> Master Data -> Products -> Create
Product Name    : lacquer isamu 250 gram
    Can be Sold
    Can be Purchased
General Information
    Product Type    : Storable Product
    Product Category    : All
    Sales Price    : 30000
    Cost    : 20000
To add picture/icon, at camera icon click Edit
Then click On Hand -> Create
On Hand Quantity    : 10000
and Save.
Edit your previous product (i.e. lacquer isamu 250 gram)
Point of Sale
    Available in POS: checked
    Category -> Create and Edit
        Category Name: iron putty
        Parent Category: <blank>
        and save.
and save.


Try your Point of Sale
Point of Sale -> New Session
lacquer isamu 250 gram
change Qty (quantity) to 2.
change Price to 25000
make Payment -> Cash
Tendered: 60000
Validate and you can print reciept.

Done. You can now add more products to sell.
 

Reference:
https://www.planet-odoo.com/odoo-13-point-of-sale-a-complete-guide-to-point-of-sales-features-payments-pricing/

Wednesday, August 26, 2020

odoo 13: install on Debian 10.5

Install PostgreSQL
# apt-get install postgresql

Install package wkhtmltopdf
# apt-get install wkhtmltopdf

Install package python3-xlwt
# apt-get install python3-xlwt

Install package python3-num2words
# apt-get install python3-num2words

Add odoo 13 repository and install
1. download repository key and install
# wget https://nightly.odoo.com/odoo.key
# apt-key add odoo.key
2. add odoo 13 to /etc/apt/sources.list
...
# odoo
deb http://nightly.odoo.com/13.0/nightly/deb/ ./
3. update your repository
# apt-get update
4. install odoo 13
# apt-get install odoo

My complete /etc/apt/sources.list
# security
deb http://security.debian.org/debian-security buster/updates main

# main
deb http://kartolo.sby.datautama.net.id/debian/ buster main

# non free
deb http://httpredir.debian.org/debian buster main contrib non-free

# backport
deb http://ftp.debian.org/debian buster-backports main

# odoo
deb http://nightly.odoo.com/13.0/nightly/deb/ ./

Note: nightly build will release everyday, If you don't need to update it daily, you may comment out odoo in /etc/apt/sources.list.

After finish, you can open your odoo using firefox http://localhost:8069/.

Reference:
https://www.odoo.com/documentation/13.0/setup/install.html

Monday, August 24, 2020

Dolibarr ERP 12: Configure your TakePOS for small retail

Start your company
Home -> Setup -> Company/Organization
Tab Company
    Name is mandatory
    Country is mandatory
    Sales Tax Management for small company choose "Sales tax is not used"
Tab Opening hours
    Monday - Sunday for example 7-12 13-16 means open from 7am, at 12pm, close at 16pm.

Enabling module Financial Modules (Accounting/Treasury) -> Banks & Cash
After enable, from Top Bar go to Banks | Cash
Create New financial account
    Ref.: cash0001
    Bank or cash label: Cash
    Account type: Cash Account
    Currency: Indonesia
    Status: Open
    Account country: Indonesia
    Initial balance: 5000000

Enabling module Customer Relationship Management (CRM) -> Third Parties
After enable, from Top Bar go to Third Parties.
Create Third-party (New Customer)
    Third-party name: "Unknown 3rd party"
    Prospect / Customer: "Customer"
Create Contacts/Addresses
    Last name / Label: "Unknown Customer"
    Third-party: "Unknown 3rd party"

Enabling module
    Product Management (PM) -> Prodcuts
    Product Management (PM) -> Stocks
    Multi-modules tools -> Tags/categories
After enable, from Top Bar go to Products.
New warehouse
    Ref.: local
    Short name location: local001
New product
    Ref.: Isamu_Lacquer_1_4kg
    Label: Isamu Lacquer 1/4kg
    Status (Sell): For sale
    Status (Purchase): For purchase
    Default warehouse: local
    Nature of product (material/finished):  Manufactured product
    Selling price: 25000
    Min. sell price: 23000
    Tag/categories: dempul besi (modify from Product -> Tags/Category)
and save.
List or Stocks -> choose Isamu_Lacquer_1_4kg -> tab Stock -> Correct Stock
    Warehouse: local
    Number of untis: 50
    Unit Purchase price: 21000
and save.

TakePOS
Enabling module Websites and other frontal application -> TakePOS
After enable, click icon setting.
In Parameters, Enabling Simple
Enable:
    Group VAT by rate in tickets|receipts
    Group same products lines
    Use payment icon on numpad
    Direct cash payment button
    Control cash box at opening pos
and Save.
in tab Terminal 1
    Default generic third party to use for sales: "Unknown 3rd Party"
    Default account to use to receive cash payments: Cash
and Save.

To start TakePOS, from Top Bar go to POS -> Start and Save

Friday, August 21, 2020

Dolibarr ERP: 12.0.2 on Debian 10.5

Download stable version dolibarr-12.0.2.tgz from Source Forge -> Dolibarr ERP-CRM https://sourceforge.net/projects/dolibarr/files/. Extract dolibarr-12.0.2.tgz and move folder htdocs to your web root or subfolder.
 
Create user and mariadb database for Dolibar.

Move to your dolibarr web root. Copy configuration example conf folder and make it writeable during installation.
$ cp conf/conf.php.example conf/conf.php
$ chmod o+w conf/conf.php

Create directory documents and make it writeable.
$ mkdir documents
$ chmod o+w documents/


Install Dolibarr using your browser http://localhost/tes/dolibarr/
Ok PHP Version 7.3.19-1~deb10u1 (More information)
Ok This PHP supports variables POST and GET.
Ok This PHP supports sessions.
Ok This PHP supports GD graphical functions.
Ok This PHP supports Curl.
Ok This PHP supports calendars extensions.
Ok This PHP supports UTF8 functions.
Ok This PHP supports Intl functions.
Ok This PHP supports ZIP functions.
Ok Your PHP max session memory is set to 128M. This should be enough.
Ok Configuration file htdocs/conf/conf.php exists.
Ok Configuration file htdocs/conf/conf.php is writable.

Fill database login and password
Configuration file
Saving parameters to ../conf/conf.php    Ok
Reloading parameters from configuration file.    Ok
Server connection (User dolibarr) : localhost    Ok
Database connection (User dolibarr) : dolibarr    Ok

Your Dolibarr ready to install, wait until installation finish.

Last installation, create user admin and password.
olibarr admin login
Last step: Define here the login and password you wish to use to connect to Dolibarr. Do not lose this as it is the master account to administer all other/additional user accounts.

Dolibarr administrator login 'admin' created successfully.
This installation is complete.
Warning, for security reasons, once the install or upgrade is complete, you should add a file called install.lock into the Dolibarr document directory in order to prevent the accidental/malicious use of the install tools again.

You need to configure Dolibarr to suit your needs (appearance, features, ...).

Add file install.lock
$ touch install.lock

Conguratulation! Your Dolibar 12.0.2 is ready to configure to meet your company requirement and use.

Test on Debian 10.5 Kernel Version 4.19.0-10-amd64

Sunday, October 8, 2017

odoo 10: installing on Debian Stretch

Install from odoo repository not work

# wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
# echo "deb http://nightly.odoo.com/10.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
# apt-get update && apt-get install odoo
# apt-get install odoo
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 odoo : Depends: python-pypdf but it is not installable
E: Unable to correct problems, you have held broken packages.

We install python-pypdf 1.13 using pip
# apt-get install python-pip
# pip install pyPdf


Instructions bellow may harm your system:
"The purpose of a fake package is to trick dpkg and apt into believing that some package is installed even though it's only an empty shell. This allows satisfying dependencies on a package when the corresponding software was installed outside the scope of the packaging system. Such a method works, but it should still be avoided whenever possible, since there is no guarantee that the manually installed software behaves exactly like the corresponding package would and other packages depending on it would not work properly."

We need to build fake debian package for python-pypdf. Install all requirement tools
# apt-get install equivs  dh-make

Create directory python-pypdf
# mkdir python-pypdf
# cd python-pypdf/

Optional to create default email dan full name for our fake python-pypdf
# export EMAIL="youremail@example.com"
# export DEBFULLNAME="your_full_name"

Create our fake python-pypdf configuration
# equivs-control python-pypdf

Edit file python-pypdf
# vi python-pypdf
### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: python
Priority: optional
# Homepage: <enter URL here; no default>
Standards-Version: 3.9.2
Package: python-pypdf
Version: 1.13
Maintainer: your_full_name<youremail@example.com>
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
# Architecture: all
# Multi-Arch: <one of: foreign|same|allowed>
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Files: <pair of space-separated paths; First is file to include, second is destination>
#  <more pairs, if there's more than one file to include. Notice the starting space>
Description: fake package to provide python-pypdf
 python-pypdf will need to be installed with pip
 .
 python-pypdf2 does not provide python-pypdf

We can build our fake python-pypdf and install it
# equivs-build python-pypdf
# dpkg -i python-pypdf_1.13_all.deb

Now you can install odoo 10
# apt-get install odoo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  odoo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.7 MB of archives.
After this operation, 401 MB of additional disk space will be used.
Get:1 http://nightly.odoo.com/10.0/nightly/deb ./ odoo 10.0.20171005 [58.7 MB]
Fetched 58.7 MB in 2min 32s (385 kB/s)
Selecting previously unselected package odoo.
(Reading database ... 64960 files and directories currently installed.)
Preparing to unpack .../odoo_10.0.20171005_all.deb ...
Unpacking odoo (10.0.20171005) ...
Processing triggers for systemd (232-25+deb9u1) ...
[144408.689602] systemd[1]: apt-daily.timer: Adding 4h 39min 11.670524s random time.
Setting up odoo (10.0.20171005) ...
[144409.728850] systemd[1]: apt-daily.timer: Adding 10h 55min 37.336482s random time.
[144409.893345] systemd[1]: apt-daily.timer: Adding 9h 24min 36.399757s random time.
Processing triggers for systemd (232-25+deb9u1) ...
[144410.109266] systemd[1]: apt-daily.timer: Adding 11h 22min 7.421289s random time.


References:
  • https://github.com/odoo/odoo/issues/17002
  • https://debian-handbook.info/browse/stable/sect.building-first-package.html
  • http://nightly.odoo.com/
  • https://www.odoo.com/documentation/10.0/setup/install.html

Tuesday, April 4, 2017

Tunning: Odoo 9 and PostgreSQL 9.4

This configuration may not suit for every needs

Default Odoo 9 installation folder:


  • /usr/lib/python2.7/dist-packages/openerp/
  • /usr/lib/python2.7/dist-packages/openerp/addons/

Edit /etc/odoo/openerp-server.conf

...
max_cron_threads = 1
...

Edit /etc/postgresql/9.4/main/postgresql.conf

...
# - Memory -
shared_buffers = 8192MB                 # min 128kB
                                        # (change requires restart)
...
# - Checkpoints -
#checkpoint_segments = 3                # in logfile segments, min 1, 16MB each
checkpoint_segments = 32                # 512MB https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server
...
# - Planner Cost Constants -
#effective_cache_size = 4GB
effective_cache_size = 8GB
...
Note:
  • shared_bufferes = 1/4 physical memory
  • effective_cache_size = 1/2 physical memory

References:

Tuesday, October 4, 2016

Odoo 9: restore using curl

Additional requirement:

  • zip & unzip
  • curl

Install additional requirement

# apt-get install zip unzip curl

To restore Odoo 9 via web front end using curl, you need to parse 4 parameters, they are:

  • master password: master_pwd
  • name: name
  • backup file (in zip): backup_file
  • restore option (copy or move): copy=true

Regarding to web front end we can use copy option for almost restoring Odoo 9.

In order to avoid conflicts between databases, Odoo needs to know if this database was moved or copied. If you don't know, answer "This database is a copy".

Here is the command to restore Odoo 9 via web front end using curl:

$ curl -F 'master_pwd=password' -F backup_file=@/home/user/test.zip -F 'copy=true' -F 'name=dbname' http://localhost:8069/web/database/restore
You can automate restore your Odoo 9 in backup site using cron. For back up, please refer to backup procedure.

References:

Sunday, September 18, 2016

Odoo 9: backup using wget

Additional requirement:

  • zip & unzip
  • rsync
  • openssh
URL to backup Odoo is https://[your_ip]//web/database/backup or http://[your_ip]:8069//web/database/backup.
We can use wget to backup Odoo from localhost or from remote without interrupting Odoo service.

for local server

# wget --post-data 'master_pwd=yourpassword&name=yourdatabase&backup_format=zip' -O backup.zip http://localhost:8069/web/database/backup

for remote server (Not Recomended: your password will send through internet in plain text)

# wget --post-data 'master_pwd=yourpassword&name=yourdatabase&backup_format=zip' -O backup.zip http://[your_ip]:8069/web/database/backup

for remote server via https reverse proxy

# wget --post-data 'master_pwd=yourpassword&name=yourdatabase&backup_format=zip' --no-check-certificate -O backup.zip https://[your_ip]/web/database/backup

Backup Option:

  • Use backup_format=zip to backup database and filestore
  • Use backup_format=dump to backup database only

Now we can create bash file to make it easier to backup

# vi myodoobackup.sh
#!/bin/bash
## created by dedetok Sept 2016
## last update 2016-09-21
## GNU GPL v3
# create file name
now=$(date +"%Y-%m-%d")
mfname="backup_$now.zip"
#echo "$mfname"
# perform Odoo backup to output file $mfname
wget --post-data "master_pwd=yourpassword&name=yourdatabase&backup_format=zip" --no-check-certificate -O "$mfname" https://[your_ip]/web/database/backup

The file name of the output will be backup_2016-09-18.zip.
If you use local server you can use http://localhost:8069//web/database/backup

Backup to remote server

You can synchronized your backup using rsync. You need to install rsync in host and remote server.
You need to create key in your host and put it in remote read here

Synchronized without delete (exist in remote but not exist in host)

$ rsync -avzh -e "ssh -p 22" /home/foo/test/ bar@SERVER_B:/home/bar/test/
sending incremental file list
./
test.txt

sent 389 bytes  received 38 bytes  854.00 bytes/sec
total size is 395  speedup is 0.93

Synchronized with delete (delete any file in remote folder if not exist in host)

$ rsync -avzh --delete -e "ssh -p 22" /home/foo/test/ bar@SERVER_B:/home/bar/test/

Modification bash script

#!/bin/bash
## created by dedetok Sept 2016
## last update 2016-09-18
## GNU GPL v3
now=$(date +"%Y-%m-%d")
dbname="dbname"
dbserver="localhost"
dbpass="dbpassword"
dbmode="zip"
mfname="full_"$dbname"_"$now".zip"
echo "backup $dbname @ $dbserver mode $dbmode into $mfname"
wget --post-data "master_pwd=$dbpass&name=$dbname&backup_format=$dbmode" --no-check-certificate -O "$mfname" "http://$dbserver:8069/web/database/backup"
# synchronized to remote
echo "syncronized backup to REMOTE_B"
rsync -avzh --delete -e "ssh -p 22" /home/foo/ bar@REMOTE_B:/home/bar/
Note: Single quotes won't interpolate anything, but double quotes will (for example variables, backticks, certain \ escapes, etc...)
"test $parm" equal to 'test '$parm

References:

Wednesday, September 14, 2016

Odoo 9 Apache2 Reverse Proxy SSL

Prerequisite: Apache2 enabled
Enabling Apache2 module
# a2enmod proxy_http headers remoteip rewrite
To enable Apache2 cache to disk
# a2enmod cache cache_disk
Edit Default Virtual Host for SSL
# vi /etc/apache2/sites-available/default-ssl.conf
...
ProxyRequests off
SSLProxyEngine on
SSLEngine on
RequestHeader set "X-Forwarded-Proto" "https"
SetEnv proxy-nokeepalive 1
Proxypass "/" "http://localhost:8069/" # 127.0.0.1
ProxyPassReverse "/" "http://localhost:8069/" # 127.0.0.1
ProxyErrorOverride off
...
Restart Apache2
# /etc/init.d/apache2 restart
Run Odoo for localhost only
# vi /etc/odoo/openerp-server.conf
...
proxy_mode = true
xmlrpc_interface = 127.0.0.1
...
Restart Odoo
# /etc/init.d/odoo restart
References:

Tuesday, June 14, 2016

Odoo: Installation problems

Symptom: FATAL:  role "odoo" does not exist

Solution:

You need to create postgresql user with name odoo. As root create postgresql user:
# su - postgres -c "createuser -s odoo"

Symptom: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)

Solution:

Alter postgresql encoding.

# su postgres

$ psql postgres
psql (9.6.4)
Type "help" for help.

postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0" as user "postgres".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
template0=# drop database template1;
DROP DATABASE
template0=# create database template1 with template = template0 encoding = 'UTF8';
CREATE DATABASE
template0=# update pg_database set datistemplate = TRUE where datname = 'template1';
UPDATE 1
template0=# \c template1
You are now connected to database "template1" as user "postgres".
template1=# update pg_database set datallowconn = FALSE where datname = 'template0';
UPDATE 1
template1=# \q


References:

Tuesday, July 7, 2015

Installing ODOO 8 in Debian

Odoo was formerly known as OpenERP until May 2014. It was rebranded because version 8 of the software included apps including website builder, e-commerce, point of sale and business intelligence. The software conforms to standard expectations of ERP systems, while providing additional modules beyond the coverage of traditional ERP systems.
These are steps to install ODOO/OpenERP version 8 (latest release) in Debian (in my case):
  1. Add this into your /etc/apt/sources.list
    deb http://nightly.odoo.com/8.0/nightly/deb/ ./
    or
    deb http://nightly.odoo.com/master/nightly/deb/ ./
  2. Install odoo key
    # wget https://nightly.odoo.com/odoo.key
    # apt-key add odoo.key
  3. update by run this command
    sudo apt-get update
  4. install ODOO 8 by run this command
    sudo apt-get install odoo
Source: http://nightly.odoo.com/

Installing Openerp 6.1 on Debian 7.1 x64 (old)

Follow these simple step to install and configure Openerp on Debian
1. update your debian
# apt-get update
# apt-get upgrade

2. install gedit
# apt-get install gedit
3. install postgresql 23.9M (version 9.1.9-1)
# apt-get install postgresql

optional install pgadmin3 if use desktop
# apt-get install pgadmin3
4. configure openerp user
# sudo su postgres
$ createuser openerp
as superuser n
create database y
create new roles y
$ psql -l
$ psql template1
# alter role openerp with password 'openerp';
quit from psql and back to root user (\q enter)
5. install python library
apt-get install python-dateutil python-feedparser python-gdata python-ldap \
    python-libxslt1 python-lxml python-mako python-openid python-psycopg2 \
    python-pybabel python-pychart python-pydot python-pyparsing python-reportlab \
    python-simplejson python-tz python-vatnumber python-vobject python-webdav \
    python-werkzeug python-xlwt python-yaml python-zsi


6. download packaged deb and install by issuing this
# dpkg -i openerp_6.1-latest-1_all.deb
it may take sometimes to install pyhton library required by openerp, wait until it finish.

7. edit file /etc/openerp/openerp-server.conf (password in stap 4)
db_password = openerp

8. run openerp service by issuing
# service openerp start

# service openerp restart

9. run openerp client using browser http://localhost:8069

Note:
Default Installation located at
  • /usr/lib/pymodules/python2.7/openerp/
  • /usr/share/pyshared/openerp

  • /usr/lib/pymodules/python2.7/openerp/addons
  • /usr/share/pyshared/openerp/html_view

OpenERP 6.1: Disable Developer Mode (old)

Create a module and create an xml file named base.xml in the following path disable_developer_mode/static/src/xml/base.xml (where disable_developer_mode is the new module created) and add the following to the base.xml file.
<templates id="base.template" xml:space="preserve">

<t t-extend="ViewManagerAction">
    <t t-jquery="select.oe_debug_view" t-operation="replace">
        <select t-if="self.session.uid === 1 and self.session.debug" class="oe_debug_view"/>
    </t>

</t>
</templates>
Here self.session.uid === 1 is given where 1 is the id of the admin, if it is different in your system check the database and edit it. Add the base.xml file in the disable_developer_mode's __openerp__.py file as the folowing
{
    'name': 'Disable Developer Mode',
    'version': '0.1',
    'category': 'Others',
    'sequence': 20,
    'summary': 'Disable Developer Mode',
    'description': """
Disable Developer Mode
==================
    """,
    'author': 'Gopakumar N G',
    'website': 'http://zbeanztech.com/blogs/nggopakumar',
    'images': [],
    'depends': ['base'],
    'data': [],
    'demo': [],
    'test':[],
    'installable': True,
    'application': False,
    'js': [],
    'css' : [],
    'qweb' : ["static/src/xml/base.xml"]
}
Update your module and restart the server, now the debugging drop-down box will not be shown for all users except admin.

Ref: http://help.openerp.com/question/32065/how-to-deactivate-developer-mode-in-openerp-61-for-all-users-except-admin/