setup mit report setup, ändern auf ubuntu trusty
parent
d73c53cb3e
commit
a1d621ee8a
|
|
@ -87,6 +87,7 @@ def main():
|
|||
'delete_mail_server',
|
||||
'update_values',
|
||||
'set_sys_params',
|
||||
'setup_reports',
|
||||
]
|
||||
|
||||
if cmd == 'rollout':
|
||||
|
|
|
|||
|
|
@ -208,6 +208,22 @@ class Config():
|
|||
#'sale_order_optional',
|
||||
#'sale_order_reminder',
|
||||
]
|
||||
|
||||
# Setzen das Feld "Attachment" im Report (wenn gesetzt, wird das PDF in den Anhängen gespeichert)
|
||||
timestamp = " + '_' + time.strftime('%Y-%m-%d-%H%M') + '.pdf')"
|
||||
self.reports = {
|
||||
'sale.report_saleorder': "((object.state in ('draft','sent') and 'KV_' or 'AB_') + object.name" + timestamp,
|
||||
'cam_reports.report_saleorder_ohne': "((object.state in ('draft','sent') and 'KV_' or 'AB_') + object.name" + timestamp,
|
||||
'cam_reports.report_porto_anforderung': "('PV_' + object.name " + timestamp,
|
||||
'cam_reports.report_porto_anforderung_ohne': "('PV_' + object.name " + timestamp,
|
||||
'account.report_invoice': "(object.state in ('open','paid')) and ('RE_'+(object.number or '').replace('/','')" + timestamp,
|
||||
'cam_reports.report_invoices_ohne': "(object.state in ('open','paid')) and ('RE_'+(object.number or '').replace('/','')" + timestamp,
|
||||
'cam_reports.report_porto_rechnung': "(object.state in ('open','paid')) and ('RE_'+(object.number or '').replace('/','')" + timestamp,
|
||||
'cam_reports.report_porto_rechnung_ohne': "(object.state in ('open','paid')) and ('RE_'+(object.number or '').replace('/','')" + timestamp,
|
||||
'purchase.report_purchasequotation': "('AN_' + object.name" + timestamp,
|
||||
'purchase.report_purchaseorder': "('B_' + object.name" + timestamp,
|
||||
'cam_reports.report_purchaseorder_ohne': "('B_' + object.name" + timestamp,
|
||||
}
|
||||
|
||||
self.users_file = "res.users.csv"
|
||||
|
||||
|
|
|
|||
|
|
@ -669,4 +669,15 @@ class CamadeusFunctions():
|
|||
self._execute('ir.config_parameter', 'write', param_ids, vals)
|
||||
else:
|
||||
self._execute('ir.config_parameter', 'create', vals)
|
||||
return True
|
||||
|
||||
def setup_reports(self):
|
||||
"""Berichte konfigurieren"""
|
||||
|
||||
for report, attachment in self.config.reports.items():
|
||||
r_ids = self._execute('ir.actions.report.xml', 'search', [('report_name','=',report)])
|
||||
if r_ids:
|
||||
self._execute('ir.actions.report.xml', 'write', r_ids, {'attachment': attachment})
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
Binary file not shown.
|
|
@ -64,6 +64,7 @@ class odoo {
|
|||
'bzr',
|
||||
'git',
|
||||
'nginx',
|
||||
'ntp',
|
||||
'poppler-utils',
|
||||
'postgresql',
|
||||
'python-dateutil',
|
||||
|
|
@ -99,7 +100,7 @@ class odoo {
|
|||
'python-simplejson',
|
||||
'python-tz',
|
||||
'python-unittest2',
|
||||
'python-vatnumber',
|
||||
#'python-vatnumber',
|
||||
'python-vobject',
|
||||
'python-webdav',
|
||||
'python-werkzeug',
|
||||
|
|
@ -115,25 +116,25 @@ class odoo {
|
|||
}
|
||||
|
||||
|
||||
# file { 'wkhtmltox-0.12.2.1_linux-wheezy-amd64.deb':
|
||||
# name => "/tmp/wkhtmltox-0.12.2.1_linux-wheezy-amd64.deb",
|
||||
# owner => root,
|
||||
# group => root,
|
||||
# source => "puppet:///modules/odoo/wkhtmltox-0.12.2.1_linux-wheezy-amd64.deb"
|
||||
# }
|
||||
|
||||
# package { 'wkhtmltox':
|
||||
# provider => dpkg,
|
||||
# ensure => installed,
|
||||
# source => "/tmp/wkhtmltox-0.12.2.1_linux-wheezy-amd64.deb",
|
||||
# require => [File['wkhtmltox-0.12.2.1_linux-wheezy-amd64.deb'],Package['xfonts-base']],
|
||||
# }
|
||||
file { 'wkhtmltox':
|
||||
name => "/tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb",
|
||||
owner => root,
|
||||
group => root,
|
||||
source => "puppet:///modules/odoo/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb"
|
||||
}
|
||||
|
||||
package { 'wkhtmltox':
|
||||
provider => dpkg,
|
||||
ensure => installed,
|
||||
source => "/tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb",
|
||||
require => [File['wkhtmltopdf'],Package['xfonts-base']],
|
||||
}
|
||||
|
||||
package {['passlib',
|
||||
'psycogreen',
|
||||
'gdata',
|
||||
'requests',
|
||||
'setproctitle',
|
||||
'vatnumber',
|
||||
]:
|
||||
ensure => installed,
|
||||
provider => 'pip',
|
||||
|
|
@ -183,7 +184,7 @@ class odoo {
|
|||
mode => '0600',
|
||||
ensure => present,
|
||||
content => template('odoo/default.nginx.erb'),
|
||||
notify => Package['nginx'],
|
||||
notify => Service['nginx'],
|
||||
}
|
||||
|
||||
# NGINX SSL
|
||||
|
|
@ -390,7 +391,7 @@ git --work-tree=/home/$instance/ext --git-dir=/home/$instance/ext.git checkout -
|
|||
postgresql::server::role { "$instance":
|
||||
password_hash => postgresql_password($instance, $db_pw),
|
||||
createdb => true,
|
||||
require => Exec['utf8 postgres'],
|
||||
# require => Exec['utf8 postgres'],
|
||||
}
|
||||
|
||||
# NGINX
|
||||
|
|
|
|||
Loading…
Reference in New Issue