From f0205c9219b89957f7a4304a32365ad8fe417304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=BCckl?= Date: Tue, 7 Apr 2015 15:40:14 +0200 Subject: [PATCH] cleanup, debug flag --- dev/odoo-server-dev-br.conf | 3 +- dev/odoo-server-dev-ka.conf | 3 +- dev/odoo-server-dev-sk.conf | 3 +- ext/config/odoo-443.nginx | 66 ------------------- ext/config/odoo-80.nginx | 50 -------------- ext/config/odoo-server.conf | 2 +- ext/custom-addons/cam_custom/__openerp__.py | 3 +- .../cam_custom/cam_custom_view.xml | 34 +++++++++- .../cam_custom/security/ir.model.access.csv | 2 + .../controllers/testenv_controller.py | 41 ++++-------- setup/{ => archive}/install-odoo-7.sh | 0 setup/{ => archive}/install_nginx.sh | 0 setup/{ => archive}/install_odoo.sh | 0 setup/{ => archive}/install_tools.sh | 0 setup/lib/cli.py | 1 + setup/lib/config_at.py | 19 ++++-- setup/lib/environments.py | 2 +- setup/lib/functions.py | 12 +++- 18 files changed, 81 insertions(+), 160 deletions(-) delete mode 100644 ext/config/odoo-443.nginx delete mode 100644 ext/config/odoo-80.nginx create mode 100644 ext/custom-addons/cam_custom/security/ir.model.access.csv rename setup/{ => archive}/install-odoo-7.sh (100%) rename setup/{ => archive}/install_nginx.sh (100%) rename setup/{ => archive}/install_odoo.sh (100%) rename setup/{ => archive}/install_tools.sh (100%) diff --git a/dev/odoo-server-dev-br.conf b/dev/odoo-server-dev-br.conf index baae021a..abad481e 100644 --- a/dev/odoo-server-dev-br.conf +++ b/dev/odoo-server-dev-br.conf @@ -11,4 +11,5 @@ db_password = False addons_path = ext/odoo/addons,ext/custom-addons,dmi/run1 timezone = Europe/Brussels -#dbfilter_test = ['.*',] \ No newline at end of file +#dbfilter_test = ['.*',] +show_debug = 1 \ No newline at end of file diff --git a/dev/odoo-server-dev-ka.conf b/dev/odoo-server-dev-ka.conf index baae021a..abad481e 100644 --- a/dev/odoo-server-dev-ka.conf +++ b/dev/odoo-server-dev-ka.conf @@ -11,4 +11,5 @@ db_password = False addons_path = ext/odoo/addons,ext/custom-addons,dmi/run1 timezone = Europe/Brussels -#dbfilter_test = ['.*',] \ No newline at end of file +#dbfilter_test = ['.*',] +show_debug = 1 \ No newline at end of file diff --git a/dev/odoo-server-dev-sk.conf b/dev/odoo-server-dev-sk.conf index 92fedff4..337c2e0e 100644 --- a/dev/odoo-server-dev-sk.conf +++ b/dev/odoo-server-dev-sk.conf @@ -11,4 +11,5 @@ db_password = False addons_path = ext/odoo/addons,ext/custom-addons,dmi/run1 timezone = Europe/Brussels -#dbfilter_test = ['.*',] \ No newline at end of file +#dbfilter_test = ['.*',] +show_debug = 1 \ No newline at end of file diff --git a/ext/config/odoo-443.nginx b/ext/config/odoo-443.nginx deleted file mode 100644 index 40750f45..00000000 --- a/ext/config/odoo-443.nginx +++ /dev/null @@ -1,66 +0,0 @@ -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; - } - -} diff --git a/ext/config/odoo-80.nginx b/ext/config/odoo-80.nginx deleted file mode 100644 index 6fb7c17c..00000000 --- a/ext/config/odoo-80.nginx +++ /dev/null @@ -1,50 +0,0 @@ -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; - } - -} diff --git a/ext/config/odoo-server.conf b/ext/config/odoo-server.conf index 4cd6e45d..7a2599d6 100644 --- a/ext/config/odoo-server.conf +++ b/ext/config/odoo-server.conf @@ -10,7 +10,7 @@ db_user = False debug_mode = False list_db = True -log_level = error +log_level = warn #max_cron_threads = 1 #workers = 1 diff --git a/ext/custom-addons/cam_custom/__openerp__.py b/ext/custom-addons/cam_custom/__openerp__.py index 7709fa23..3fbdcc18 100644 --- a/ext/custom-addons/cam_custom/__openerp__.py +++ b/ext/custom-addons/cam_custom/__openerp__.py @@ -27,11 +27,12 @@ 'description': """Individuelle Anpassungen""", 'author': 'camadeus GmbH', 'website': 'http://www.camadeus.at', - 'depends': ['crm','sale','mail','product','account'], + 'depends': ['knowledge','crm','sale','mail','product','account'], 'data': [ 'cam_custom_view.xml', 'cam_custom_data.xml', 'views/custom_theme.xml', + 'security/ir.model.access.csv', ], 'installable': True, 'auto_install': False, diff --git a/ext/custom-addons/cam_custom/cam_custom_view.xml b/ext/custom-addons/cam_custom/cam_custom_view.xml index 2590defa..8852021a 100644 --- a/ext/custom-addons/cam_custom/cam_custom_view.xml +++ b/ext/custom-addons/cam_custom/cam_custom_view.xml @@ -74,6 +74,38 @@ - + + + + + + Dokumente + ir.actions.act_window + ir.attachment + form + tree,form + +

+ Click to create a new document. +

+ The Documents repository gives you access to all attachments, such + as mails, project documents, invoices etc. +

+
+
+ + diff --git a/ext/custom-addons/cam_custom/security/ir.model.access.csv b/ext/custom-addons/cam_custom/security/ir.model.access.csv new file mode 100644 index 00000000..52d55274 --- /dev/null +++ b/ext/custom-addons/cam_custom/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"crm_opportunity_report_show","crm_opportunity_report_show","crm.model_crm_opportunity_report","base.group_sale_salesman",1,,, diff --git a/ext/custom-addons/cam_testenv/controllers/testenv_controller.py b/ext/custom-addons/cam_testenv/controllers/testenv_controller.py index cd49947e..45da4227 100644 --- a/ext/custom-addons/cam_testenv/controllers/testenv_controller.py +++ b/ext/custom-addons/cam_testenv/controllers/testenv_controller.py @@ -1,41 +1,24 @@ # -*- 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 +from openerp.addons.web.controllers.main import Home +from openerp.http import request +class Home_Debug(Home): + + @http.route('/', type='http', auth="none") + def index(self, s_action=None, db=None, **kw): + + # Check arguments + if openerp.tools.config.get('show_debug', False): + return http.local_redirect('/web?debug=1', query=request.params, keep_hash=True) + else: + return http.local_redirect('/web', query=request.params, keep_hash=True) class WebClient(http.Controller): _cp_path = "/web/testenv" diff --git a/setup/install-odoo-7.sh b/setup/archive/install-odoo-7.sh similarity index 100% rename from setup/install-odoo-7.sh rename to setup/archive/install-odoo-7.sh diff --git a/setup/install_nginx.sh b/setup/archive/install_nginx.sh similarity index 100% rename from setup/install_nginx.sh rename to setup/archive/install_nginx.sh diff --git a/setup/install_odoo.sh b/setup/archive/install_odoo.sh similarity index 100% rename from setup/install_odoo.sh rename to setup/archive/install_odoo.sh diff --git a/setup/install_tools.sh b/setup/archive/install_tools.sh similarity index 100% rename from setup/install_tools.sh rename to setup/archive/install_tools.sh diff --git a/setup/lib/cli.py b/setup/lib/cli.py index dba70ba9..e11e4457 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -53,6 +53,7 @@ def main(): 'base_config', 'sale_config', 'stock_config', + 'stock_set_cost_method', 'set_incoterms', 'purchase_config', 'set_date_format', diff --git a/setup/lib/config_at.py b/setup/lib/config_at.py index fff90a12..900489ae 100644 --- a/setup/lib/config_at.py +++ b/setup/lib/config_at.py @@ -21,10 +21,10 @@ class Config(): 'fax': False, 'email': 'office@camadeus.at', 'website': 'http://www.camadeus.at', - 'company_registry': '280076b ', + 'company_registry': '280076b', 'country_id': 'at', # "de" für deutschland 'logo': False, - 'vat': 'ATU 62991855 ', + 'vat': 'ATU 62991855', 'rml_header1': False, 'vat_check_vies': True, 'tax_calculation_rounding_method': 'round_globally', @@ -57,7 +57,6 @@ class Config(): #'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)', @@ -76,7 +75,6 @@ class Config(): # Einstellungen Verkauf self.sale_config = { - 'group_uom': True, # Verwende Mengeneinheiten '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 @@ -87,15 +85,21 @@ class Config(): # Einstellungen Einkauf self.purchase_config = { 'group_purchase_pricelist': True, # Preislisten verwenden + 'default_invoice_method': 'manual', # [picking] - Rechnung von Lieferscheinen + # [manual] - von Bestellpositionen + # [order] - Vorabrechnungsentwurf durch Bestellung + 'group_costing_method': True, # Benutzen Sie 'Einkaufs-' oder 'Durchschnittspreis' zur Bestandsbewertung } #Einstellungen Lager self.stock_config = { - 'group_stock_multiple_locations': True, # Verwalten Sie mehrere Läger und Lagerorte + 'group_stock_multiple_locations': True, # Verwalten Sie mehrere Lager und Lagerorte 'group_stock_tracking_lot': False, # Benutze Verpackungen: Paletten, Boxen, ... 'group_stock_packaging': False, # Ermöglicht die Auswahl einer Verpackung } + self.stock_cost_method = 'average' # [standard], [average], [real] + # Wenn gesetzt, teilen sich Gutschriften und Rechnungen den selben Nummernkreis self.refund_invoice_sequence = True @@ -156,6 +160,7 @@ class Config(): self.modules = [ 'document', + 'knowledge', 'auth_crypt', 'cam_testenv', 'cam_max_width', @@ -165,8 +170,8 @@ class Config(): 'account_cancel', 'cam_invoice_skonto', 'web_printscreen_zb', - #'crm', - #'sale', + 'crm', + 'sale', #'cam_hr_overtime', #'cam_hr', ] diff --git a/setup/lib/environments.py b/setup/lib/environments.py index 45d86b5e..1e26690e 100644 --- a/setup/lib/environments.py +++ b/setup/lib/environments.py @@ -24,6 +24,6 @@ Port: %s ENVIRONMENTS = { 'br': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'), 'sk': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'), - 'test': Environment('https://INSTANCE.camadeus.at', '443', 'INSTANCE_1', 'admin', 'x', 'asdfasdf'), + 'test': Environment('https://INSTANCE.camadeus.at', '443', 'INSTANCE_1', 'admin', '141kcal', 'asdfasdf'), } \ No newline at end of file diff --git a/setup/lib/functions.py b/setup/lib/functions.py index c52a1fa8..e3060672 100755 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -534,4 +534,14 @@ class CamadeusFunctions(): return self._execute('ir.mail_server', 'write', server_ids, vals) else: return self._execute('ir.mail_server', 'create', vals) - return False \ No newline at end of file + return False + + def stock_set_cost_method(self): + """Kalkulationsverfahren für Lager setzen""" + + if hasattr(self.config, 'stock_cost_method'): + method = self.config.stock_cost_method + self._execute('ir.values', 'set_default', 'product.template', 'cost_method', method) + return True + + return True \ No newline at end of file