Jun 25, 2019

aerolib aero report and openoffice odoo 11


INSTALL AEROOLIB

cd ~
wget https://launchpad.net/aeroolib/trunk/1.0.0/+download/aeroolib.tar.gz
tar xfvz aeroolib.tar.gz 
cd aeroolib
sudo python setup.py install

*https://github.com/Numigi/aeroo_reports 

INSTALL OPENOFFICE

sudo add-apt-repository ppa:libreoffice/ppa

apt-get install libreoffice libreoffice-writer 
OR
sudo apt-get install openoffice.org-headless openoffice.org-writer openoffice.org-draw
sudo nano /etc/init.d/openoffice.sh
Paste the following code into that file:

#!/bin/bash
# openoffice.org headless server script
#
# chkconfig: 2345 80 30
# description: headless openoffice server script
# processname: openoffice
#
# Author: Vic Vijayakumar
# Modified by Federico Ch. Tomasczik
#
OOo_HOME=/usr/bin
SOFFICE_PATH=$OOo_HOME/soffice
PIDFILE=/var/run/openoffice-server.pid

set -e

case "$1" in
start)
if [ -f $PIDFILE ]; then
echo "OpenOffice headless server has already started."
sleep 5
exit
fi
echo "Starting OpenOffice headless server"
$SOFFICE_PATH -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1
touch $PIDFILE
;;
stop)
if [ -f $PIDFILE ]; then
echo "Stopping OpenOffice headless server."
killall -9 soffice && killall -9 soffice.bin
rm -f $PIDFILE
exit
fi
echo "Openoffice headless server is not running."
exit
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0

 Exit the nano text editor saving the file as you do. 

Now make the script executable:

sudo chmod 0755 /etc/init.d/openoffice.sh
Make it start automatically on reboot by executing this command:

sudo update-rc.d openoffice.sh defaults
Now start the service by running

sudo /etc/init.d/openoffice.sh start

INSTALL AEROREPORT

sudo apt-get install python-setuptools

sudo apt-get install python-genshi python-cairo python-lxml -y

sudo apt-get install libreoffice-script-provider-python -y

sudo mkdir /opt/aeroo

cd /opt/aeroo

git clone https://github.com/aeroo/aeroolib.git

cd /opt/aeroo/aeroolib

sudo python3 setup.py install

wget git clone https://github.com/aeroo/currency2text.git

cd /opt/aeroo/currency2text

sudo python3 setup.py install

sudo apt-get install python3-pip

sudo pip3 install jsonrpc2 daemonize

cd /opt/aeroo

sudo git clone https://github.com/aeroo/aeroo_docs.git

sudo python3 /opt/aeroo/aeroo_docs/aeroo-docs start -c /etc/aeroo-docs.conf

sudo cp /opt/aeroo/aeroo_docs/aeroo-docs /etc/init.d/aeroo-docs

sudo update-rc.d aeroo-docs defaults

sudo service aeroo-docs start



sudo chmod 0755 /etc/init.d/openoffice.sh
sudo chmod 0755 /etc/init.d/aeroo-docs 

TESTING

goto  setting, technical, Aerodoc connection, test connect

taraaaa.....





refs : 
*http://weltbilder.forumnews.com/cBUZZ.IO/aeroo_reports/src/branch/master?lang=zh-CN 
*https://serpentcs.com/serpentcs-setup-aeroo-report-engine-for-openerp-272
*http://www.hitechnologia.com/forum/odoo-forum-1/question/odoo-openerp-how-to-setup-install-configure-aeroo-reports-in-odoo-openerp-v8-148 



Read more ...

Jun 15, 2019

odoo chat without refresh

its just reminder about the chat on odoo use 8072

first please check port services by netstat, if still none, just do as this reference

Longpolling

 Longpolling is a way to deliver instant notification to web client (e.g. in chats).

 To activate longpolling:

 install dependencies

 odoo 11.0

 python -c "import gevent" || sudo pip3 install gevent

odoo 10.0

 python -c "import gevent" || sudo pip install gevent
 python -c "import psycogreen" || sudo pip install psycogreen
 set non-zero value for workers parameter
 configure nginx

 location /longpolling {
     proxy_pass http://127.0.0.1:8072;
 }
 location / {
     proxy_pass http://127.0.0.1:8069;
 }



refs : https://odoo-development.readthedocs.io/en/latest/admin/longpolling.html

Read more ...

May 9, 2019

odoo roman legend


just simple modify your sequence by this :



    def _get_prefix_suffix(self):
        def _interpolate(s, d):
            return (s % d) if s else ''

        def _int_to_roman(input):
            ints = (1000, 900,  500, 400, 100,  90, 50,  40, 10,  9,   5,  4,   1)
            nums = ('M',  'CM', 'D', 'CD','C', 'XC','L','XL','X','IX','V','IV','I')
            result = ""
            for i in range(len(ints)):
                count = int(input / ints[i])
                result += nums[i] * count
                input -= ints[i] * count
            return result

        def _interpolation_dict():
            now = range_date = effective_date = datetime.now(pytz.timezone(self._context.get('tz') or 'UTC'))
            if self._context.get('ir_sequence_date'):
                effective_date = datetime.strptime(self._context.get('ir_sequence_date'), '%Y-%m-%d')
            if self._context.get('ir_sequence_date_range'):
                range_date = datetime.strptime(self._context.get('ir_sequence_date_range'), '%Y-%m-%d')

            sequences = {
                'ryear': '%Y', 'rmonth': '%m','year': '%Y', 'month': '%m', 'day': '%d', 'y': '%y', 'doy': '%j', 'woy': '%W',
                'weekday': '%w', 'h24': '%H', 'h12': '%I', 'min': '%M', 'sec': '%S'
            }
            res = {}
            for key, format in sequences.items():
                if key in ['ryear', 'rmonth']:
                    res[key] = _int_to_roman(int(effective_date.strftime(format)))
                    res['range_' + key] = _int_to_roman(int(range_date.strftime(format)))
                    res['current_' + key] =_int_to_roman(int(now.strftime(format)))
                else:
                    res[key] = effective_date.strftime(format)
                    res['range_' + key] = range_date.strftime(format)
                    res['current_' + key] = now.strftime(format)


            return res
Read more ...

Nov 27, 2018

odoo manual hide validate movement when "double-post" initial demand operations.

odoo manual hide validate movement when "double-post" initial demand operations.



<script>
        if (odoo.session_info["is_superuser"]==false) {
        $(document).bind('DOMSubtreeModified', function () {
               $('.o_list_number').each(function() {
                   if ($(this).data('field')=="weigh_pcs"){
                       if ($(this).text()=="1,000") {
                           $('span:contains("Validate")').parent().addClass("o_form_invisible");
                           alert("Mohon di check ulang data yang double, lalu refresh sebelum  validate ");
                       }
                   }
        
               });
        });
        }
        </script>
Read more ...

Sep 22, 2018

solved install nodejs but can not update npm module

the solution is
install nodejs without npm

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.
Run the following commands to remove all existing global npm modules, uninstall node & npm, re-install node with the correct defaults, configure the location for global npm modules to be installed, and then install npm as its own pacakge.
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sh
Node and npm should be correctly installed at this point. The final step is to add ~/.npm-packages/bin to your PATH so npm and global npm packages are usable. To do this, add the following line to your ~/.bash_profile:
export PATH="$HOME/.npm-packages/bin:$PATH"
Now you can re-install any global npm packages you need without any problems.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:
$ npm update npm -g
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.4.4
npm http 304 https://registry.npmjs.org/npm/1.4.4
npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
npm ERR! error rolling back     at clobberFail (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:57:12)
npm ERR! error rolling back     at next (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:43:14)
npm ERR! error rolling back     at /usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:52:12
npm ERR! error rolling back     at Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back  npm@1.4.4 { [Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm] code: 'EEXIST', path: '/usr/local/bin/npm' }
npm ERR! Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
File exists: /usr/local/bin/npm
Move it away, and try again. 

npm ERR! System Darwin 13.1.0
npm ERR! command "/usr/local/Cellar/node/0.10.26/bin/node" "/usr/local/bin/npm" "update" "npm" "-g"
npm ERR! cwd /Users/dan/Google Drive/Projects/dotfiles
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/bin/npm
npm ERR! code EEXIST
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/dan/Google Drive/Projects/dotfiles/npm-debug.log
npm ERR! not ok code 0

There's an NPM bug for this exact problem. The bug has been "fixed" by Homebrew installing npm in a way that allows it to manage itself once the install is complete. However, this is error-prone and still seems to cause problems for some people. The root of the the issue is really that npm is its own package manager and it is therefore better to have npm manage itself and its packages completely on its own instead of letting Homebrew do it.

Also, using the Homebrew installation of npm will require you to use sudo when installing global packages. Since one of the core ideas behind Homebrew is that apps can be installed without giving them root access, this is a bad idea.

about rimraf, this is solution :



# Create a script somewhere in your $PATH
echo 'exec rm -rf "$@"' >> /usr/local/bin/rimraf

# Make it executable
chmod +x /usr/local/bin/rimraf


taken from : https://gist.github.com/DanHerbert/9520689 

Read more ...