From 67959566edc87885ec4b7e31807d48514a7b5944 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 15 Jan 2015 11:59:57 +0100 Subject: [PATCH 1/5] [FIX] Packaging: Debian Dockerfile for nightly tests Remove installation of v8 requirements in package.dfdebian as this is unnecessary for v7. This fixes a bug occuring during the installation of openerp (precisely when installing reportlab dependencies), because reportlab now requires a more recent version of pillow than 2.5.1. Also use pip instead of /usr/local/bin/pip in test_tgz (package.py) as pip script isn't installed there anymore. --- setup/package.dfdebian | 42 ------------------------------------------ setup/package.py | 2 +- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/setup/package.dfdebian b/setup/package.dfdebian index 4995a4150b8..148f5513cee 100644 --- a/setup/package.dfdebian +++ b/setup/package.dfdebian @@ -64,45 +64,3 @@ RUN apt-get update -qq && \ python-xlwt \ python-yaml -y && \ rm -rf /var/lib/apt/lists/* - -RUN pip install Babel==1.3 \ - Jinja2==2.7.3 \ - Mako==1.0.0 \ - MarkupSafe==0.23 \ - Pillow==2.5.1 \ - http://download.gna.org/pychart/PyChart-1.39.tar.gz \ - PyYAML==3.11 \ - Werkzeug==0.9.6 \ - argparse==1.2.1 \ - decorator==3.4.0 \ - docutils==0.12 \ - feedparser==5.1.3 \ - gdata==2.0.18 \ - gevent==1.0.1 \ - greenlet==0.4.2 \ - jcconv==0.2.3 \ - lxml==3.3.5 \ - mock==1.0.1 \ - passlib==1.6.2 \ - psutil==2.1.1 \ - psycogreen==1.0 \ - psycopg2==2.5.3 \ - pyPdf==1.13 \ - pydot==1.0.2 \ - pyparsing==1.5.7 \ - pyserial==2.7 \ - python-dateutil==1.5 \ - python-ldap==2.4.15 \ - python-openid==2.2.5 \ - pytz==2014.4 \ - pyusb==1.0.0b1 \ - qrcode==5.0.1 \ - reportlab==3.1.8 \ - requests==2.3.0 \ - simplejson==3.5.3 \ - six==1.7.3 \ - unittest2==0.5.1 \ - vatnumber==1.2 \ - vobject==0.6.6 \ - wsgiref==0.1.2 \ - xlwt==0.7.5 diff --git a/setup/package.py b/setup/package.py index d3d2465beef..779a49902ea 100755 --- a/setup/package.py +++ b/setup/package.py @@ -317,7 +317,7 @@ def test_tgz(o): with docker('openerp-debian-nightly-tests', o.build_dir, o.pub) as wheezy: wheezy.release = 'openerp.tar.gz' wheezy.system("service postgresql start") - wheezy.system('/usr/local/bin/pip install /opt/release/%s' % wheezy.release) + wheezy.system('pip install /opt/release/%s' % wheezy.release) wheezy.system("useradd --system --no-create-home openerp") wheezy.system('su postgres -s /bin/bash -c "createuser -s openerp"') wheezy.system('su postgres -s /bin/bash -c "createdb mycompany"') From 84b5bf94bd59b3be528d2d667e9aa76d8a8fd957 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 15 Jan 2015 19:03:20 +0100 Subject: [PATCH 2/5] [IMP] mail: prevent leaving when composing a message --- addons/mail/static/src/js/mail.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 824a6397dff..25a6c1e8e54 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -408,6 +408,16 @@ openerp.mail = function (session) { this.is_log = false; this.recipients = []; this.recipient_ids = []; + session.web.bus.on('clear_uncommitted_changes', this, function(e) { + if (this.show_composer && !e.isDefaultPrevented()){ + if (!confirm(_t("You are currently composing a message, your message will be discarded.\n\nAre you sure you want to leave this page ?"))) { + e.preventDefault(); + } + else{ + this.on_cancel(); + } + } + }); }, start: function () { From 2f5a7b63d33d4f25106c37eb807ec54e2c22d77b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 16 Jan 2015 13:03:59 +0100 Subject: [PATCH 3/5] [FIX] base: keep first multiline translation in po file The first term of a po file is a comment for translator e.g.: msgid "" msgstr "" "Project-Id-Version: openobject-addons\n" ... This comment is ignored if there is no source and it is the first term of the po file. The first flage was disabled too late and if the following terms also started with an empty source (for too long terms), they were skipped as well. Disable the flag as soon as the condition is evaluated to make sure no additional terms are ignored. opw 619786 --- openerp/tools/translate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 0caecdf342b..4e9ffecb3aa 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -345,6 +345,7 @@ class TinyPoFile(object): source = unquote(line[6:]) line = self.lines.pop(0).strip() if not source and self.first: + self.first = False # if the source is "" and it's the first msgid, it's the special # msgstr with the informations about the traduction and the # traductor; we skip it @@ -374,8 +375,6 @@ class TinyPoFile(object): if t == trans_type == 'code': continue self.extra_lines.append((t, n, r, source, trad, comments)) - self.first = False - if name is None: if not fuzzy: self.warn('Missing "#:" formated comment at line %d for the following source:\n\t%s', From 5959c41631ccc2d5eb1225f37f7002d7890fed13 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 16 Jan 2015 17:24:47 +0100 Subject: [PATCH 4/5] [IMP] res_lang: constraint for grouping field As entering a wrong value in the grouping field of res.lang, for instance '[,]', leads to an unavailability of the web interface, We add a constraint to prevent entering wrong values. --- openerp/addons/base/res/res_lang.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_lang.py b/openerp/addons/base/res/res_lang.py index 78bb972d18d..73c14048672 100644 --- a/openerp/addons/base/res/res_lang.py +++ b/openerp/addons/base/res/res_lang.py @@ -123,6 +123,15 @@ class lang(osv.osv): return False return True + def _check_grouping(self, cr, uid, ids, context=None): + for lang in self.browse(cr, uid, ids, context=context): + try: + if not all(isinstance(x, int) for x in eval(lang.grouping)): + return False + except Exception: + return False + return True + def _get_default_date_format(self, cursor, user, context=None): return '%m/%d/%Y' @@ -158,7 +167,8 @@ class lang(osv.osv): ] _constraints = [ - (_check_format, 'Invalid date/time format directive specified. Please refer to the list of allowed directives, displayed when you edit a language.', ['time_format', 'date_format']) + (_check_format, 'Invalid date/time format directive specified. Please refer to the list of allowed directives, displayed when you edit a language.', ['time_format', 'date_format']), + (_check_grouping, "The Separator Format should be like [,n] where 0 < n :starting from Unit digit.-1 will end the separation. e.g. [3,2,-1] will represent 106500 to be 1,06,500;[1,2,-1] will represent it to be 106,50,0;[3] will represent it as 106,500. Provided ',' as the thousand separator in each case.", ['grouping']) ] @tools.ormcache(skiparg=3) From 6c55a4bfeda86b77080e9076912e0109e2cc5411 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Wed, 17 Dec 2014 12:49:24 -0500 Subject: [PATCH 5/5] Allow EDI fields to be propagated if they have _fnct_inv --- addons/edi/models/edi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/edi/models/edi.py b/addons/edi/models/edi.py index 0b640eaf722..5fa8000a560 100644 --- a/addons/edi/models/edi.py +++ b/addons/edi/models/edi.py @@ -567,7 +567,7 @@ class EDIMixin(object): continue field = field_info.column # skip function/related fields - if isinstance(field, fields.function): + if isinstance(field, fields.function) and not field._fnct_inv: _logger.warning("Unexpected function field value is found in '%s' EDI document: '%s'." % (self._name, field_name)) continue relation_model = field._obj