Created dir structure, imported files from cam-int and whole cam-ext
|
|
@ -0,0 +1,4 @@
|
|||
*.pyc
|
||||
.project
|
||||
.pydevproject
|
||||
.settings
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
[options]
|
||||
|
||||
xmlrpc_port = 8080
|
||||
; This is the password that allows database operations:
|
||||
; admin_passwd = admin
|
||||
db_host = False
|
||||
db_port = 5436
|
||||
db_user = False
|
||||
db_password = False
|
||||
|
||||
addons_path = odoo/addons,ext/addons
|
||||
timezone = Europe/Brussels
|
||||
|
||||
dbfilter_test = ['.*',]
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
/var/log/odoo/*.log {
|
||||
copytruncate
|
||||
missingok
|
||||
notifempty
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
server_name "xxxxx";
|
||||
|
||||
# Strict Transport Security
|
||||
# add_header Strict-Transport-Security max-age=2592000;
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
|
||||
upstream odoo-server {
|
||||
server 127.0.0.1:8069 fail_timeout=3000s;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
server_name _;
|
||||
|
||||
|
||||
# Specifies the maximum accepted body size of a client request,
|
||||
# as indicated by the request header Content-Length.
|
||||
client_max_body_size 200m;
|
||||
|
||||
# log files
|
||||
access_log /var/log/nginx/odoo-access.log;
|
||||
error_log /var/log/nginx/odoo-error.log;
|
||||
|
||||
# increase proxy buffer to handle some OpenERP web requests
|
||||
proxy_buffers 16 64k;
|
||||
proxy_buffer_size 128k;
|
||||
|
||||
# SSL config
|
||||
ssl_certificate /etc/nginx/ssl/server.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/server.key;
|
||||
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://odoo-server;
|
||||
# force timeouts if the backend dies
|
||||
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
|
||||
proxy_read_timeout 300s;
|
||||
|
||||
# set headers
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
|
||||
|
||||
# Let the OpenERP web service know that we're using HTTPS, otherwise
|
||||
# it will generate URL using http:// and not https://
|
||||
# proxy_set_header X-Forwarded-Proto https;
|
||||
|
||||
# by default, do not forward anything
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# cache some static data in memory for 60mins.
|
||||
# under heavy load this should relieve stress on the OpenERP web interface a bit.
|
||||
location ~* /web/static/ {
|
||||
proxy_cache_valid 200 60m;
|
||||
proxy_buffering on;
|
||||
expires 864000;
|
||||
proxy_pass http://odoo-server;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
upstream odoo-server {
|
||||
server 127.0.0.1:8069 fail_timeout=3000s;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
|
||||
|
||||
# Specifies the maximum accepted body size of a client request,
|
||||
# as indicated by the request header Content-Length.
|
||||
client_max_body_size 200m;
|
||||
|
||||
# log files
|
||||
access_log /var/log/nginx/odoo-access.log;
|
||||
error_log /var/log/nginx/odoo-error.log;
|
||||
|
||||
# increase proxy buffer to handle some OpenERP web requests
|
||||
proxy_buffers 16 64k;
|
||||
proxy_buffer_size 128k;
|
||||
|
||||
location / {
|
||||
proxy_pass http://odoo-server;
|
||||
# force timeouts if the backend dies
|
||||
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
|
||||
proxy_read_timeout 300s;
|
||||
|
||||
# set headers
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
|
||||
|
||||
# Let the OpenERP web service know that we're using HTTPS, otherwise
|
||||
# it will generate URL using http:// and not https://
|
||||
# proxy_set_header X-Forwarded-Proto https;
|
||||
|
||||
# by default, do not forward anything
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# cache some static data in memory for 60mins.
|
||||
# under heavy load this should relieve stress on the OpenERP web interface a bit.
|
||||
location ~* /web/static/ {
|
||||
proxy_cache_valid 200 60m;
|
||||
proxy_buffering on;
|
||||
expires 864000;
|
||||
proxy_pass http://odoo-server;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
[options]
|
||||
addons_path = /opt/odoo/odoo/addons,/opt/odoo/ext/addons
|
||||
admin_passwd = c76EVdqj
|
||||
|
||||
db_host = False
|
||||
db_name = False
|
||||
db_password = False
|
||||
db_port = False
|
||||
db_user = odoo
|
||||
|
||||
debug_mode = False
|
||||
list_db = True
|
||||
log_level = error
|
||||
logfile = /var/log/odoo/odoo-server.log
|
||||
|
||||
max_cron_threads = 1
|
||||
workers = 1
|
||||
|
||||
xmlrpc_interface = 127.0.0.1
|
||||
xmlrpc_port = 8069
|
||||
|
||||
timezone = Europe/Brussels
|
||||
|
||||
# 5 min
|
||||
#limit_time_cpu = 300
|
||||
# 10 min
|
||||
#limit_time_real = 600
|
||||
|
||||
# input DMI:
|
||||
limit_time_cpu = 3000
|
||||
limit_time_real = 6000
|
||||
|
||||
# if DB > 150MB, otherwise "AccessDenied" error occurs
|
||||
# 10 GB
|
||||
limit_memory_hard = 10000000000
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: odoo-server
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Should-Start: $network
|
||||
# Should-Stop: $network
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Enterprise Resource Management software
|
||||
# Description: Open ERP is a complete ERP and CRM software.
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/local/bin
|
||||
DAEMON=/opt/odoo/odoo/openerp-server
|
||||
NAME=odoo-server
|
||||
DESC=odoo-server
|
||||
|
||||
#FILTER="^%d$"
|
||||
# Specify the user name (Default: openerp).
|
||||
USER=odoo
|
||||
|
||||
# Specify an alternate config file (Default: /etc/openerp-server.conf).
|
||||
CONFIGFILE="/opt/odoo/ext/config/odoo-server.conf"
|
||||
|
||||
# pidfile
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
|
||||
# Additional options that are passed to the Daemon.
|
||||
DAEMON_OPTS="-c $CONFIGFILE"
|
||||
|
||||
[ -x $DAEMON ] || exit 0
|
||||
[ -f $CONFIGFILE ] || exit 0
|
||||
|
||||
checkpid() {
|
||||
[ -f $PIDFILE ] || return 1
|
||||
pid=`cat $PIDFILE`
|
||||
[ -d /proc/$pid ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
echo -n "Starting ${DESC}: "
|
||||
|
||||
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
|
||||
--chuid ${USER} --background --make-pidfile \
|
||||
--exec ${DAEMON} -- ${DAEMON_OPTS}
|
||||
|
||||
echo "${NAME}."
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo -n "Stopping ${DESC}: "
|
||||
|
||||
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
|
||||
--oknodo
|
||||
|
||||
echo "${NAME}."
|
||||
;;
|
||||
|
||||
restart|force-reload)
|
||||
echo -n "Restarting ${DESC}: "
|
||||
|
||||
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
|
||||
--oknodo
|
||||
|
||||
sleep 1
|
||||
|
||||
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
|
||||
--chuid ${USER} --background --make-pidfile \
|
||||
--exec ${DAEMON} -- ${DAEMON_OPTS}
|
||||
|
||||
echo "${NAME}."
|
||||
;;
|
||||
|
||||
*)
|
||||
N=/etc/init.d/${NAME}
|
||||
echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import cam_custom
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Camadeus Anpassungen',
|
||||
'category': 'Custom',
|
||||
'version': '1.0',
|
||||
'description': """Individuelle Anpassungen""",
|
||||
'author': 'camadeus GmbH',
|
||||
'website': 'http://www.camadeus.at',
|
||||
'depends': ['crm','sale','mail','account'],
|
||||
'data': [
|
||||
'cam_custom_view.xml',
|
||||
'cam_custom_data.xml',
|
||||
'views/custom_theme.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import api
|
||||
from openerp.tools.translate import _
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp import tools
|
||||
from lxml import etree
|
||||
|
||||
class res_partner(osv.osv):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
@api.model
|
||||
def fields_view_get_address(self, arch):
|
||||
""" verhindert das Überschreiben von address_format """
|
||||
return arch
|
||||
|
||||
class mail_notification(osv.Model):
|
||||
_inherit = 'mail.notification'
|
||||
|
||||
# override original function
|
||||
def get_signature_footer(self, cr, uid, user_id, res_model=None, res_id=None, context=None, user_signature=True):
|
||||
""" Format a standard footer for notification emails (such as pushed messages
|
||||
notification or invite emails).
|
||||
Format:
|
||||
<p>--<br />
|
||||
Administrator
|
||||
</p>
|
||||
<div>
|
||||
<small>Sent from <a ...>Your Company</a> using <a ...>OpenERP</a>.</small>
|
||||
</div>
|
||||
"""
|
||||
footer = ""
|
||||
if not user_id:
|
||||
return footer
|
||||
|
||||
# add user signature
|
||||
user = self.pool.get("res.users").browse(cr, SUPERUSER_ID, [user_id], context=context)[0]
|
||||
if user_signature:
|
||||
if user.signature:
|
||||
signature = user.signature
|
||||
else:
|
||||
signature = "--<br />%s" % user.name
|
||||
footer = tools.append_content_to_html(footer, signature, plaintext=False)
|
||||
|
||||
# add company signature
|
||||
# if user.company_id.website:
|
||||
# website_url = ('http://%s' % user.company_id.website) if not user.company_id.website.lower().startswith(('http:', 'https:')) \
|
||||
# else user.company_id.website
|
||||
# company = "<a style='color:inherit' href='%s'>%s</a>" % (website_url, user.company_id.name)
|
||||
# else:
|
||||
# company = user.company_id.name
|
||||
# sent_by = _('Sent by %(company)s using %(odoo)s')
|
||||
#
|
||||
# signature_company = '<br /><small>%s</small>' % (sent_by % {
|
||||
# 'company': company,
|
||||
# 'odoo': "<a style='color:inherit' href='https://www.odoo.com/'>Odoo</a>"
|
||||
# })
|
||||
# footer = tools.append_content_to_html(footer, signature_company, plaintext=False, container_tag='div')
|
||||
|
||||
return footer
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="base.action_partner_form" model="ir.actions.act_window">
|
||||
<field name="view_mode">tree,kanban,form</field>
|
||||
</record>
|
||||
|
||||
<record id="base.action_partner_form_view1" model="ir.actions.act_window.view">
|
||||
<field eval="10" name="sequence" />
|
||||
</record>
|
||||
|
||||
<record id="partner_section_form" model="ir.ui.view">
|
||||
<field name="name">partner_section_form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@class='address_format'][1]" position="replace">
|
||||
<div class="address_format">
|
||||
<field name="zip" placeholder="PLZ" style="width: 15%%"/>
|
||||
<field name="city" placeholder="Stadt" style="width: 84%%"/>
|
||||
<field name="state_id" invisible="1"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//form[@string='Contact']//div[@class='address_format']" position="replace">
|
||||
<div class="address_format">
|
||||
<field name="zip" placeholder="PLZ" style="width: 15%%"/>
|
||||
<field name="city" placeholder="Stadt" style="width: 84%%"/>
|
||||
<field name="state_id" invisible="1"/>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Hide product variants -->
|
||||
<record id="product_template_variant_kanban" model="ir.ui.view">
|
||||
<field name="name">product_template_variant_kanban</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<a name="%(product.product_variant_action)d" position="replace"/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="product_template_custom_tree" model="ir.ui.view">
|
||||
<field name="name">product_template_custom_tree</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="before">
|
||||
<field name="default_code"/>
|
||||
</field>
|
||||
<field name="name" position="after">
|
||||
<field name="list_price"/>
|
||||
</field>
|
||||
<field name="state" position="replace"/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product.product_template_action" model="ir.actions.act_window">
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="view_id"></field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,11 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<template id="custom_header" inherit_id="web.layout" name="Custom Header">
|
||||
<xpath expr="//link[@rel='shortcut icon']" position="replace">
|
||||
<link rel="shortcut icon" href="/cam_custom/static/src/img/favicon.ico" type="image/x-icon"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Max. Width for Form View',
|
||||
'category': 'Custom',
|
||||
'version': '1.0',
|
||||
'description': """
|
||||
""",
|
||||
'author': 'camadeus GmbH',
|
||||
'website': 'http://www.camadeus.at',
|
||||
'depends': [],
|
||||
'data': [
|
||||
'views/max_width.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'sequence': 150,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
|
@ -0,0 +1,10 @@
|
|||
.openerp .oe_followers .oe_invite {
|
||||
float: none !important;
|
||||
display: block;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.openerp .oe_form_sheet_width {
|
||||
max-width: 95%;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- vim:fdn=3:
|
||||
-->
|
||||
<openerp>
|
||||
<data>
|
||||
<template id="assets_backend" name="mail assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" href="/cam_max_width/static/src/css/max_width.css"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import cam_reports
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Camadeus Reports',
|
||||
'category': 'Custom',
|
||||
'version': '1.0',
|
||||
'description': """Individuelle Dokumentenvorlagen""",
|
||||
'author': 'camadeus GmbH',
|
||||
'website': 'http://www.camadeus.at',
|
||||
'depends': ['purchase','sale','account','stock'],
|
||||
'data': ['reports_data.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
import openerp.modules as addons
|
||||
import os
|
||||
import base64
|
||||
|
||||
class res_company(osv.osv):
|
||||
_inherit = 'res.company'
|
||||
|
||||
def get_image(self, img):
|
||||
|
||||
def _get_dir():
|
||||
styles_dir = 'pittoresk_reports/static/src/img'
|
||||
adps = addons.module.ad_paths
|
||||
for adp in adps:
|
||||
dir = os.path.join(adp, styles_dir)
|
||||
if os.path.isdir(dir):
|
||||
return dir
|
||||
return False
|
||||
|
||||
def _get_file_data(filename):
|
||||
try:
|
||||
f = open(filename , 'rb')
|
||||
data = base64.b64encode(f.read())
|
||||
f.close()
|
||||
return data
|
||||
except:
|
||||
print "Error openening file '%s'." % (filename)
|
||||
return False
|
||||
|
||||
path = _get_dir()
|
||||
fname = os.path.join(path, img)
|
||||
img_data = _get_file_data(fname)
|
||||
return img_data
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
<reports>
|
||||
<report>account.report_invoice</report>
|
||||
</reports>
|
||||
-->
|
||||
<document filename="Rechnung.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Sale Order" author="Andreas Brückl" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="15.0" y1="42.0" width="539" height="758"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
<story>
|
||||
|
||||
<para>
|
||||
<seqReset id="L1"/>
|
||||
</para>
|
||||
<para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para>
|
||||
|
||||
|
||||
<para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (o.partner_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id and o.partner_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para>
|
||||
|
||||
<blockTable colWidths="90,110" style="Struktur" hAlign="RIGHT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Kundennr.:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.partner_id.ref or removeParentNode('tr') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ihre Referenz:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ansprechpartner:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.user_id and o.user_id.name) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ihre UID:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.vat or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Datum:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ formatLang(o.date_invoice,date = True) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
|
||||
<para style="ueberschrift"><b>Rechnung [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
|
||||
<para style="ueberschrift"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
|
||||
<para style="ueberschrift"><b>Rechnungsentwurf [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
|
||||
<para style="ueberschrift"><b>Stornierte Rechnung [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
|
||||
<para style="ueberschrift"><b>Stornorechnung [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
|
||||
<para style="ueberschrift"><b>Stornorechnung [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
|
||||
<para style="ueberschrift"><b>Rechnung [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
|
||||
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="30,57,203,45,60,40,75" repeatRows="1" style="TabelleHaupt" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="tabelle_header">Pos</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Art-nr.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_links">Bezeichnung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Menge</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_rechts">E-Preis</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_rechts">Gesamtpreis</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>[[repeatIn(o.invoice_line,'line')]]
|
||||
<td>
|
||||
<para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0">
|
||||
<seq id="L1"/>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ line.product_id and line.product_id.default_code or '']]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="tabelle_daten_links">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[formatLang(line.quantity, digits=2)[-2:]=='00' and formatLang(line.quantity, digits=0) or formatLang(line.quantity, digits=2)]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ formatLang(line.price_unit,digits=2) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ line.discount <> 0 and (formatLang(line.discount) + '%') or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ formatLang(line.price_subtotal,digits=2 ) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="210,200,100" style="TabelleSchlussrechnung">
|
||||
<tr>
|
||||
<td>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">Zwischensumme in €</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ formatLang(o.amount_untaxed,digits=2 )]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">MwSt. in €</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ formatLang(o.amount_tax,digits=2 ) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett">Rechnungsbetrag in €</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett">[[ formatLang(o.amount_total,digits=2 ) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<para style="normal">[[ (o.comment or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((o.comment or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="normal">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="110,300" style="Struktur" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Zahlungsbedingungen:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.payment_term and o.payment_term.note) or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
<para style="normal">Vielen Dank für Ihren Auftrag!</para>
|
||||
<spacer length="0.5cm"/>
|
||||
<para style="normal">
|
||||
Bis zur Bezahlung aller Ansprüche aus den Geschäftsverbindungen behält sich der Verkäufer das Eigentum an seinen Warenlieferungen vor. Es gelten unsere Allgemeinen Geschäftsbedingungen.
|
||||
</para>
|
||||
|
||||
|
||||
</story>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<header>
|
||||
<pageTemplate>
|
||||
<frame id="first" x1="1.5cm" y1="4cm" height="21.1cm" width="18.5cm"/>
|
||||
<stylesheet>
|
||||
<!-- Set here the default font to use for all <para> tags -->
|
||||
<paraStyle name='Normal' fontName="Helvetica"/>
|
||||
<paraStyle name="footer" fontName="Helvetica" leading="8" fontSize="7.0" alignment="LEFT"/>
|
||||
<paraStyle name="footer_rechts" fontName="Helvetica" leading="8" fontSize="7.0" alignment="RIGHT"/>
|
||||
<paraStyle name="header_fett" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="header" fontName="Helvetica" fontSize="7.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Absender" fontName="Helvetica" fontSize="7.0" leading="8" alignment="LEFT" spaceAfter="0.0"/>
|
||||
|
||||
<paraStyle name="normal" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" />
|
||||
<paraStyle name="fett" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="ueberschrift" fontName="Helvetica-Bold" fontSize="10.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
|
||||
<paraStyle name="tabelle_header" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER"/>
|
||||
<paraStyle name="tabelle_header_links" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/>
|
||||
<paraStyle name="tabelle_header_rechts" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="tabelle_daten_center" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>
|
||||
<paraStyle name="tabelle_daten_links" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
|
||||
<paraStyle name="tabelle_daten_links_italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT"/>
|
||||
<paraStyle name="tabelle_daten_rechts" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
|
||||
<paraStyle name="schlussrechnung" fontName="Helvetica" fontSize="9.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="schlussrechnung_fett" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="skonto" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT"/>
|
||||
|
||||
<!-- Tabellen -->
|
||||
<blockTableStyle id="Struktur">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockTopPadding length="0"/>
|
||||
<blockBottomPadding length="0"/>
|
||||
<blockLeftPadding length="0"/>
|
||||
<blockRightPadding length="0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="TabelleHaupt">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="MIDDLE"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" thickness="0.5"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0" thickness="1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="-1,-1" thickness="1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="TabelleSchlussrechnung">
|
||||
<blockValign value="MIDDLE"/>
|
||||
</blockTableStyle>
|
||||
</stylesheet>
|
||||
<pageGraphics>
|
||||
<!-- Logo -->
|
||||
<image x="13cm" y="26.75cm" height="46" width="180" preserveAspectRatio="1" >[[ company.logo]]</image>
|
||||
|
||||
<!-- Absenderkopf -->
|
||||
<place x="1.5cm" y="24.5cm" height="1.5cm" width="14cm">
|
||||
<para style="header"><u>[[ company.partner_id.name ]], [[ company.partner_id.street ]], [[ company.partner_id.zip ]] [[ company.partner_id.city ]]</u></para>
|
||||
</place>
|
||||
|
||||
<!-- Seitenzahl -->
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawRightString x="18.9cm" y="3.5cm">Seite <pageNumber/> </drawRightString>
|
||||
|
||||
<!-- Seperator -->
|
||||
<fill color="#000000"/>
|
||||
<rect x="1.4cm" y="3.1cm" width="17.5cm" height="0.01cm" fill="yes" stroke="no"/>
|
||||
|
||||
<!-- Footer links -->
|
||||
<place x="1.5cm" y="0cm" height="3cm" width="7cm">
|
||||
<para style="footer">--</para>
|
||||
<para style="footer">--</para>
|
||||
<para style="footer">--</para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
</place>
|
||||
|
||||
<!-- Footer Mitte -->
|
||||
<place x="8cm" y="0cm" height="3cm" width="7cm">
|
||||
<para style="footer">[[ company.partner_id.street ]]</para>
|
||||
<para style="footer">[[ company.partner_id.zip ]] [[ company.partner_id.city ]]</para>
|
||||
<para style="footer">UID: [[company.vat ]]</para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
</place>
|
||||
|
||||
<!-- Footer rechts -->
|
||||
<place x="15cm" y="0cm" height="3cm" width="7cm">
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
<para style="footer"></para>
|
||||
</place>
|
||||
|
||||
</pageGraphics>
|
||||
|
||||
</pageTemplate>
|
||||
</header>
|
||||
|
|
@ -0,0 +1,246 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
<reports>
|
||||
<report>purchase.report_purchaseorder</report>
|
||||
</reports>
|
||||
-->
|
||||
<document filename="Purchase Quotation.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Purchase Order" author="andreas.brueckl@cmotion.eu" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="15.0" y1="42.0" width="539" height="758"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
<story>
|
||||
<para>
|
||||
<seqReset id="L1"/>
|
||||
</para>
|
||||
<para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para>
|
||||
|
||||
<para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (o.partner_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para>
|
||||
|
||||
|
||||
<blockTable colWidths="100,150" style="Struktur" hAlign="RIGHT">
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td align="right">
|
||||
<para style="normal">Ihr Ansprechpartner</para>
|
||||
<blockTable colWidths="65,165" style="Struktur">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Name:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (user.name) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Telefon:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ user.partner_id.phone or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">E-Mail:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ user.partner_id.email or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<spacer length="0.5cm"/>
|
||||
</td>
|
||||
<td>
|
||||
<spacer length="0.5cm"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Datum:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Referenz:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.partner_ref or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<para style="ueberschrift">Bestellung [[ o.name ]]</para>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="30.0, 57, 213.0, 60, 45, 55.0, 60.0" repeatRows="1" style="TabelleHaupt" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="tabelle_header">Pos</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_links">Art.nr.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_links">Bezeichnung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">gepl.</para>
|
||||
<para style="tabelle_header">Lieferung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Menge</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_rechts">E-Preis</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_rechts">G-Preis</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[repeatIn(o.order_line,'line')]]
|
||||
<td>
|
||||
<para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0">
|
||||
<seq id="L1"/>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_links">[[ line.product_id and line.product_id.default_code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="tabelle_daten_links">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
|
||||
<para style="tabelle_daten_links">Ihre Artikelnr.: [[ line.supplier_code or removeParentNode('para')]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ formatLang(line.date_planned,date=True) ]]</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ formatLang(line.product_qty, digits=2)[-2:]=='00' and formatLang(line.product_qty, digits=0) or formatLang(line.product_qty, digits=2) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ formatLang(line.price_unit, digits=2) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ formatLang(line.price_subtotal, digits=2) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
|
||||
<blockTable colWidths="180,205,70, 80" style="TabelleSchlussrechnung">
|
||||
<tr>[[ o.amount_tax > 0 or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="schlussrechnung"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">Nettobetrag in €:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[o.pricelist_id.currency_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ formatLang(o.amount_untaxed, digits=2)]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ o.amount_tax > 0 or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="schlussrechnung"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">MwSt. in €:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ formatLang(o.amount_tax, digits=2) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett">Gesamt in €:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett">[[ formatLang(o.amount_total,digits=2) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<para style="normal">[[ (o.notes or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((o.notes or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="normal">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="110,300" style="Struktur" hAlign="LEFT"> [[o.incoterm_id or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Lieferbedingung:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[o.incoterm_id and o.incoterm_id.name or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="110,300" style="Struktur" hAlign="LEFT"> [[o.payment_term_id or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Zahlungsbedingungen:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[o.payment_term_id and o.payment_term_id.note or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<para style="normal">Mit freundlichen Grüßen,</para>
|
||||
<spacer length="0.3cm"/>
|
||||
<blockTable colWidths="200" style="Struktur" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<image>[[ company.signature]]</image>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="normal">B. Neumeier</para>
|
||||
|
||||
</story>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
<reports>
|
||||
<report>purchase.report_purchasequotation</report>
|
||||
</reports>
|
||||
-->
|
||||
<document filename="Purchase Quotation.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Purchase Order" author="andreas.brueckl@cmotion.eu" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="15.0" y1="42.0" width="539" height="758"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
<story>
|
||||
<para>
|
||||
<seqReset id="L1"/>
|
||||
</para>
|
||||
<para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para>
|
||||
|
||||
<para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (o.partner_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para>
|
||||
|
||||
|
||||
<blockTable colWidths="100,150" style="Struktur" hAlign="RIGHT">
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td align="right">
|
||||
<para style="normal">Ihr Ansprechpartner</para>
|
||||
<blockTable colWidths="65,165" style="Struktur">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Name:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (user.name) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Telefon:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ user.partner_id.phone or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">E-Mail:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ user.partner_id.email or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<spacer length="0.5cm"/>
|
||||
</td>
|
||||
<td>
|
||||
<spacer length="0.5cm"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Datum:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Referenz:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.partner_ref or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<para style="ueberschrift">Anfrage [[ o.name ]]</para>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="30.0, 57, 328.0, 60, 45" repeatRows="1" style="TabelleHaupt" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="tabelle_header">Pos</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_links">Art.nr.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_links">Bezeichnung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">gepl.</para>
|
||||
<para style="tabelle_header">Lieferung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Menge</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[repeatIn(o.order_line,'line')]]
|
||||
<td>
|
||||
<para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0">
|
||||
<seq id="L1"/>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_links">[[ line.product_id and line.product_id.default_code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="tabelle_daten_links">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
|
||||
<para style="tabelle_daten_links">Ihre Artikelnr.: [[ line.supplier_code or removeParentNode('para')]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ formatLang(line.date_planned,date=True) ]]</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ formatLang(line.product_qty, digits=2)[-2:]=='00' and formatLang(line.product_qty, digits=0) or formatLang(line.product_qty, digits=2) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<para style="normal">[[ (o.notes or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((o.notes or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="normal">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="110,300" style="Struktur" hAlign="LEFT"> [[o.incoterm_id or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Lieferbedingung:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[o.incoterm_id and o.incoterm_id.name or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="110,300" style="Struktur" hAlign="LEFT"> [[o.payment_term_id or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Zahlungsbedingungen:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[o.payment_term_id and o.payment_term_id.note or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<para style="normal">Mit freundlichen Grüßen,</para>
|
||||
<spacer length="0.3cm"/>
|
||||
<blockTable colWidths="200" style="Struktur" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<image>[[ company.signature]]</image>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="normal">B. Neumeier</para>
|
||||
|
||||
</story>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,199 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
<reports>
|
||||
<report>sale.report_saleorder</report>
|
||||
</reports>
|
||||
-->
|
||||
|
||||
<document filename="Sales Order.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Sale Order" author="Andreas Brückl" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="15.0" y1="42.0" width="539" height="758"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
<story>
|
||||
<para>
|
||||
<seqReset id="L1"/>
|
||||
</para>
|
||||
<para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para>
|
||||
|
||||
<para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (o.partner_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id and o.partner_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para>
|
||||
|
||||
|
||||
<blockTable colWidths="100,110" style="Struktur" hAlign="RIGHT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ihre Referenz:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.client_order_ref ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ansprechpartner:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.user_id and o.user_id.name) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> [[ o.user_id and o.user_id.phone or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="normal">Tel.:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.user_id and o.user_id.phone) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ihre UID:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.vat or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Angebotsdatum:[[ o.state not in ['draft','sent'] and removeParentNode('para') ]]</para>
|
||||
<para style="normal">Bestelldatum:[[ o.state in ['draft','sent'] and removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ formatLang(o.date_order,date = True) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<section>
|
||||
<para style="ueberschrift"><b>[[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Angebot [[ o.name ]]</b></para>
|
||||
<para style="ueberschrift"><b>[[ o.state in ['draft','sent'] and removeParentNode('para') ]] Bestellbestätigung [[ o.name ]]</b></para>
|
||||
</section>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="30,57,213,45,50,40,75" repeatRows="1" style="TabelleHaupt" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="tabelle_header">Pos</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Art.nr.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_links">Bezeichnung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Menge</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_rechts">E-Preis</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_rechts">Gesamtpreis</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>[[repeatIn(o.order_line,'line')]]
|
||||
<td>
|
||||
<para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0">
|
||||
<seq id="L1"/>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ line.product_id and line.product_id.default_code or '']]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="tabelle_daten_links">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty, digits=0) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ formatLang(line.price_unit,digits=2) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ line.discount <> 0 and (formatLang(line.discount) + '%') or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ formatLang(line.price_subtotal,digits=2 ) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="210,200,100" style="TabelleSchlussrechnung">
|
||||
<tr>
|
||||
<td>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">Zwischensumme in €</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ formatLang(o.amount_untaxed,digits=2 )]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">MwSt. in €</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ formatLang(o.amount_tax,digits=2 ) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett">Rechnungsbetrag in €</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung_fett">[[ formatLang(o.amount_total,digits=2 ) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<para style="normal">[[ (o.note or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((o.note or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="normal">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="110,300" style="Struktur" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Zahlungsziele:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.payment_term and o.payment_term.note) or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
</story>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
<reports>
|
||||
<report>stock.report_picking</report>
|
||||
</reports>
|
||||
-->
|
||||
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="34.0" y1="57.0" width="504" height="728"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
<story>
|
||||
<para>
|
||||
<seqReset id="L1"/>
|
||||
</para>
|
||||
|
||||
<para>[[ repeatIn(objects,'picking') ]] [[ picking.partner_id and setLang(picking.partner_id.lang) ]]</para>
|
||||
|
||||
<para style="fett">[[ picking.partner_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (picking.partner_id.commercial_partner_id.id != picking.partner_id.id and picking.partner_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (picking.partner_id and picking.partner_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (picking.partner_id and picking.partner_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (picking.partner_id and picking.partner_id.zip) or '' ]] [[ (picking.partner_id and picking.partner_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (picking.partner_id and picking.partner_id.state_id and picking.partner_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (picking.partner_id and picking.partner_id.country_id and picking.partner_id.country_id.name) or '' ]]</para>
|
||||
|
||||
|
||||
<blockTable colWidths="100,110" style="Struktur" hAlign="RIGHT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Bestellung:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ picking.origin ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Datum:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ formatLang(picking.date_done, date=True) or formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Referenz:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ picking.sale_id and picking.sale_id.client_order_ref or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Kundennr.:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ picking.partner_id and picking.partner_id.commercial_partner_id and picking.partner_id.commercial_partner_id.ref or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</blockTable>
|
||||
|
||||
<para style="ueberschrift">Lieferschein [[ picking.name ]]</para>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="30,80,304,80" repeatRows="1" style="TabelleHaupt" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="tabelle_header">Pos</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Art.nr.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_links">Bezeichnung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Menge</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ repeatIn([line for line in picking.move_lines if line.state <> 'cancel'],'move_lines') ]]
|
||||
<td>
|
||||
<para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0">
|
||||
<seq id="L1"/>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ move_lines.product_id.default_code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_links">[[ (move_lines.name or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((move_lines.name or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="tabelle_daten_links">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ formatLang(move_lines.product_qty, digits=0) ]] </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<para style="normal">[[ (picking.note or '').split('\n\n')[0] ]]</para>
|
||||
<section>[[ repeatIn((picking.note or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="normal">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
|
||||
</story>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="sale.report_sale_order" model="ir.actions.report.xml">
|
||||
<field name="report_rml">cam_reports/report/sale.order.rml</field>
|
||||
<field name="report_type">pdf</field>
|
||||
</record>
|
||||
|
||||
<record id="stock.action_report_picking" model="ir.actions.report.xml">
|
||||
<field name="report_rml">cam_reports/report/stock.picking.rml</field>
|
||||
<field name="report_type">pdf</field>
|
||||
</record>
|
||||
|
||||
<record id="account.account_invoices" model="ir.actions.report.xml">
|
||||
<field name="report_rml">cam_reports/report/account.invoice.rml</field>
|
||||
<field name="report_type">pdf</field>
|
||||
</record>
|
||||
|
||||
<record id="purchase.report_purchase_quotation" model="ir.actions.report.xml">
|
||||
<field name="report_rml">cam_reports/report/purchase.quotation.rml</field>
|
||||
<field name="report_type">pdf</field>
|
||||
</record>
|
||||
|
||||
<record id="purchase.action_report_purchase_order" model="ir.actions.report.xml">
|
||||
<field name="report_rml">cam_reports/report/purchase.order.rml</field>
|
||||
<field name="report_type">pdf</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
|
@ -0,0 +1,25 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import controllers
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Test Environment',
|
||||
'version': '1.0',
|
||||
'category': 'Custom',
|
||||
'description': """
|
||||
Test Environment
|
||||
===========================
|
||||
* Shows the message "Test" in the background if the database matches the regular expression of the config paramter "dbfilter_test"
|
||||
* Default filter: test*
|
||||
|
||||
""",
|
||||
'author': 'camadeus Consulting GmbH',
|
||||
'website': 'http://www.camadeus.at',
|
||||
'depends': ['web','base'],
|
||||
'js': [
|
||||
'static/src/js/testenv.js',
|
||||
],
|
||||
'css': [
|
||||
'static/src/css/testenv.css',
|
||||
],
|
||||
'update_xml': [],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import testenv_controller
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import ast
|
||||
import base64
|
||||
import csv
|
||||
import glob
|
||||
import itertools
|
||||
import logging
|
||||
import operator
|
||||
import datetime
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
import simplejson
|
||||
import time
|
||||
import urllib
|
||||
import urllib2
|
||||
import urlparse
|
||||
import xmlrpclib
|
||||
import zlib
|
||||
from xml.etree import ElementTree
|
||||
from cStringIO import StringIO
|
||||
|
||||
import babel.messages.pofile
|
||||
import werkzeug.utils
|
||||
import werkzeug.wrappers
|
||||
try:
|
||||
import xlwt
|
||||
except ImportError:
|
||||
xlwt = None
|
||||
|
||||
import openerp
|
||||
import openerp.modules.registry
|
||||
from openerp.tools.translate import _
|
||||
from openerp.tools import config
|
||||
|
||||
from openerp.addons.web import http
|
||||
|
||||
|
||||
class WebClient(http.Controller):
|
||||
_cp_path = "/web/testenv"
|
||||
|
||||
@http.jsonrequest
|
||||
def testmode(self, req, db=False):
|
||||
if not db and req and req.session:
|
||||
db = req.session._db
|
||||
|
||||
if db:
|
||||
h = req.httprequest.environ['HTTP_HOST'].split(':')[0]
|
||||
d = h.split('.')[0]
|
||||
r = openerp.tools.config.get('dbfilter_test', 'test*').replace('%h', h).replace('%d', d)
|
||||
try:
|
||||
pattern_list = eval(r)
|
||||
if not hasattr(pattern_list, '__iter__'):
|
||||
pattern_list = [pattern_list]
|
||||
except:
|
||||
pattern_list = [r]
|
||||
|
||||
for pattern in pattern_list:
|
||||
if isinstance(pattern, str) and re.match(pattern, db):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
.test-mode-activated {
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.test-mode-activated > * {
|
||||
opacity: 0.9;
|
||||
background-color: rgba(0,0,0,0);
|
||||
}
|
||||
|
After Width: | Height: | Size: 22 KiB |
|
|
@ -0,0 +1,32 @@
|
|||
openerp.cam_testenv = function (openerp) {
|
||||
|
||||
openerp.web.WebClient = openerp.web.WebClient.extend({
|
||||
/**
|
||||
* Test env
|
||||
*/
|
||||
start: function() {
|
||||
var self = this;
|
||||
|
||||
return $.when(this._super()).then(function() {
|
||||
//this._super();
|
||||
|
||||
db = null
|
||||
if (jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).db !== undefined) {
|
||||
db = jQuery.deparam(jQuery.param.querystring()).db
|
||||
}
|
||||
|
||||
self.rpc("/web/testenv/testmode", {'db': db}).done(function(result) {
|
||||
// If immediately follows a login (triggered by trying to restore
|
||||
// an invalid session or no session at all), refresh session data
|
||||
// (should not change, but just in case...)
|
||||
if (result) {
|
||||
$("body").addClass("test-mode-activated");
|
||||
$("body").css("background-image", "url(" + openerp.session.origin + "/cam_testenv/static/src/img/back-testenv.jpg" + ")");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import cam_work_order
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Camadeus Produktionsschein',
|
||||
'category': 'Custom',
|
||||
'version': '1.0',
|
||||
'description': """Produktionsschein für die Arbeitsausführung""",
|
||||
'author': 'camadeus GmbH',
|
||||
'website': 'http://www.camadeus.at',
|
||||
'depends': ['sale'],
|
||||
'data': [
|
||||
'cam_work_order_view.xml',
|
||||
'cam_work_order_data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import api
|
||||
from openerp.tools.translate import _
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp import tools
|
||||
from lxml import etree
|
||||
|
||||
class sale_order(osv.osv):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
_columns = {
|
||||
'work_order_ids': fields.one2many('work.order','sale_id','Produktionsscheine'),
|
||||
}
|
||||
|
||||
def action_view_work_order(self, cr, uid, ids, context=None):
|
||||
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
|
||||
result = mod_obj.get_object_reference(cr, uid, 'cam_work_order', 'work_order_action')
|
||||
id = result and result[1] or False
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
|
||||
#compute the number of work orders to display
|
||||
work_ids = []
|
||||
for so in self.browse(cr, uid, ids, context=context):
|
||||
work_ids += [order.id for order in so.work_order_ids]
|
||||
|
||||
#choose the view_mode accordingly
|
||||
if len(work_ids) > 1:
|
||||
result['domain'] = "[('id','in',[" + ','.join(map(str, work_ids)) + "])]"
|
||||
else:
|
||||
res = mod_obj.get_object_reference(cr, uid, 'cam_custom', 'work_order_form')
|
||||
result['views'] = [(res and res[1] or False, 'form')]
|
||||
result['res_id'] = work_ids and work_ids[0] or False
|
||||
return result
|
||||
|
||||
def button_work_order(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1 #'This option should only be used for a single id at a time.'
|
||||
order = self.browse(cr, uid, ids[0], context=context)
|
||||
|
||||
existing_ids = self.pool.get('work.order').search(cr, uid, [('sale_id','=',order.id)])
|
||||
if existing_ids:
|
||||
work_id = existing_ids[0]
|
||||
else:
|
||||
lines = []
|
||||
for l in order.order_line:
|
||||
line = {
|
||||
'name': l.name,
|
||||
'qty': l.product_uom_qty,
|
||||
}
|
||||
lines.append((0,0,line))
|
||||
|
||||
vals = {
|
||||
'partner_id': order.partner_id.id,
|
||||
'sale_id': order.id,
|
||||
'line_ids': lines,
|
||||
}
|
||||
work_id = self.pool.get('work.order').create(cr, uid, vals, context=context)
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Produktionsschein'),
|
||||
'res_model': 'work.order',
|
||||
'res_id': work_id,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'target': 'current',
|
||||
'nodestroy': True,
|
||||
}
|
||||
|
||||
class work_order_line(osv.Model):
|
||||
_name = 'work.order.line'
|
||||
_description = 'Arbeitsposition'
|
||||
_order = 'seq, id'
|
||||
_columns = {
|
||||
'seq': fields.integer('Sequenz'),
|
||||
'name': fields.text('Bezeichnung', size=30, required=True),
|
||||
'qty': fields.float('Stück'),
|
||||
'order_id': fields.many2one('work.order', required=True, ondelete='cascade'),
|
||||
}
|
||||
|
||||
class work_order_stage(osv.osv):
|
||||
_name = "work.order.stage"
|
||||
_description = "Stage of work order"
|
||||
_order = "sequence, id"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Stage Name', required=True, translate=True),
|
||||
'sequence': fields.integer('Sequence', help="Used to order stages. Lower is better."),
|
||||
'fold': fields.boolean('Folded in Kanban View', help='This stage is folded in the kanban view when there are no records in that stage to display.'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'sequence': 1,
|
||||
'fold': False,
|
||||
}
|
||||
|
||||
class work_order(osv.Model):
|
||||
_name = 'work.order'
|
||||
_description = 'Produktionsschein'
|
||||
_inherit = ['mail.thread']
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Bezeichnung', size=30, required=True),
|
||||
'sale_id': fields.many2one('sale.order', 'Verkaufsauftrag', required=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Kunde', required=True),
|
||||
'parter_id_street': fields.related('partner_id', 'street', type="char", relation="res.partner", string="Strasse", store=False),
|
||||
'parter_id_zip': fields.related('partner_id', 'zip', type="char", relation="res.partner", string="Postleitzahl", store=False),
|
||||
'parter_id_city': fields.related('partner_id', 'city', type="char", relation="res.partner", string="Stadt", store=False),
|
||||
'user_id': fields.many2one('res.users', 'Bearbeiter'),
|
||||
'stage_id': fields.many2one('work.order.stage', 'Status', track_visibility='onchange', select=True),
|
||||
'date_of_creation': fields.date('Erstellungsdatum'),
|
||||
'line_ids': fields.one2many('work.order.line', 'order_id', 'Positionen', copy=True),
|
||||
'work_date': fields.char('Produktionsstermin',size=120),
|
||||
'work_address': fields.text('Produktionsadresse'),
|
||||
'graphic_text': fields.text('Anmerkungen'),
|
||||
}
|
||||
|
||||
def _get_default_stage_id(self, cr, uid, context=None):
|
||||
""" Gives default stage_id """
|
||||
return self.pool.get('work.order.stage').search(cr, uid, [], context=context)[0]
|
||||
|
||||
_defaults = {
|
||||
'name': '/',
|
||||
'date_of_creation': fields.date.context_today,
|
||||
'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c),
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if vals.get('name', '/') == '/':
|
||||
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'work.order') or '/'
|
||||
new_id = super(work_order, self).create(cr, uid, vals, context=context)
|
||||
return new_id
|
||||
|
||||
def print_quotation(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function prints the work order
|
||||
'''
|
||||
return self.pool['report'].get_action(cr, uid, ids, 'cam_reports.report_workorder', context=context)
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!-- Sequences for work.order -->
|
||||
<record id="seq_type_work_order" model="ir.sequence.type">
|
||||
<field name="name">Work Order</field>
|
||||
<field name="code">work.order</field>
|
||||
</record>
|
||||
|
||||
<record id="seq_work_order" model="ir.sequence">
|
||||
<field name="name">Work Order</field>
|
||||
<field name="code">work.order</field>
|
||||
<field name="prefix">PS-</field>
|
||||
<field name="padding">5</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- Status values for work order-->
|
||||
<record id="work_order_stage_1" model="work.order.stage">
|
||||
<field name="name">Neu</field>
|
||||
<field name="sequence">1</field>
|
||||
<field name="fold">False</field>
|
||||
</record>
|
||||
|
||||
<record id="work_order_stage_2" model="work.order.stage">
|
||||
<field name="name">In Bearbeitung</field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="fold">False</field>
|
||||
</record>
|
||||
|
||||
<record id="work_order_stage_3" model="work.order.stage">
|
||||
<field name="name">Bereit für Produktion</field>
|
||||
<field name="sequence">3</field>
|
||||
<field name="fold">False</field>
|
||||
</record>
|
||||
|
||||
<record id="work_order_stage_4" model="work.order.stage">
|
||||
<field name="name">Terminisiert</field>
|
||||
<field name="sequence">4</field>
|
||||
<field name="fold">False</field>
|
||||
</record>
|
||||
|
||||
<record id="work_order_stage_5" model="work.order.stage">
|
||||
<field name="name">Erledigt</field>
|
||||
<field name="sequence">5</field>
|
||||
<field name="fold">False</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Form Arbeitschein-->
|
||||
<record id="work_order_form" model="ir.ui.view">
|
||||
<field name="name">work_order_form</field>
|
||||
<field name="model">work.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Produktionsschein" version="7.0">
|
||||
|
||||
<header>
|
||||
<button name="print_quotation" string="Drucken" type="object"/>
|
||||
<field name="stage_id" widget="statusbar" clickable="True"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<h1>
|
||||
<field name="name" class="oe_inline" attrs="{'invisible': [('name','=','/')]}" readonly="1"/>
|
||||
</h1>
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id" context="{'show_address': 1}" options="{"always_reload": True, "highlight_first_line": True}"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_of_creation"/>
|
||||
<field name="work_date"/>
|
||||
<field name="work_address"/>
|
||||
<field name="sale_id"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Anmerkungen" colspan="2">
|
||||
<field name="graphic_text" nolabel="1"/>
|
||||
</group>
|
||||
|
||||
<notebook>
|
||||
<page string="Positionen">
|
||||
<field name="line_ids">
|
||||
<tree editable="top">
|
||||
<field name="seq" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="qty"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Arbeitschein Kanban -->
|
||||
<record id="work_order_kanban" model="ir.ui.view">
|
||||
<field name="name">work_order_kanban</field>
|
||||
<field name="model">work.order</field>
|
||||
<field name="type">kanban</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban default_group_by="stage_id">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
|
||||
<div class="oe_dropdown_toggle oe_dropdown_kanban">
|
||||
<span class="oe_e">í</span>
|
||||
<ul class="oe_dropdown_menu">
|
||||
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
|
||||
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="oe_kanban_content">
|
||||
<div>
|
||||
<b><field name="name"/></b>
|
||||
</div>
|
||||
<div>
|
||||
<field name="partner_id"/><br/>
|
||||
 <field name="parter_id_street"/><br/>
|
||||
 <field name="parter_id_zip"/> <field name="parter_id_city"/>
|
||||
</div>
|
||||
<div>
|
||||
<i><field name="work_date"/></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_clear"></div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Arbeitschein Search -->
|
||||
<record id="work_order_search" model="ir.ui.view">
|
||||
<field name="name">work_order_search</field>
|
||||
<field name="model">work.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Produktionsschein">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<separator/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Kunden" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Bearbeiter" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Status" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Arbeitschein Tree -->
|
||||
<record id="work_order_tree" model="ir.ui.view">
|
||||
<field name="name">work_order_tree</field>
|
||||
<field name="model">work.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Produktionsschein">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="sale_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="stage_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action Arbeitsschein -->
|
||||
<record id="work_order_action" model="ir.actions.act_window">
|
||||
<field name="name">Produktionsscheine</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">work.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Hier klicken um einen neuen Produktionsschein zu erstellen.
|
||||
</p><p>
|
||||
Verwaltung von Produktionsscheinen.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Form Arbeitschein Status -->
|
||||
<record id="work_order_stages_form" model="ir.ui.view">
|
||||
<field name="name">work_order_stages_form</field>
|
||||
<field name="model">work.order.stage</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Status" version="7.0">
|
||||
<header/>
|
||||
<sheet>
|
||||
<h1>
|
||||
<field name="name" class="oe_inline"/>
|
||||
</h1>
|
||||
<group>
|
||||
<group>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="fold"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action Arbeitsschein Status -->
|
||||
<record id="work_order_stages_action" model="ir.actions.act_window">
|
||||
<field name="name">Status</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">work.order.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Hier klicken um einen neuen Status für Produktionsschein zu erstellen.
|
||||
</p><p>
|
||||
Verwaltung von Status von Produktionsscheinen.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Menüeinträge -->
|
||||
<menuitem id="work_order_main" name="Produktionsscheine" sequence="21"/>
|
||||
<menuitem id="work_order_sub" parent="work_order_main" name="Produktionsscheine" sequence="10"/>
|
||||
<menuitem id="work_config" parent="work_order_main" name="Konfiguration" sequence="50"/>
|
||||
|
||||
<menuitem action="work_order_action" id="work_order_menu" parent="work_order_sub" sequence="10"/>
|
||||
<menuitem action="work_order_stages_action" id="work_stages_menu" parent="work_config" sequence="10"/>
|
||||
|
||||
<!-- Adaption for Sale order -->
|
||||
<record id="view_order_work_form" model="ir.ui.view">
|
||||
<field name="name">view_order_work_form</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button string="Create Invoice" position="after">
|
||||
<field name="work_order_ids" invisible="1"/>
|
||||
<button name="action_view_work_order" string="Zeige Produktionsschein" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': ['|',('work_order_ids','=',False),('work_order_ids','=',[])]}" groups="base.group_user"/>
|
||||
<button name="button_work_order" string="Erzeuge Produktionsschein" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': ['|',('state','not in',['manual','progress']),('work_order_ids','!=',[])]}"/>
|
||||
</button>
|
||||
</field>
|
||||
<field name="priority">17</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
modify_work_order,modify_order_sale_user,model_work_order,base.group_sale_salesman,1,1,1,1
|
||||
modify_work_order_line,modify_order_line_sale_user,model_work_order_line,base.group_sale_salesman,1,1,1,1
|
||||
access_work_category,work_category_user,model_work_category,base.group_sale_salesman,1,0,0,0
|
||||
modify_work_category,work_category_manager,model_work_category,base.group_sale_manager,1,1,1,1
|
||||
|
|
After Width: | Height: | Size: 2.8 KiB |
|
|
@ -0,0 +1,15 @@
|
|||
Stop Phoning Home Feature from OpenERP
|
||||
======================================
|
||||
|
||||
Note:
|
||||
-----
|
||||
|
||||
* For V8 checkout master branch
|
||||
* for V7 checkout 7.0 branch
|
||||
|
||||
Remove Few Phoning home feature effect from Core OpenERP.
|
||||
---------------------------------------------------------
|
||||
|
||||
* Stop Scheduler for Sending Company/Database information to Odoo/OpenERP company.
|
||||
* Remove ``Your OpenERP is not supported.``.
|
||||
* Change sequence of the ``Apps`` and ``Update`` menu and arrange ``Installed Modules`` at first position.
|
||||
|
|
@ -0,0 +1 @@
|
|||
import mail
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
{
|
||||
'name': 'Stop Phoning Home',
|
||||
'version': '1.0',
|
||||
'category': '',
|
||||
"sequence": 14,
|
||||
'complexity': "easy",
|
||||
'category': 'Hidden',
|
||||
'description': """
|
||||
Remove Few Phoning home feature effect from Core OpenERP.
|
||||
""",
|
||||
'author': 'Ruchir Shukla',
|
||||
'website': 'www.bizzappdev.com',
|
||||
'depends': ["mail",'web'],
|
||||
'init_xml': [],
|
||||
'data': [
|
||||
"base_view.xml",
|
||||
"mail_data.xml",
|
||||
],
|
||||
'demo_xml': [],
|
||||
'test': [
|
||||
],
|
||||
'qweb' : [
|
||||
"static/src/xml/base.xml",
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem id="base.menu_module_tree" parent="base.menu_management" name="Installed Modules" sequence="10" action="base.open_module_tree" />
|
||||
<menuitem id="base.module_mi" parent="base.menu_management" sequence="100" action="base.modules_act_cl"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.osv import osv
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
from openerp.tools import config
|
||||
|
||||
config['publisher_warranty_url'] = ''
|
||||
|
||||
|
||||
class publisher_warranty_contract(osv.osv):
|
||||
_inherit = 'publisher_warranty.contract'
|
||||
|
||||
def update_notification(self, cr, uid, ids, cron_mode=True,
|
||||
context=None):
|
||||
|
||||
_logger.info("NO More Spying Stuff")
|
||||
|
||||
return True
|
||||
|
||||
|
||||
publisher_warranty_contract()
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="mail.ir_cron_module_update_notification" model="ir.cron">
|
||||
<field name="name">Update Notification</field>
|
||||
<field eval="False" name="active" />
|
||||
<field name="user_id" ref="base.user_root" />
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">weeks</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall" />
|
||||
<field eval="'publisher_warranty.contract'" name="model" />
|
||||
<field eval="'update_notification'" name="function" />
|
||||
<field eval="'(None,)'" name="args" />
|
||||
<field name="priority">1000</field>
|
||||
</record>
|
||||
|
||||
<template id="assets_backend" name="oerp_no_phoning_home assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/oerp_no_phoning_home/static/src/js/announcement.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
|
@ -0,0 +1,13 @@
|
|||
openerp.oerp_no_phoning_home = function(instance) {
|
||||
instance.web.WebClient.include({
|
||||
show_application: function() {
|
||||
return $.when(this._super.apply(this, arguments));
|
||||
},
|
||||
_ab_location: function(dbuuid) {
|
||||
// return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid);
|
||||
},
|
||||
show_annoucement_bar: function() {
|
||||
return;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="UserMenu" >
|
||||
<t t-jquery="ul.dropdown-menu" t-operation="replace">
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" data-menu="settings">Preferences</a></li>
|
||||
<li><a href="#" data-menu="about">About OpenERP</a></li>
|
||||
<li><a href="#" data-menu="help">Help</a></li>
|
||||
<li><a href="#" data-menu="logout">Log out</a></li>
|
||||
</ul>
|
||||
</t>
|
||||
</t>
|
||||
<t t-extend="WebClient.announcement_bar" >
|
||||
<t t-jquery="table.oe_webclient" t-operation="replace">
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
#dump the OpenERP DB (postgreSQL)
|
||||
#author: Camadeus GmbH
|
||||
|
||||
hostname=`/bin/hostname`
|
||||
|
||||
|
||||
dbnames=`psql -d postgres -c "SELECT datname FROM pg_database WHERE NOT datistemplate AND datname <> 'postgres'" --tuples-only`
|
||||
|
||||
# Dump DBs
|
||||
for db in $dbnames
|
||||
do
|
||||
echo "creating backup for db: " $db
|
||||
date=`date +"%Y%m%d_%H%M%N"`
|
||||
filename="/var/pgdump/${hostname}_${db}_${date}.sql"
|
||||
pg_dump -E UTF-8 -F p -b -f $filename $db
|
||||
chmod 600 $filename
|
||||
gzip $filename
|
||||
done
|
||||
|
||||
|
||||
##########################################
|
||||
## Housekeeping
|
||||
##########################################
|
||||
for file in `find /var/pgdump/ -mtime +30 -type f -name '*.sql.gz'`
|
||||
do
|
||||
echo "deleting: " $file
|
||||
rm $file
|
||||
done
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
from lib import cli
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli.main()
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
#!/bin/bash
|
||||
################################################################################
|
||||
# Script for Installation: ODOO Saas4/Trunk server on Ubuntu 14.04 LTS
|
||||
# Author: André Schenkels, ICTSTUDIO 2014
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# This script will install ODOO Server on
|
||||
# clean Ubuntu 14.04 Server
|
||||
#-------------------------------------------------------------------------------
|
||||
# USAGE:
|
||||
#
|
||||
# odoo-install
|
||||
#
|
||||
# EXAMPLE:
|
||||
# ./odoo-install
|
||||
#
|
||||
################################################################################
|
||||
|
||||
##fixed parameters
|
||||
OE_USER="odoo"
|
||||
OE_HOME="/opt/$OE_USER"
|
||||
OE_HOME_EXT="/opt/$OE_USER/$OE_USER-server"
|
||||
|
||||
#Enter version for checkout "7.0" for version 7.0, "saas-4, saas-5 (opendays version) and "master" for trunk
|
||||
OE_VERSION="7.0"
|
||||
|
||||
#set the superadmin password
|
||||
OE_SUPERADMIN="c76EVdqj"
|
||||
OE_CONFIG="$OE_USER-server"
|
||||
|
||||
#--------------------------------------------------
|
||||
# Set Locale en_US.UTF-8
|
||||
#--------------------------------------------------
|
||||
#echo -e "\n---- Set en_US.UTF-8 Locale ----"
|
||||
#sudo cp /etc/default/locale /etc/default/locale.BACKUP
|
||||
#sudo rm -rf /etc/default/locale
|
||||
#echo -e "* Change server config file"
|
||||
#sudo su root -c "echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale"
|
||||
#sudo su root -c "echo 'LANG="en_US.UTF-8"' >> /etc/default/locale"
|
||||
#sudo su root -c "echo 'LANGUAGE="en_US:en"' >> /etc/default/locale"
|
||||
|
||||
#--------------------------------------------------
|
||||
# Update Server
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Update Server ----"
|
||||
sudo apt-get upgrade -y
|
||||
sudo apt-get update
|
||||
|
||||
#--------------------------------------------------
|
||||
# Install PostgreSQL Server
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Install PostgreSQL Server ----"
|
||||
sudo apt-get install postgresql -y
|
||||
|
||||
#echo -e "\n---- PostgreSQL $PG_VERSION Settings ----"
|
||||
#sudo sed -i s/"#listen_addresses = 'localhost'"/"listen_addresses = '*'"/g /etc/postgresql/9.3/main/postgresql.conf
|
||||
|
||||
echo -e "\n---- Creating the ODOO PostgreSQL User ----"
|
||||
sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
|
||||
|
||||
#--------------------------------------------------
|
||||
# Install Dependencies
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Install tool packages ----"
|
||||
sudo apt-get install wget git bzr python-pip -y
|
||||
|
||||
echo -e "\n---- Install python packages ----"
|
||||
sudo apt-get install python-gevent python-dateutil python-feedparser 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 python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-pdftools python-setuptools python-pybabel python-imaging python-matplotlib python-reportlab-accel python-openssl python-egenix-mxdatetime python-paramiko antiword python-decorator poppler-utils python-requests python-passlib -y
|
||||
|
||||
sudo pip install gevent gevent_psycopg2 psycogreen passlib
|
||||
|
||||
echo -e "\n---- Install latest gdata-python-client ----"
|
||||
cd /tmp
|
||||
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.18.tar.gz
|
||||
tar zxvf gdata-2.0.18.tar.gz
|
||||
cd gdata-2.0.18/
|
||||
sudo python setup.py install
|
||||
|
||||
|
||||
echo -e "\n---- Install Wkhtmltopdf 0.12.1 ----"
|
||||
sudo wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
|
||||
sudo dpkg -i wkhtmltox-*.deb
|
||||
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
|
||||
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
|
||||
|
||||
echo -e "\n---- Create ODOO system user ----"
|
||||
sudo adduser --system --quiet --shell=/bin/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER
|
||||
sudo adduser $OE_USER sudo
|
||||
sudo cp /root/.profile $OE_HOME
|
||||
sudo chown $OE_USER:$OE_USER $OE_HOME/.profile
|
||||
sudo cp /root/.bashrc $OE_HOME
|
||||
sudo chown $OE_USER:$OE_USER $OE_HOME/.bashrc
|
||||
|
||||
echo -e "\n---- Create Log directory ----"
|
||||
sudo mkdir /var/log/$OE_USER
|
||||
sudo chown $OE_USER:$OE_USER /var/log/$OE_USER
|
||||
sudo chmod 700 /var/log/$OE_USER
|
||||
|
||||
echo -e "\n---- Set Logrotate config ----"
|
||||
sudo ln -s /opt/odoo/ext/config/logrotate /etc/logrotate.d/odoo
|
||||
|
||||
#--------------------------------------------------
|
||||
# Install ODOO
|
||||
#--------------------------------------------------
|
||||
|
||||
echo -e "\n---- Setting permissions on home folder ----"
|
||||
sudo chown -R $OE_USER:$OE_USER $OE_HOME/*
|
||||
|
||||
echo -e "Odoo Init File"
|
||||
sudo ln -s /opt/odoo/exit/config/odoo-server.init /etc/init.d/odoo-server
|
||||
|
||||
echo -e "\n---- Setup Git ----"
|
||||
sudo -u odoo mkdir /opt/odoo/odoo.git
|
||||
sudo -u odoo mkdir /opt/odoo/odoo
|
||||
sudo -u odoo mkdir /opt/odoo/ext.git
|
||||
sudo -u odoo mkdir /opt/odoo/ext
|
||||
cd /opt/odoo/odoo.git
|
||||
sudo -u odoo git init --bare
|
||||
cd /opt/odoo/ext.git
|
||||
sudo -u odoo git init --bare
|
||||
|
||||
sudo -u odoo touch /opt/odoo/odoo.git/hooks/post-receive
|
||||
sudo -u odoo echo -e '#!/bin/bash' >> /opt/odoo/odoo.git/hooks/post-receive
|
||||
sudo -u odoo echo -e 'git --work-tree=/opt/odoo/odoo --git-dir=/opt/odoo/odoo.git checkout -f' >> /opt/odoo/odoo.git/hooks/post-receive
|
||||
sudo -u odoo chmod +x /opt/odoo/odoo.git/hooks/post-receive
|
||||
|
||||
sudo -u odoo touch /opt/odoo/ext.git/hooks/post-receive
|
||||
sudo -u odoo echo -e '#!/bin/bash' >> /opt/odoo/ext.git/hooks/post-receive
|
||||
sudo -u odoo echo -e 'git --work-tree=/opt/odoo/ext --git-dir=/opt/odoo/ext.git checkout -f' >> /opt/odoo/ext.git/hooks/post-receive
|
||||
sudo -u odoo chmod +x /opt/odoo/ext.git/hooks/post-receive
|
||||
|
||||
echo "Done! The ODOO server can be started with /etc/init.d/$OE_CONFIG"
|
||||
echo "Please reboot the server now so that Wkhtmltopdf is working with your install."
|
||||
|
||||
echo "Done! Please specify a password for user '$OE_USER'"
|
||||
sudo passwd $OE_USER
|
||||
|
||||
##
|
||||
## HERE git push of local is required
|
||||
##
|
||||
## Local commands:
|
||||
#git init
|
||||
#git remote add odoo https://github.com/odoo/odoo.git
|
||||
#git pull odoo 8.0
|
||||
#git remote add production odoo@134.119.17.66:/opt/odoo/odoo.git
|
||||
#git config --global push.default simple # only push if on remote exists branch with same name
|
||||
#git push --set-upstream production master
|
||||
|
||||
echo -e "* Start ODOO on Startup"
|
||||
sudo update-rc.d $OE_CONFIG defaults
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
################################################################################
|
||||
# Script for Installation: Nginx for Odoo v8.0 on Ubuntu 14.04 LTS
|
||||
# Author: Andreas Brückl | Camdeus Consulting
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# This script will install nginx on
|
||||
# clean Ubuntu 14.04 Server
|
||||
#-------------------------------------------------------------------------------
|
||||
################################################################################
|
||||
|
||||
#---------------------------------------------
|
||||
# Install
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Install nginx ----"
|
||||
sudo apt-get install nginx -y
|
||||
|
||||
#--------------------------------------------------
|
||||
# Configure Nginx
|
||||
#--------------------------------------------------
|
||||
sudo ln -s /opt/odoo/ext/config/odoo-80.nginx /etc/nginx/sites-enabled/odoo-80
|
||||
sudo rm /etc/nginx/sites-enabled/default
|
||||
sudo service nginx restart
|
||||
|
||||
#--------------------------------------------------
|
||||
# Configure Nginx for SSL/HTTPS Port 443
|
||||
#--------------------------------------------------
|
||||
|
||||
#sudo touch /etc/nginx/sites-available/odoo-443
|
||||
#sudo ln -s /etc/nginx/sites-available/odoo-443 /etc/nginx/sites-enabled
|
||||
#sudo mkdir /etc/nginx/ssl
|
||||
#sudo chmod 600 ssl
|
||||
|
||||
#sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
#!/bin/bash
|
||||
################################################################################
|
||||
# Script for Installation: ODOO Saas4/Trunk server on Ubuntu 14.04 LTS
|
||||
# Author: André Schenkels, ICTSTUDIO 2014
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# This script will install ODOO Server on
|
||||
# clean Ubuntu 14.04 Server
|
||||
#-------------------------------------------------------------------------------
|
||||
# USAGE:
|
||||
#
|
||||
# odoo-install
|
||||
#
|
||||
# EXAMPLE:
|
||||
# ./odoo-install
|
||||
#
|
||||
################################################################################
|
||||
|
||||
##fixed parameters
|
||||
OE_USER="odoo"
|
||||
OE_HOME="/opt/$OE_USER"
|
||||
OE_HOME_EXT="/opt/$OE_USER/$OE_USER-server"
|
||||
|
||||
#Enter version for checkout "7.0" for version 7.0, "saas-4, saas-5 (opendays version) and "master" for trunk
|
||||
OE_VERSION="8.0"
|
||||
|
||||
#set the superadmin password
|
||||
OE_SUPERADMIN="PzdX2fYj"
|
||||
OE_CONFIG="$OE_USER-server"
|
||||
|
||||
#--------------------------------------------------
|
||||
# Set Locale en_US.UTF-8
|
||||
#--------------------------------------------------
|
||||
#echo -e "\n---- Set en_US.UTF-8 Locale ----"
|
||||
#sudo cp /etc/default/locale /etc/default/locale.BACKUP
|
||||
#sudo rm -rf /etc/default/locale
|
||||
#echo -e "* Change server config file"
|
||||
#sudo su root -c "echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale"
|
||||
#sudo su root -c "echo 'LANG="en_US.UTF-8"' >> /etc/default/locale"
|
||||
#sudo su root -c "echo 'LANGUAGE="en_US:en"' >> /etc/default/locale"
|
||||
|
||||
#--------------------------------------------------
|
||||
# Update Server
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Update Server ----"
|
||||
sudo apt-get upgrade -y
|
||||
sudo apt-get update
|
||||
|
||||
#--------------------------------------------------
|
||||
# Install PostgreSQL Server
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Install PostgreSQL Server ----"
|
||||
sudo apt-get install postgresql -y
|
||||
|
||||
#echo -e "\n---- PostgreSQL $PG_VERSION Settings ----"
|
||||
#sudo sed -i s/"#listen_addresses = 'localhost'"/"listen_addresses = '*'"/g /etc/postgresql/9.3/main/postgresql.conf
|
||||
|
||||
echo -e "\n---- Creating the ODOO PostgreSQL User ----"
|
||||
sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
|
||||
|
||||
#--------------------------------------------------
|
||||
# Install Dependencies
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Install tool packages ----"
|
||||
sudo apt-get install wget git bzr python-pip -y
|
||||
|
||||
echo -e "\n---- Install python packages ----"
|
||||
sudo apt-get install python-gevent python-dateutil python-feedparser 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 python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-pdftools python-setuptools python-pybabel python-imaging python-matplotlib python-reportlab-accel python-openssl python-egenix-mxdatetime python-paramiko antiword python-decorator poppler-utils python-requests python-passlib -y
|
||||
|
||||
sudo pip install gevent gevent_psycopg2 psycogreen passlib psycogreen
|
||||
|
||||
echo -e "\n---- Install latest gdata-python-client ----"
|
||||
cd /tmp
|
||||
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.18.tar.gz
|
||||
tar zxvf gdata-2.0.18.tar.gz
|
||||
cd gdata-2.0.18/
|
||||
sudo python setup.py install
|
||||
|
||||
|
||||
echo -e "\n---- Install Wkhtmltopdf 0.12.1 ----"
|
||||
sudo wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-wheezy-amd64.deb
|
||||
sudo dpkg -i wkhtmltox-0.12.1_linux-wheezy-amd64.deb
|
||||
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
|
||||
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
|
||||
|
||||
echo -e "\n---- Create ODOO system user ----"
|
||||
sudo adduser --system --quiet --shell /bin/bash --home $OE_HOME --gecos 'ODOO' --group $OE_USER
|
||||
sudo adduser $OE_USER sudo
|
||||
sudo cp /root/.profile $OE_HOME
|
||||
sudo chown $OE_USER:$OE_USER $OE_HOME/.profile
|
||||
sudo cp /root/.bashrc $OE_HOME
|
||||
sudo chown $OE_USER:$OE_USER $OE_HOME/.bashrc
|
||||
|
||||
echo -e "\n---- Create Log directory ----"
|
||||
sudo mkdir /var/log/$OE_USER
|
||||
sudo chown $OE_USER:$OE_USER /var/log/$OE_USER
|
||||
sudo chmod 700 /var/log/$OE_USER
|
||||
|
||||
echo -e "\n---- Set Logrotate config ----"
|
||||
sudo ln -s /opt/odoo/odoo/config/logrotate /etc/logrotate.d/odoo
|
||||
|
||||
#--------------------------------------------------
|
||||
# Install ODOO
|
||||
#--------------------------------------------------
|
||||
|
||||
echo -e "\n---- Setting permissions on home folder ----"
|
||||
sudo chown -R $OE_USER:$OE_USER $OE_HOME/*
|
||||
|
||||
echo -e "Odoo Init File"
|
||||
sudo ln -s /opt/odoo/ext/config/odoo-server.init /etc/init.d/odoo-server
|
||||
|
||||
echo -e "\n---- Setup Git ----"
|
||||
sudo -u odoo mkdir /opt/odoo/odoo.git
|
||||
sudo -u odoo mkdir /opt/odoo/odoo
|
||||
cd /opt/odoo/odoo.git
|
||||
sudo -u odoo git init --bare
|
||||
sudo -u odoo touch /opt/odoo/odoo.git/hooks/post-receive
|
||||
sudo -u odoo echo -e '#!/bin/bash' >> /opt/odoo/odoo.git/hooks/post-receive
|
||||
sudo -u odoo echo -e 'git --work-tree=/opt/odoo/odoo --git-dir=/opt/odoo/odoo.git checkout -f' >> /opt/odoo/odoo.git/hooks/post-receive
|
||||
sudo -u odoo chmod +x /opt/odoo/odoo.git/hooks/post-receive
|
||||
|
||||
sudo -u odoo mkdir /opt/odoo/ext.git
|
||||
sudo -u odoo mkdir /opt/odoo/ext
|
||||
cd /opt/odoo/ext.git
|
||||
sudo -u odoo git init --bare
|
||||
sudo -u odoo touch /opt/odoo/ext.git/hooks/post-receive
|
||||
sudo -u odoo echo -e '#!/bin/bash' >> /opt/odoo/ext.git/hooks/post-receive
|
||||
sudo -u odoo echo -e 'git --work-tree=/opt/odoo/ext --git-dir=/opt/odoo/ext.git checkout -f' >> /opt/odoo/ext.git/hooks/post-receive
|
||||
sudo -u odoo chmod +x /opt/odoo/ext.git/hooks/post-receive
|
||||
|
||||
echo "Done! The ODOO server can be started with /etc/init.d/$OE_CONFIG"
|
||||
echo "Please reboot the server now so that Wkhtmltopdf is working with your install."
|
||||
|
||||
echo "Done! Please specify a password for user '$OE_USER'"
|
||||
sudo passwd $OE_USER
|
||||
|
||||
##
|
||||
## HERE git push of local is required
|
||||
##
|
||||
## Local commands:
|
||||
#git init
|
||||
#git remote add odoo https://github.com/odoo/odoo.git
|
||||
#git pull odoo 8.0
|
||||
#git remote add production odoo@134.119.17.66:/opt/odoo/odoo.git
|
||||
#git config --global push.default simple # only push if on remote exists branch with same name
|
||||
#git push --set-upstream production master
|
||||
|
||||
echo -e "* Start ODOO on Startup"
|
||||
sudo update-rc.d $OE_CONFIG defaults
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
# Script for Installation: tools for Odoo v8.0 installation
|
||||
# Author: Andreas Brückl | Camdeus Consulting
|
||||
#-------------------------------------------------------------------------------
|
||||
################################################################################
|
||||
|
||||
##fixed parameters
|
||||
#openerp
|
||||
OE_USER="odoo"
|
||||
|
||||
# Execute with user "odoo"
|
||||
|
||||
#---------------------------------------------
|
||||
# Setup daily backup
|
||||
#--------------------------------------------------
|
||||
echo -e "\n---- Setup daily backup ----"
|
||||
sudo mkdir /var/pgdump
|
||||
sudo chown $OE_USER: /var/pgdump
|
||||
sudo chmod 700 /var/pgdump
|
||||
|
||||
# Install Cron job
|
||||
sudo -u $OE_USER crontab -l > /tmp/tmpcron
|
||||
echo "# Odoo backup daily at 1:30 a.m." >> /tmp/tmpcron
|
||||
echo "30 01 * * * /opt/odoo/ext/scripts/odoo-backup.sh" >> /tmp/tmpcron
|
||||
sudo -u $OE_USER crontab /tmp/tmpcron
|
||||
sudo rm /tmp/tmpcron
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
import cli
|
||||
import config_at
|
||||
import environments
|
||||
import functions
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from functions import CamadeusFunctions
|
||||
from config_at import Config
|
||||
from environments import ENVIRONMENTS
|
||||
import sys, getopt
|
||||
|
||||
def main():
|
||||
|
||||
def _usage():
|
||||
print 'cam.py <environment> [create|setup|rollout|update] [<module_name>]'
|
||||
sys.exit(3)
|
||||
|
||||
argv = sys.argv[1:]
|
||||
if not len(argv) == 2:
|
||||
if len(argv) == 3 and argv[1] == 'update': # 'update' requires additional param 'module_name'
|
||||
pass
|
||||
else:
|
||||
_usage()
|
||||
|
||||
cmd = argv[1]
|
||||
config = Config()
|
||||
|
||||
env = ENVIRONMENTS.get(argv[0],False)
|
||||
if not env:
|
||||
_usage()
|
||||
|
||||
instance = CamadeusFunctions(env, config)
|
||||
|
||||
methods = False
|
||||
|
||||
if cmd == 'test':
|
||||
methods = [
|
||||
'login',
|
||||
]
|
||||
|
||||
if cmd == 'create':
|
||||
methods = [
|
||||
'create_db',
|
||||
'login',
|
||||
'install_module_sale',
|
||||
'setup_accounting',
|
||||
'setup_accounting2',
|
||||
'set_admin_rights',
|
||||
]
|
||||
|
||||
if cmd == 'setup':
|
||||
methods = [
|
||||
'login',
|
||||
'uninstall_chat',
|
||||
'install_modules',
|
||||
'base_config',
|
||||
'sale_config',
|
||||
'set_date_format',
|
||||
'set_company',
|
||||
'set_taxes',
|
||||
'set_uom',
|
||||
'set_steuerzuordnung',
|
||||
]
|
||||
|
||||
if cmd == 'rollout':
|
||||
methods = [
|
||||
'login',
|
||||
'set_dokumentennummern',
|
||||
]
|
||||
|
||||
if cmd == 'update':
|
||||
instance.config.module_name = argv[2]
|
||||
methods = [
|
||||
'login',
|
||||
'update_module',
|
||||
]
|
||||
|
||||
|
||||
if not methods:
|
||||
_usage()
|
||||
|
||||
print env
|
||||
|
||||
for method in methods:
|
||||
res = getattr(instance, method)()
|
||||
print "%s: %s" % (res and "OK " or "ERROR ", getattr(instance, method).__doc__)
|
||||
if not res:
|
||||
return False
|
||||
|
||||
print "\nAbgeschlossen."
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
class Config():
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.chart_of_accounts = 'l10n_at'
|
||||
self.sales_tax = '20% MwSt'
|
||||
self.purchase_tax = '20% VSt'
|
||||
self.chart_template_id = 2 # Austrian Chart of Account
|
||||
|
||||
self.company_data = {
|
||||
'name': 'Camadeus GmbH',
|
||||
'street': 'Kriehubergasse 16',
|
||||
'street2': False,
|
||||
'city': 'Wien',
|
||||
'zip': '1050',
|
||||
'phone': '+43 1 78910 96 70',
|
||||
'fax': False,
|
||||
'email': 'office@camadeus.at',
|
||||
'website': 'http://www.camadeus.at',
|
||||
'company_registry': '280076b ',
|
||||
'country_id': 'at', # "de" für deutschland
|
||||
'logo': False,
|
||||
'vat': 'ATU 62991855 ',
|
||||
'rml_header1': False,
|
||||
'vat_check_vies': True,
|
||||
'tax_calculation_rounding_method': 'round_globally',
|
||||
#'rml_header' : './ext/addons/custom_reports/report/page.rml', # Report File
|
||||
#'logo': './ext/addons/custom_reports/logo.png',
|
||||
}
|
||||
|
||||
self.valid_taxes = [
|
||||
'20% MwSt',
|
||||
'10% MwSt',
|
||||
'20% VSt',
|
||||
'10% VSt',
|
||||
]
|
||||
|
||||
# Aktive Steuerzuordnungen
|
||||
self.valid_fiscal_positions = [
|
||||
#'Lieferant EU (ohne Ust-ID)',
|
||||
#'Lieferant EU Unternehmen (mit USt-ID)',
|
||||
#'Lieferant Ausland',
|
||||
#'Kunde EU (ohne USt-ID)',
|
||||
'Kunde Ausland',
|
||||
'Kunde EU (ohne USt-ID)',
|
||||
'Kunde EU Unternehmen (mit USt-ID)',
|
||||
]
|
||||
|
||||
# Allgemeine Einstellungen
|
||||
self.base_config = {
|
||||
'module_portal': False, # Kundenportal
|
||||
}
|
||||
|
||||
# Einstellungen Verkauf
|
||||
self.sale_config = {
|
||||
'group_sale_delivery_address': True, # Verschiedene Adressen für Rechnung und Lieferung
|
||||
'group_sale_pricelist': True, # Preislisten verwenden
|
||||
'group_discount_per_so_line': True, # Rabatte verwenden
|
||||
'group_uom': True, # Verwende Mengeneinheiten
|
||||
}
|
||||
|
||||
# Einstellungen Einkauf
|
||||
self.purchase_config = {
|
||||
'group_purchase_pricelist': True, # Preislisten verwenden
|
||||
}
|
||||
|
||||
self.sequences = {
|
||||
'sale.order': {
|
||||
'number_next_actual': 2000,
|
||||
'prefix': 'A-',
|
||||
'padding': 5,
|
||||
},
|
||||
# 'picking.out': {
|
||||
# 'number_next_actual': 2000,
|
||||
# 'prefix': 'L-',
|
||||
# 'padding': 5,
|
||||
# },
|
||||
# 'purchase.order': {
|
||||
# 'number_next_actual': 2000,
|
||||
# 'prefix': 'PO-',
|
||||
# 'padding': 5,
|
||||
# },
|
||||
# 'account.invoice': {
|
||||
# 'number_next_actual': 2000,
|
||||
# 'prefix': '14-',
|
||||
# 'padding': 4,
|
||||
# },
|
||||
}
|
||||
|
||||
self.active_uoms = {
|
||||
'product.product_uom_unit': 'Stk.',
|
||||
#'product.product_uom_meter': 'lfm',
|
||||
#'product.product_uom_litre': 'l',
|
||||
#'product.product_uom_hour': 'h',
|
||||
}
|
||||
|
||||
self.modules = [
|
||||
'document',
|
||||
'auth_crypt',
|
||||
'cam_testenv',
|
||||
#'cam_max_width',
|
||||
#'oerp_no_phoning_home',
|
||||
#'cam_custom',
|
||||
#'custom_reports',
|
||||
#'crm',
|
||||
#'sale',
|
||||
#'cam_hr_overtime',
|
||||
#'cam_hr',
|
||||
]
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
class Environment():
|
||||
|
||||
def __init__(self, host, port, dbname, username, pwd, admin_pw=False, basic_auth=False):
|
||||
self.admin_pw = admin_pw
|
||||
self.dbname = dbname
|
||||
self.username = username
|
||||
self.pwd = pwd
|
||||
self.port = port
|
||||
self.host = host
|
||||
self.lang = 'de_DE'
|
||||
self.basic_auth = basic_auth or ('user', 'pass') # HTTP authentification
|
||||
|
||||
def __str__(self):
|
||||
return """==============================
|
||||
Host: %s
|
||||
User: %s
|
||||
DB: %s
|
||||
Port: %s
|
||||
==============================""" % (self.host, self.username, self.dbname, self.port)
|
||||
|
||||
|
||||
ENVIRONMENTS = {
|
||||
'br': Environment('http://localhost', '8070', 'test13', 'admin', 'x', 'admin'),
|
||||
'br2': Environment('http://localhost', '8000', 'screenplane_1', 'admin', 'x', 'admin'),
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,321 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import xmlrpclib
|
||||
import base64
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
import json
|
||||
import requests
|
||||
from config_at import Config
|
||||
from environments import ENVIRONMENTS
|
||||
|
||||
class CamadeusFunctions():
|
||||
|
||||
def __init__(self, environment, config):
|
||||
self.env = environment
|
||||
self.config = config
|
||||
|
||||
def create_db(self):
|
||||
"""Neue Datenbank erstellen"""
|
||||
|
||||
payload = {'fields': [ {'name': 'super_admin_pwd', 'value': self.env.admin_pw},
|
||||
{'name': 'db_name', 'value': self.env.dbname},
|
||||
{'name': 'demo_data', 'value': False},
|
||||
{'name': 'db_lang', 'value': self.env.lang},
|
||||
{'name': 'create_admin_pwd', 'value': self.env.pwd},
|
||||
]
|
||||
}
|
||||
payload = {'params': payload}
|
||||
json_data = json.dumps(payload)
|
||||
headers = {'content-type': 'application/json'}
|
||||
r = requests.post('%s:%s/web/database/create' % (self.env.host,self.env.port), data=json_data, headers=headers, auth=self.env.basic_auth)
|
||||
if r and r.json().get('result',False):
|
||||
return True
|
||||
else:
|
||||
print "Error occured: %s" % r.json().get('error', '????')
|
||||
return False
|
||||
|
||||
def login(self):
|
||||
"""Login"""
|
||||
|
||||
# Get the uid
|
||||
sock_common = xmlrpclib.ServerProxy ('%s:%s/xmlrpc/common' % (self.env.host,self.env.port))
|
||||
self.uid = sock_common.login(self.env.dbname, self.env.username, self.env.pwd)
|
||||
if not self.uid:
|
||||
raise "Authentication Error"
|
||||
self.sock = xmlrpclib.ServerProxy('%s:%s/xmlrpc/object' % (self.env.host,self.env.port))
|
||||
return True
|
||||
|
||||
def _execute(self, *args):
|
||||
return self.sock.execute(self.env.dbname, self.uid, self.env.pwd, *args)
|
||||
|
||||
def _readAndReturnFile(self, filename, encode = ''):
|
||||
fi = open (filename, 'r')
|
||||
content = ''
|
||||
if encode=='':
|
||||
content = fi.read()
|
||||
elif encode=='base64':
|
||||
content = base64.b64encode(fi.read())
|
||||
else:
|
||||
sys.exit(-1)
|
||||
fi.close()
|
||||
return content
|
||||
|
||||
def set_company(self):
|
||||
"""Setze Unternehmensdaten (Allgemein, RML, Logo)"""
|
||||
|
||||
vals = self.config.company_data
|
||||
dummy,country_id = self._execute('ir.model.data', 'get_object_reference', 'base',vals['country_id'])
|
||||
|
||||
# RML-Header ist nun ein function-Feld
|
||||
#if vals.get('rml_header',False):
|
||||
# vals['rml_header'] = self._readAndReturnFile(vals['rml_header'])
|
||||
|
||||
if vals.get('logo',False):
|
||||
vals['logo'] = self._readAndReturnFile(vals['logo'], encode = 'base64')
|
||||
vals['country_id'] = country_id
|
||||
c_ids = self._execute('res.company', 'search', [], )
|
||||
return self._execute('res.company', 'write', c_ids, vals)
|
||||
|
||||
def set_taxes(self):
|
||||
"""Setze nicht benötigte Steuern auf inaktiv"""
|
||||
|
||||
tax_ids = self._execute('account.tax', 'search', [('description','not in', self.config.valid_taxes)])
|
||||
return self._execute('account.tax', 'write', tax_ids, {'active': False})
|
||||
|
||||
def set_date_format(self):
|
||||
"""Setzen des Datumsformats """
|
||||
|
||||
lang_ids = self._execute('res.lang', 'search', [('code','=','de_DE')])
|
||||
if lang_ids:
|
||||
vals = {
|
||||
'date_format': '%d.%m.%Y',
|
||||
'time_format': '%H:%M:%S',
|
||||
'grouping': '[3,3]',
|
||||
'thousands_sep': '.',
|
||||
'decimal_point': ',',
|
||||
}
|
||||
self._execute('res.lang', 'write', lang_ids, vals)
|
||||
else:
|
||||
return False
|
||||
|
||||
lang_ids = self._execute('res.lang', 'search', [('code','=','en_US')])
|
||||
if lang_ids:
|
||||
vals = {
|
||||
'grouping': '[3,3]',
|
||||
}
|
||||
self._execute('res.lang', 'write', lang_ids, vals)
|
||||
else:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
# def set_report_types(self):
|
||||
# """Setzen der Report Types auf RML (PDF)"""
|
||||
#
|
||||
# report_names = ['purchase.report_purchaseorder',
|
||||
# 'purchase.report_purchasequotation',
|
||||
# 'account.report_invoice',
|
||||
# 'sale.report_saleorder',
|
||||
# 'stock.report_picking']
|
||||
# report_ids = self._execute('ir.actions.report.xml', 'search', [('report_name','in',report_names)])
|
||||
# return self._execute('ir.actions.report.xml', 'write', report_ids, {'report_type': 'pdf'})
|
||||
|
||||
def purchase_config(self):
|
||||
"""Basiskonfiguration für Einkauf laden"""
|
||||
|
||||
if hasattr(self.config, 'purchase_config'):
|
||||
vals = self._execute('purchase.config.settings', 'default_get', [])
|
||||
vals.update(self.config.purchase_config)
|
||||
wizard_id = self._execute('purchase.config.settings', 'create', vals)
|
||||
return self._execute('purchase.config.settings', 'execute', [wizard_id])
|
||||
|
||||
def sale_config(self):
|
||||
"""Basiskonfiguration für Verkauf laden"""
|
||||
|
||||
vals = self._execute('sale.config.settings', 'default_get', [])
|
||||
vals.update(self.config.sale_config)
|
||||
wizard_id = self._execute('sale.config.settings', 'create', vals)
|
||||
return self._execute('sale.config.settings', 'execute', [wizard_id])
|
||||
|
||||
def base_config(self):
|
||||
"""Allgemeine Konfiguration laden"""
|
||||
|
||||
vals = self._execute('base.config.settings', 'default_get', [])
|
||||
vals.update(self.config.base_config)
|
||||
wizard_id = self._execute('base.config.settings', 'create', vals)
|
||||
return self._execute('base.config.settings', 'execute', [wizard_id])
|
||||
|
||||
def install_module_sale(self):
|
||||
"""Modul 'Sale' installieren"""
|
||||
|
||||
modules_to_install = self._execute('ir.module.module', 'search', [('name','=','sale'),('state','!=','installed')])
|
||||
res = self._execute('ir.module.module', 'button_install', modules_to_install)
|
||||
res = self._execute('base.module.upgrade', 'upgrade_module', modules_to_install)
|
||||
return True
|
||||
|
||||
def install_modules(self):
|
||||
"""Module installieren"""
|
||||
|
||||
modules_to_install = self._execute('ir.module.module', 'search', [('name','in',self.config.modules),('state','!=','installed')])
|
||||
res = self._execute('ir.module.module', 'button_install', modules_to_install)
|
||||
res = self._execute('base.module.upgrade', 'upgrade_module', modules_to_install)
|
||||
return True
|
||||
|
||||
def set_dokumentennummern(self):
|
||||
"""Dokumentennummern setzen"""
|
||||
|
||||
seq_dict = self.config.sequences
|
||||
|
||||
# Lieferschein
|
||||
if seq_dict.get('picking.out',False):
|
||||
picking_type_ids = self._execute('stock.picking.type', 'search', [])
|
||||
picking_types = self._execute('stock.picking.type', 'read', picking_type_ids, ['sequence_id'])
|
||||
s_ids = [t['sequence_id'][0] for t in picking_types]
|
||||
if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('picking.out')):
|
||||
return False
|
||||
|
||||
# Angebot
|
||||
if seq_dict.get('sale.order',False):
|
||||
s_ids = self._execute('ir.sequence', 'search', [('code','=','sale.order')])
|
||||
if len(s_ids) != 1:
|
||||
return False
|
||||
if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('sale.order')):
|
||||
return False
|
||||
|
||||
# EK-Angebot
|
||||
if seq_dict.get('purchase.order',False):
|
||||
s_ids = self._execute('ir.sequence', 'search', [('code','=','purchase.order')])
|
||||
if len(s_ids) != 1:
|
||||
return False
|
||||
if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('purchase.order')):
|
||||
return False
|
||||
|
||||
# Rechnungsnummer
|
||||
if seq_dict.get('account.invoice',False):
|
||||
j_ids = self._execute('account.journal', 'search', [('code','=','VK')])
|
||||
if len(j_ids) != 1:
|
||||
return False
|
||||
journals = self._execute('account.journal', 'read', j_ids, ['sequence_id'])
|
||||
s_ids = [t['sequence_id'][0] for t in journals]
|
||||
if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('account.invoicer')):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def set_admin_rights(self):
|
||||
"""Setze Administrator Rechte"""
|
||||
|
||||
dummy,user_id = self._execute('ir.model.data', 'get_object_reference', 'base', 'user_root')
|
||||
groups = []
|
||||
|
||||
# Technische Eigenschaften
|
||||
dummy,group_id = self._execute('ir.model.data', 'get_object_reference', 'base', 'group_no_one')
|
||||
groups.append((4,group_id))
|
||||
|
||||
# Finanzmanager
|
||||
dummy,group_id = self._execute('ir.model.data', 'get_object_reference', 'account', 'group_account_manager')
|
||||
groups.append((4,group_id))
|
||||
|
||||
vals = {
|
||||
'groups_id': groups,
|
||||
}
|
||||
|
||||
return self._execute('res.users', 'write', [user_id], vals)
|
||||
|
||||
def setup_accounting(self):
|
||||
"""Konfiguration Buchhaltung"""
|
||||
|
||||
vals = self._execute('account.installer', 'default_get', [])
|
||||
vals['charts'] = self.config.chart_of_accounts
|
||||
wizard_id = self._execute('account.installer', 'create', vals)
|
||||
res = self._execute('account.installer', 'action_next', [wizard_id])
|
||||
return True
|
||||
|
||||
def setup_accounting2(self):
|
||||
"""Konfiguration Kontenplan"""
|
||||
|
||||
c = self.config
|
||||
sales_tax_ids = self._execute('account.tax.template', 'search', [('description','=', c.sales_tax),('parent_id','=',False)])
|
||||
if not sales_tax_ids:
|
||||
return False
|
||||
purchase_tax_ids = self._execute('account.tax.template', 'search', [('description','=', c.purchase_tax),('parent_id','=',False)])
|
||||
if not purchase_tax_ids:
|
||||
return False
|
||||
|
||||
#Set Your Accounting Options
|
||||
dummy,currency_id = self._execute('ir.model.data', 'get_object_reference', 'base', 'EUR')
|
||||
vals = {}
|
||||
vals['chart_template_id'] = c.chart_template_id
|
||||
vals['sale_tax'] = sales_tax_ids[0]
|
||||
vals['purchase_tax'] = purchase_tax_ids[0]
|
||||
vals['company_id'] = 1 # Default
|
||||
vals['currency_id'] = currency_id
|
||||
wizard_id = self._execute('wizard.multi.charts.accounts', 'create', vals)
|
||||
res = self._execute('wizard.multi.charts.accounts', 'action_next', [wizard_id])
|
||||
return True
|
||||
|
||||
def uninstall_chat(self):
|
||||
""" Chat-Modul deinstallieren """
|
||||
|
||||
modules = ['im_chat','im_odoo_support','bus']
|
||||
modules_to_install = self._execute('ir.module.module', 'search', [('name','in',modules)])
|
||||
res = self._execute('ir.module.module', 'button_uninstall', modules_to_install)
|
||||
res = self._execute('base.module.upgrade', 'upgrade_module', modules_to_install)
|
||||
return True
|
||||
|
||||
def set_uom(self):
|
||||
""" Mengeneinheiten setzen"""
|
||||
|
||||
context = {'lang': 'de_DE'}
|
||||
c = self.config
|
||||
active_uoms = c.active_uoms.keys()
|
||||
|
||||
active_ids = []
|
||||
for uom_xml_id in active_uoms:
|
||||
uom_id = self._execute('ir.model.data', 'xmlid_to_res_id', uom_xml_id)
|
||||
active_ids.append(uom_id)
|
||||
|
||||
# Set all other UOMs to inactive
|
||||
inactive_ids = self._execute('product.uom', 'search', [('id','not in',active_ids)])
|
||||
res = self._execute('product.uom', 'write', inactive_ids, {'active': False})
|
||||
if not res:
|
||||
return False
|
||||
|
||||
# Update names
|
||||
for uom_xml_id,name in c.active_uoms.items():
|
||||
uom_id = self._execute('ir.model.data', 'xmlid_to_res_id', uom_xml_id)
|
||||
res = self._execute('product.uom', 'write', [uom_id], {'name': name}, context)
|
||||
if not res:
|
||||
return False
|
||||
return True
|
||||
|
||||
def set_steuerzuordnung(self):
|
||||
"""Steuerzuordnungen setzen"""
|
||||
|
||||
c = self.config
|
||||
|
||||
# Ungültige Steuerzuordnungen auf inaktiv setzen
|
||||
invalid_ids = self._execute('account.fiscal.position', 'search', [('name','not in',c.valid_fiscal_positions)])
|
||||
self._execute('account.fiscal.position', 'write', invalid_ids, {'active': False})
|
||||
|
||||
# Mappings inaktiver Steuern löschen (also wenn rechte Seite eine inaktive Steuer ist, wie z.B "strf. i.g.L"))
|
||||
valid_position_ids = self._execute('account.fiscal.position', 'search', [('name','in',c.valid_fiscal_positions)])
|
||||
valid_tax_ids = self._execute('account.tax', 'search', [('parent_id','=',False)])
|
||||
|
||||
position_tax_line_ids = self._execute('account.fiscal.position.tax', 'search', [('position_id','in',valid_position_ids),('tax_dest_id','not in',valid_tax_ids)])
|
||||
vals = {'tax_dest_id': False}
|
||||
return self._execute('account.fiscal.position.tax', 'write', position_tax_line_ids, vals)
|
||||
|
||||
def update_module(self):
|
||||
"""Aktualisiere Modul"""
|
||||
module_name = self.config.module_name
|
||||
mod_ids = self._execute('ir.module.module', 'search', [('name','=',module_name),('state','=','installed')])
|
||||
if not len(mod_ids) == 1:
|
||||
raise "Module '%s' not found or ist not installed." % module_name
|
||||
|
||||
res = self._execute('ir.module.module', 'button_upgrade', mod_ids)
|
||||
res = self._execute('base.module.upgrade', 'upgrade_module', mod_ids)
|
||||
return True
|
||||
|
||||