diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 5a7ad534da7..87da49422e1 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -567,7 +567,7 @@ class AccountTaxGroup(models.Model): class AccountTax(models.Model): _name = 'account.tax' _description = 'Tax' - _order = 'sequence' + _order = 'sequence,id' @api.model def _default_tax_group(self): diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index e573bc0de46..729f2981e5b 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1358,6 +1358,8 @@ class MailThread(models.AbstractModel): mail module, and should not contain security or generic html cleaning. Indeed those aspects should be covered by the html_sanitize method located in tools. """ + if not body: + return body, attachments root = lxml.html.fromstring(body) postprocessed = False to_remove = [] @@ -1392,7 +1394,7 @@ class MailThread(models.AbstractModel): # Content-Type: multipart/related; # boundary="_004_3f1e4da175f349248b8d43cdeb9866f1AMSPR06MB343eurprd06pro_"; # type="text/html" - if not message.is_multipart() or message.get('content-type', '').startswith("text/"): + if message.get_content_maintype() == 'text': encoding = message.get_content_charset() body = message.get_payload(decode=True) body = tools.ustr(body, encoding, errors='replace') diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/mail/tests/test_mail_gateway.py index fd2f80ce103..392fc55751c 100644 --- a/addons/mail/tests/test_mail_gateway.py +++ b/addons/mail/tests/test_mail_gateway.py @@ -176,6 +176,19 @@ Content-Type: text/html; --Apple-Mail=_9331E12B-8BD2-4EC7-B53E-01F3FBEC9227-- """ +MAIL_SINGLE_BINARY = """X-Original-To: raoul@grosbedon.fr +Delivered-To: raoul@grosbedon.fr +Received: by mail1.grosbedon.com (Postfix, from userid 10002) + id E8166BFACA; Fri, 23 Aug 2013 13:18:01 +0200 (CEST) +From: "Bruce Wayne" +Content-Type: application/pdf; +Content-Disposition: filename=thetruth.pdf +Content-Transfer-Encoding: base64 +Message-Id: <6BB1FAB2-2104-438E-9447-07AE2C8C4A92@sexample.com> +Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) + +SSBhbSB0aGUgQmF0TWFuCg==""" + MAIL_MULTIPART_IMAGE = """X-Original-To: raoul@example.com Delivered-To: micheline@example.com @@ -348,6 +361,10 @@ class TestMailgateway(TestMail): res.get('body', ''), 'message_parse: second part of the html version should be in body after parsing multipart/mixed') + res = self.env['mail.thread'].message_parse(MAIL_SINGLE_BINARY) + self.assertEqual(res['body'], '') + self.assertEqual(res['attachments'][0][0], 'thetruth.pdf') + @mute_logger('odoo.addons.mail.models.mail_thread') def test_message_process_cid(self): new_groups = self.format_and_process(MAIL_MULTIPART_IMAGE, subject='My Frogs', to='groups@example.com') diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index f29c559dd1b..cc04f10b198 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1054,10 +1054,10 @@ var ClientListScreenWidget = ScreenWidget.extend({ this.$('.searchbox input').on('keypress',function(event){ clearTimeout(search_timeout); - var query = this.value; + var searchbox = this; search_timeout = setTimeout(function(){ - self.perform_search(query,event.which === 13); + self.perform_search(searchbox.value, event.which === 13); },70); }); diff --git a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh index 00058bef68c..6856f9b4d06 100755 --- a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh +++ b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh @@ -17,8 +17,7 @@ export DEBIAN_FRONTEND=noninteractive echo "nameserver 8.8.8.8" >> /etc/resolv.conf -apt-get update -apt-get -y dist-upgrade +apt-get update && apt-get -y upgrade # Do not be too fast to upgrade to more recent firmware and kernel than 4.38 # Firmware 4.44 seems to prevent the LED mechanism from working @@ -39,6 +38,8 @@ rm -rf /usr/share/doc pip install pyusb==1.0.0b1 pip install qrcode pip install evdev +pip install simplejson +pip install unittest2 # --upgrade because websocket_client in wheezy is bad: # https://github.com/docker/compose/issues/1288 @@ -53,7 +54,6 @@ sudo -u postgres createuser -s pi mkdir /var/log/odoo chown pi:pi /var/log/odoo chown pi:pi -R /home/pi/odoo/ -chmod 770 -R /home/pi/odoo/ # logrotate is very picky when it comes to file permissions chown -R root:root /etc/logrotate.d/ diff --git a/addons/point_of_sale/tools/posbox/posbox_download_images.sh b/addons/point_of_sale/tools/posbox/posbox_download_images.sh index 09bd79b2103..33beddac041 100755 --- a/addons/point_of_sale/tools/posbox/posbox_download_images.sh +++ b/addons/point_of_sale/tools/posbox/posbox_download_images.sh @@ -1,5 +1,5 @@ #!/bin/sh -wget 'https://downloads.raspberrypi.org/raspbian_lite_latest' -O raspbian.img.zip +wget 'http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-07-05/2017-07-05-raspbian-jessie-lite.zip' -O raspbian.img.zip unzip raspbian.img.zip wget 'https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.4.13-jessie' -O kernel-qemu diff --git a/addons/web/static/src/js/views/graph_widget.js b/addons/web/static/src/js/views/graph_widget.js index e67d12bcc18..3b7abcea0af 100644 --- a/addons/web/static/src/js/views/graph_widget.js +++ b/addons/web/static/src/js/views/graph_widget.js @@ -67,7 +67,8 @@ return Widget.extend({ values = []; if (this.groupbys.length === 1) data_pt.value = [data_pt.value]; for (j = 0; j < data_pt.value.length; j++) { - values[j] = this.sanitize_value(data_pt.value[j], data_pt.grouped_on[j]); + var field = _.isArray(data_pt.grouped_on) ? data_pt.grouped_on[j] : data_pt.grouped_on; + values[j] = this.sanitize_value(data_pt.value[j], field); } value = is_count ? data_pt.length : data_pt.aggregates[this.measure]; this.data.push({ diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js index 306fe1a4cb0..d7bdbc7425b 100644 --- a/addons/website/static/src/js/website.snippets.animation.js +++ b/addons/website/static/src/js/website.snippets.animation.js @@ -122,7 +122,11 @@ animation.registry.share = animation.Class.extend({ animation.registry.media_video = animation.Class.extend({ selector: ".media_iframe_video", start: function () { - if (!this.$target.has('> iframe').length) { + // TODO: this code should be refactored to make more sense and be better + // integrated with Odoo (this refactoring should be done in master). + this.$target.find('iframe').remove(); + + if (!this.$target.has('.media_iframe_video_size').length) { var editor = '
 
'; var size = '
 
'; this.$target.html(editor+size); diff --git a/addons/website_event/views/website_event_templates.xml b/addons/website_event/views/website_event_templates.xml index 343b09fe739..de02a0f3682 100644 --- a/addons/website_event/views/website_event_templates.xml +++ b/addons/website_event/views/website_event_templates.xml @@ -470,7 +470,7 @@