From 5032dad17d3bf4d74fd9ac07804881df6e70dafa Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 18 Feb 2013 18:55:59 +0100 Subject: [PATCH 001/158] [FIX] module: install_from_urls: restrict to administrators. Urls must come from apps server. lp bug: https://launchpad.net/bugs/1129299 fixed bzr revid: chs@openerp.com-20130218175559-ygo0goytspg119bl --- openerp/addons/base/module/module.py | 16 ++++++++++++++-- openerp/addons/base/static/src/js/apps.js | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index a0d1eedef2b..73c61812ee0 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -30,6 +30,7 @@ import shutil import tempfile import urllib import urllib2 +import urlparse import zipfile import zipimport @@ -39,6 +40,7 @@ except ImportError: from StringIO import StringIO # NOQA import openerp +import openerp.exceptions from openerp import modules, pooler, tools, addons from openerp.modules.db import create_categories from openerp.tools.parse_version import parse_version @@ -655,6 +657,11 @@ class module(osv.osv): return res def install_from_urls(self, cr, uid, urls, context=None): + if not self.pool['res.users'].has_group(cr, uid, 'base.group_system'): + raise openerp.exceptions.AccessDenied() + + apps_server = urlparse.urlparse(self.get_apps_server(cr, uid, context=context)) + OPENERP = 'openerp' tmp = tempfile.mkdtemp() _logger.debug('Install from url: %r', urls) @@ -663,6 +670,11 @@ class module(osv.osv): for module_name, url in urls.items(): if not url: continue # nothing to download, local version is already the last one + + up = urlparse.urlparse(url) + if up.scheme != apps_server.scheme or up.netloc != apps_server.netloc: + raise openerp.exceptions.AccessDenied() + try: _logger.info('Downloading module `%s` from OpenERP Apps', module_name) content = urllib2.urlopen(url).read() @@ -727,8 +739,8 @@ class module(osv.osv): finally: shutil.rmtree(tmp) - def install_by_names(self, cr, uid, names, context=None): - raise NotImplementedError('# TODO') + def get_apps_server(self, cr, uid, context=None): + return tools.config.get('apps_server', 'https://apps.openerp.com/apps') def _update_dependencies(self, cr, uid, mod_browse, depends=None): if depends is None: diff --git a/openerp/addons/base/static/src/js/apps.js b/openerp/addons/base/static/src/js/apps.js index a55c89a0483..7a77e827a94 100644 --- a/openerp/addons/base/static/src/js/apps.js +++ b/openerp/addons/base/static/src/js/apps.js @@ -62,8 +62,8 @@ openerp.base = function(instance) { if (instance.base.apps_client) { return check_client_available(instance.base.apps_client); } else { - var ICP = new instance.web.Model('ir.config_parameter'); - return ICP.call('get_param', ['apps.server', 'https://apps.openerp.com/apps']).then(function(u) { + var Mod = new instance.web.Model('ir.module.module'); + return Mod.call('get_apps_server').then(function(u) { var link = $(_.str.sprintf('', u))[0]; var host = _.str.sprintf('%s//%s', link.protocol, link.host); var dbname = link.pathname; From a1f11cf0cd19a9599bfe6a7e9a5e05bd0380d423 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Mon, 11 Mar 2013 14:24:33 +0100 Subject: [PATCH 002/158] [FIX] pto in invoice template should not cover the whole document lp bug: https://launchpad.net/bugs/971713 fixed bzr revid: stefan@therp.nl-20130311132433-rfz85yz831u1o1s9 --- .../account/report/account_print_invoice.rml | 28 +++++----- addons/sale/report/sale_order.rml | 52 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/addons/account/report/account_print_invoice.rml b/addons/account/report/account_print_invoice.rml index 4ffa7a33f9d..579b6f0c10a 100644 --- a/addons/account/report/account_print_invoice.rml +++ b/addons/account/report/account_print_invoice.rml @@ -138,21 +138,8 @@ - [[ repeatIn(objects,'o') ]] [[ setLang(o.partner_id.lang) ]] - - - - Description - Taxes - Quantity - Unit Price - Disc.(%) - Price - - - @@ -217,6 +204,19 @@ + + + + + Description + Taxes + Quantity + Unit Price + Disc.(%) + Price + + + @@ -264,6 +264,7 @@ + @@ -371,6 +372,5 @@ - diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml index a00d2d4e3ef..43e517394e5 100644 --- a/addons/sale/report/sale_order.rml +++ b/addons/sale/report/sale_order.rml @@ -126,33 +126,8 @@ - [[repeatIn(objects,'o')]] [[ setLang(o.partner_id.lang) ]] - - - - - Description - - - Tax - - - Quantity - - - Unit Price - - - Disc.(%) - - - Price - - - - @@ -236,6 +211,31 @@ + + + + + + Description + + + VAT + + + Quantity + + + Unit Price + + + Disc.(%) + + + Price + + + + @@ -283,6 +283,7 @@ + @@ -338,6 +339,5 @@ - From b5793bc85b97e99b89875417f1212a9be471fca7 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Mon, 1 Apr 2013 11:05:00 +0530 Subject: [PATCH 003/158] [FIX]Fixed the issue of file input widget which is not working in firefox and IE. bzr revid: msh@openerp.com-20130401053500-q8tsnnr59u2aqawt --- addons/web/static/src/css/base.css | 9 +++++---- addons/web/static/src/css/base.sass | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 385405e39ca..cbfa554c735 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -1269,7 +1269,7 @@ color: white; padding: 2px 4px; margin: 1px 6px 0 0; - border: 1px solid lightGray; + border: 1px solid lightgrey; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -moz-border-radius: 4px; -webkit-border-radius: 4px; @@ -1301,7 +1301,7 @@ transform: scale(1.1); } .openerp .oe_secondary_submenu .oe_active { - border-top: 1px solid lightGray; + border-top: 1px solid lightgrey; border-bottom: 1px solid #dedede; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2); @@ -2284,7 +2284,7 @@ } .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span { font-size: 80%; - color: darkGreen; + color: darkgreen; vertical-align: top; position: relative; top: -4px; @@ -2475,6 +2475,7 @@ } .openerp .oe_hidden_input_file { position: relative; + overflow-x: hidden; } .openerp .oe_hidden_input_file input.oe_form_binary_file { z-index: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 5fe5b1ceaf4..fcace37ec03 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1967,6 +1967,7 @@ $sheet-padding: 16px // Position: relative is used for the hidden input[type=file] // Do not remove it anymore ! position: relative + overflow-x: hidden input.oe_form_binary_file z-index: 0 line-height: 0 From 05347eac9b8b116a3f844e21ba282180b6a4fa90 Mon Sep 17 00:00:00 2001 From: Mohammad Alhashash Date: Mon, 6 May 2013 22:04:20 +0200 Subject: [PATCH 004/158] Fixing bugs 1177076 and 1177063: Add module name in context view reference Add group stock.group_production_lot for Traceability section in view_move_form bzr revid: alhashash@centrivision.com-20130506200420-ph86vjd3d208ttly --- addons/stock/stock_view.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 83362ab5d6f..5878a578868 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -776,7 +776,7 @@ - + @@ -911,7 +911,7 @@ - +
@@ -1038,7 +1038,7 @@ - +
@@ -1256,7 +1256,7 @@ + groups="stock.group_tracking_lot,stock.group_production_lot">