verbesserungen

develop
Andreas Brückl 2015-04-23 16:48:13 +02:00
parent 9b11951014
commit 4f3ec7e0e0
8 changed files with 67 additions and 6 deletions

View File

@ -64,6 +64,7 @@ def main():
'setup_journals',
'set_currencies',
'set_decimal_price',
'set_default_values',
'set_translations',
'set_default_removal_strategy',

View File

@ -184,3 +184,7 @@ class Config():
self.translation_files = [
"ir.translation.csv"
]
self.default_values = [ # ir.values
#('product.template', 'type', 'service'),
]

View File

@ -508,6 +508,12 @@ class CamadeusFunctions():
res = self._execute('decimal.precision', 'write', [decimal_id], {'digits': self.config.uom_decimals})
if not res:
return False
# UOS
decimal_id = self._execute('ir.model.data', 'xmlid_to_res_id', 'product.decimal_product_uos')
res = self._execute('decimal.precision', 'write', [decimal_id], {'digits': self.config.uom_decimals})
if not res:
return False
# Product Price
decimal_id = self._execute('ir.model.data', 'xmlid_to_res_id', 'product.decimal_price')
@ -605,3 +611,21 @@ class CamadeusFunctions():
return self._execute('stock.location', 'write', stock_id,{'removal_strategy_id':strategy_ids[0]})
return False
def set_default_values(self):
"""Defaultwerte für Dokumente setzen"""
for model,field,value in self.config.default_values:
vals = {
'name': field,
'model': model,
'value_unpickle': value,
'key': 'default',
'key2': False,
}
domain = [('name','=',field),('model','=',model)]
val_ids = self._execute('ir.values', 'search', domain)
if val_ids:
self._execute('ir.values', 'write', val_ids, vals)
else:
self._execute('ir.values', 'create', vals)
return True

View File

@ -166,10 +166,21 @@ class odoo {
mydomain => 'camadeus.at',
mydestination => "\$myhostname, localhost.\$mydomain, localhost, $fqdn",
inet_interfaces => 'localhost',
}
}
# Default nginx file (prevent default server) REQUIRES SSL-key!!!
# Conf file
file { "/etc/nginx/conf.d/default.conf":
owner => 'www-data',
group => 'www-data',
mode => '0600',
ensure => present,
content => template('odoo/default.nginx.erb'),
notify => Package['nginx'],
}
}
define odoo::instance ($db_pw,$ssl = false, $servername, $odooport, $odooport_logpolling) {
define odoo::instance ($db_pw,$ssl = false, $servername, $odooport, $odooport_longpolling) {
$instance = $title
@ -370,6 +381,7 @@ git --work-tree=/home/$instance/ext --git-dir=/home/$instance/ext.git checkout -
unless => $key_file_test,
path => ['/bin', '/sbin', '/usr/bin', '/usr/sbin'],
notify => Service['nginx'],
require => Package[nginx],
}
}
@ -380,6 +392,7 @@ git --work-tree=/home/$instance/ext --git-dir=/home/$instance/ext.git checkout -
mode => '0600',
ensure => present,
content => template('odoo/odoo.nginx.erb'),
require => Package[nginx],
notify => Service['nginx'],
}
}

View File

@ -0,0 +1,19 @@
server {
listen 80 default_server;
return 444;
server_name _;
}
#server {
# listen 443 ssl default_server;
# return 444;
# server_name _;
# THIS IS REQUIRED FOR SSL!!!!
#ssl_certificate /etc/nginx/ssl/camadeus.at.crt;
#ssl_certificate_key /etc/nginx/ssl/camadeus.at.key;
#ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers HIGH:!aNULL:!MD5;
#}

View File

@ -29,7 +29,7 @@ PIDFILE=/var/run/$NAME.pid
LOGFILE=/var/log/odoo/<%= @instance %>/odoo-server.log
# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c $CONFIGFILE --db-filter $FILTER --xmlrpc-port <%= @odooport %> --longpolling-port <%= @odooport_logpolling %> --logfile $LOGFILE"
DAEMON_OPTS="-c $CONFIGFILE --db-filter $FILTER --xmlrpc-port <%= @odooport %> --longpolling-port <%= @odooport_longpolling %> --logfile $LOGFILE"
[ -x $DAEMON ] || exit 0
[ -f $CONFIGFILE ] || exit 0

View File

@ -21,7 +21,7 @@ TYPE=$1
USER=root
if [ "$TYPE" = "init" ]; then
ssh ${USER}@$HOST "sudo echo '$HOST' > /etc/hostname; sudo /etc/init.d/hostname.sh start; sudo apt-get update; sudo apt-get install puppet;"
ssh ${USER}@$HOST "apt-get update; apt-get install puppet; sudo echo '$HOST' > /etc/hostname; sudo /etc/init.d/hostname.sh start;"
ssh ${USER}@${HOST} "sudo apt-get install rsync"
ssh ${USER}@${HOST} "sudo puppet module install puppetlabs-postgresql"
ssh ${USER}@${HOST} "sudo puppet module install saz-sudo"

View File

@ -5,9 +5,9 @@ node default {
odoo::instance {'TODO':
db_pw => 'x54ef6t77t6ZZul3',
ssl => true,
servername => 'TODO',
servername => 'TODO.camadeus.at',
odooport => 8069,
odooport_logpolling => 8070,
odooport_longpolling => 8070,
}
}