Monday, October 26, 2015

fix for broken wkhtmltopdf, odoo9, after a while, the confirmation freezed, python shell freeze at wkhtmltopdf;

wkhtmltopdf version
/Library/Caches/Homebrew/wkhtmltopdf-0.9.9.tar.bz2
rm the above
brew doctor
brew update 
then 
brew install wkhtmltopdf
works
Even in cases where cooperation is intended, misunderstandings and personality incompatibilities can result in an extremely chaotic and hostile environment. Catalysts help prevent and resolve misunderstanding, calm the waters when users have difficulties dealing with each other and provide examples of constructive behavior in environments where such behavior might not otherwise be the norm.
reference: 
https://freenode.net/catalysts.shtml
https://mig5.net/content/adding-yubikey-2-factor-authentication-ssh-and-sudo-debian
PATH=/usr/local/bin;
 openerp.addons.report.models.report: Will use the Wkhtmltopdf binary at /usr/local/bin/wkhtmltopdf
  • Grab yourself a copy of fresh wkhtmltopdf
  • Open it and drag to Applications
  • Then cd /usr/local/bin && ln -s /Applications/wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf wkhtmltopdf
  • reference:
  • http://stackoverflow.com/questions/10375168/how-to-install-and-run-wkhtmltopdf-on-mac-osx-10-7-3-for-use-in-a-php-applicatio
my case, 
os 10.10.3
it is installed directly under /usr/local/bin, no need to ln
and this time,
wkhtmltopdf --version

wkhtmltopdf 0.12.2.1 (with patched qt)
this time, checkout confirmation print out fast, no exec pop out, no freeze
symptoms:
after brew uninstall wkhtmltopdf

"No such keg" when uninstalling formula from URL

when instal brew install wkhtmltopdf
Error: MD5 support has been dropped for security reasons.
Please switch this formula to SHA256.

Friday, October 23, 2015

set correct access right to website users

checked out https://apps.openerp.com/apps/modules/8.0/website_sale_suggest_create_account/


This is the user's account page after sign up checkout.


Apps <<'application': true>> in the module definition file (__openerp__.py)
to make a module importable, need to have __init__.py file
# -*- coding: utf-8 -*-
marker telling python interpreter that this field has UTF-8,
it can expect and handle non-ASCII characters.
safer







1 .  remove the public under the user's settings, won't have another sign in after user sign in afready.



2nd time:
created via sign up ( template user) also correct, the book says almost every one owns the employee right, while, with employee after sign in, there would be black admin bar on top. newly signed up template users, no. seems, alright.






remove the inheritance of own leads, under website  user 
,tries to remove the admin bar uncheck employee attribute,

web?#page=0&limit=80&view_type=list&model=mail.followers&action=92&active_id=channel_inbox
permission errors, how come a registered user is able to see that page


actually, has only Addresses in Sales Orders, menus has 12 left only pics are the older setting with more accesses

menus of own leads

Wednesday, October 21, 2015

notes of book https://www.packtpub.com/books/content/support/20017

post-mortem:a ​medical ​examination of a ​dead person's ​body in ​order to ​findout the ​cause of ​death:
http://dictionary.cambridge.org/dictionary/english/post-mortem?q=mortem
https://docs.python.org/2/library/pdb.html#debugger-commands

odoo.py setup_deps #installs odoo system dependencies
odoo.py setup_pg #installs postgres sql & db superuser for unix user
odoofresh.od.dev
creating a user account for Odoo
linux
apt-get update && apt-get upgrade
apt-get install sudo #make sure sudo is installed
useradd -m -g sudo -s /bin/bash odoo #create an ‘odoo’ user with sudo powers
passwd odoo # ask and set a pwd for the new user
-m create home directory
-g sudo adds it to the shudders list, can run commands as root
-s /bin/bash sets the default shell to bash

whoami
echo $HOME
/Users/Jing

initialize a new odoo db from terminal

postgres super user,
.odoo.py setup_pg 
or 
sudo createuser —superuser $(whoami)
wile for mac, seems the os admin is by default the super user of postgres, 
$createdb v8dev
odoo.py -d v8dev #this will load the demo data, if no,
-- without-demo-data=all

if use VM
  1. change VM network type from NAT to bridged,
  2. use NAT, configure port forwarding

$createdb --template=v8dev v8test
create a new db by copying an existing one,make sure do instance is stopped and no connection open on v8dev 
template1 is used by default
psql -l
UTF8 defualt
dropdb v8test

set the odoo github repo as upstream,

record in the EHF payable, 
on the website, shows, on pdf not showing
everything shows under tax, 
while not separated,

./odoo.py --help

session_read 
when uninstall the open academy module, the session_read group got removed too
odoo 8
./odoo.py --save --stop-after-init #save config to .openerp-serverrc file

stop after init option, have server stop after it finishes action
run tests/run a module upgrade to check if it installs correctly

Samba: provides linux file sharing services compatible with windows os, 
sudo apt-get install samba samba-common-bin
need to register user for file share access
sudo smbpasswd -a odoo
sudo vi /etc/samba/smb.conf
to enable write access 
read only = no
sudo /etc/init.d/smbd restart

on windows, 
Map network drive
\\192.168.0.2\odoo
(\odoo needed sometimes if sys auto prepended something)

can add the customized location for modules via 
--add ons-path=“../department, ./addons”

database mapping mechanism is the ORM
xml -> web client framework -> data-aware html views
************************* magento ******************************
 don't save the session it in the db, local.xml it will slow down magentout 

PHP Fatal error:  Call to a member function insert() on a non-object in /Source/zcoder/magento/app/code/core/Mage/Core/Model/Resource/Resource.php on line 133, referer:
*************************************** db ***************************************************************
The database combines two data structures to meet the challenge: a doubly linked list and a search tree. These two structures explain most of the database’s performance characteristics.

doubly: twice as much, or very much more:

Databases use doubly linked lists to connect the so-called index leaf nodes. Each leaf node is stored in a database block or page; that is, the database’s smallest storage unit. All index blocks are of the same size—typically a few kilobytes. 

reference: http://use-the-index-luke.com/sql/anatomy
http://dictionary.cambridge.org/dictionary/english/doubly?q=doubly+

./odoo.py —xmlrpc-port=8070

create multiple odoo9 instances; postgres start stop;



git clone --depth 1 https://github.com/odoo/odoo.git -b 9.0 odoofresh
/etc/vhosts add
no restart needed
subdomain is the db name,
python openerp-server -c openerp-server.conf
curl -s -D - http://odoo9.od.dev:9069/

Canada - Accounting

first module to install, before install any modules
to be able to check outhttp://odoo.od.dev:8069/ 500 internal server error
this instance failed due to the messed up steps here
chmod +x /usr/local/bin/brew-services.rb
brew services stop postgresql
brew services start postgresql
lunchy start postgres
lunchy stop postgres

Tuesday, October 13, 2015

odoo pycharm config, create apache pwd to access the site; multiple dbs with odoo;install multiple odoo instances on local, db filter, subdomain; odoo back end set up

better not use django for ecommerce
for selling digital stuff, like selling how much storage each insitution needs,
need api, use strip
otherwise, for purchasing
for low volume, both are 3%
######################################################################
pycharm, add the /usr/local/bin env path so that the libs installed such as lessc can be found
Odoo 8 can set up configrable public category tree, paypal is fine
######################################################################
encrypt the apache pwd:then put it in to .htpasswd
############### if set up multiple dbs with odoo ###############
do not install ecommerce, 
otherwise have to use the dbfilter (conf, regex to call the configs in the /etc/host
in etc/host 
have to use the db name as the domain name
do not touch the core: 
openerp addons -> base -> res
pycharm: Edit configuration:
script: /user/jing/Sites/odoo/openerp-server
script paramters: -c openerp-server.conf
env path
add PATH=/usr/local/bin
python interpreter ~/Sites/odoo-env
working dir root dir
######################################################################
https://github.com/odoo/odoo.git
multiple installation 
git clone --depth 1 https://github.com/odoo/odoo.git odoo9
db name is my subdomain
/etc/hosts
127.0.0.1    odoo.od.dev
127.0.0.1    odoo9.od.dev
add the 
db_filter = ^%d$
xmlrpc_port = 9069
proxy not needed, only if behind apache or nginx
into the openerp-server.conf file, 
same command to start the server:
loaded the old odoo database

http://odoo9.od.dev:9069/web/database/manager

delete the db, 

then create a new db called odour

after wards, 

go to the apps backend control panel

search Canada

install Accounting Canada first

######################################################################

cached browsers, clear the cache, then select db first

admin jing apps: ecommerce only after install commerce have a front end site to purchase have home page
Add COD and PO number

######################################################################


not restore the db yet:

create a duplicated db:

Applications/pgAdmin3.app/Contents/SharedSupport/pg_dump --host localhost --port 5432 --username “jing" --no-password  --format custom --verbose --file "/Users/jing/Documents/odoobackup" "odoo"

http://get.enterprisedb.com/docs/Tutorial_All_PP_pgAdmin_Backup_Restore.pdf

Friday, October 2, 2015

Install Odoo 9.0 mac (same as Odoo 8.0)

brew update
brew install python
brew install postgresql
/usr/local/Cellar/postgresql/9.4.4: 3014 files, 40M
# ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
# launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
brew install freetype jpeg libpng libtiff webp xz
pip install virtualenv
cd ~/Sites
virtualenv odoo-env
. odoo-env/bin/activate
################################################################################
if opened the new terminal has to activate the env
. ~Sites/odoo-env/bin/activate
or . odoo-env/bin/activate    depend on where u r
###################################################
which python
python-2.7.10_2
/usr/local/Cellar/python/2.7.10_2

git clone --depth 1 --branch 9.0 https://github.com/odoo/odoo.git odoo

cd Sites/odoo
pip install -r requirements.txt
pip install flanker
pip install ofxparser


cp debian openerp-server.conf ../openerp-server.conf
[options]
; This is the password that allows database operations:
dmin_passwd = admin
db_host = localhost
db_port = 5432
db_user = jing
db_password = jingforeveryoung
addons_path = /Users/Sites/odoo/addons
afterwards can change the pwd for the os, have the postgress still use the old pwd
new pwd also can connect to postgres
not sure about after sys restart

python openerp-server -c openerp-server.conf



https://www.odoo.com/forum/help-1/question/how-can-i-install-odoo-9-88323
ps aux |grep postgres


##########################could no execute command "lessc"
brew install node
/usr/local/Cellar/node/

npm install -g less

/usr/local/bin/lessc -> /usr/local/lib/node_modules/less/bin/lessc
less@2.5.3 /usr/local/lib/node_modules/less

npm install -g less-plugin-clean-css

less-plugin-clean-css@1.5.1 /usr/local/lib/node_modules/less-plugin-clean-css

to update node:
brew update
brew upgrade node
 to uninstall
brew uninstall node

after installing, need to wipe out the db, re create to have less take effect
( after the wizard, would not show manage database for other browsers on the login page)
##################### python related libs #############################
sudo pip install sorl-thumbnail 
aptitude cache |grep
easy_install memcache



#########################do not do this, installed a lot extensions libs too ##############
with the graphical install
/Library/PostgreSQL/9.4
/Library/PostgreSQL/9.4/data
superuser: postgres jing
graphical uninstall
sudo /Library/PostgreSQL/9.4/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh

The data directory (/Library/PostgreSQL/9.4/data) and service user account (postgres) have not been removed.
sudo rm -rf /Library/PostgreSQL
sudo rm /etc/postgres-reg.ini
  1. Remove the PostgreSQL userSystem Preferences -> Users & Groups
    Unlock the settings panel by clicking on the padlock and enter your password
    Select the PostgreSQL user and click on the minus button.
    sudo /Library/pgAgent/uninstall-pgagent.app/Contents/MacOS/installbuilder.sh
the pageant schema and user account not removed

http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/
http://www.postgresql.org/download/macosx/
pgBounce listening port 6432