From f5004154a2638f006cbfbef8553e6e565625d0ca Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 15 Nov 2017 14:38:08 +0100 Subject: [PATCH 01/10] [FIX ]point_of_sale: hardcode jessie in posbox scripts Before this commit, the latest version of Raspbian was chosen. It is not very helpful though as if something goes wrong, we don't on which part it is. Also, fix python dependencies for the image --- .../posbox/overwrite_before_init/etc/init_posbox_image.sh | 5 +++-- addons/point_of_sale/tools/posbox/posbox_download_images.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 a9dfda63070..4b29ca22e77 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 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 From 837bd786729123ac8def9d42ca657398e8688196 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 16 Nov 2017 13:14:00 +0100 Subject: [PATCH 02/10] [FIX] point_of_sale: fix perms in posbox script Before this commit, the posbox was built and in the process the permissions of the repo were whanged As a result, there was a diff in the repo, making it un-upgradable After this commit, the permissions on the posbox' Odoo repository are unchanged, and no diff is to be seen --- .../tools/posbox/overwrite_before_init/etc/init_posbox_image.sh | 1 - 1 file changed, 1 deletion(-) 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 4b29ca22e77..2e6d05b1c27 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 @@ -54,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/ From 3eb1dd97c42a03b035085864206063d5e349c473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Ku=CC=88hn?= Date: Thu, 7 Dec 2017 17:39:54 +0100 Subject: [PATCH 03/10] [FIX] web: translatable field button over input Before this fix, when editing a translatable input field, the translate button becomes unclickable if the input text is to long. With this fix, the translate button is always on top of the input text. opw-777914 --- addons/web/static/src/css/base.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 14392ce1d6b..73f42c323bb 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2195,6 +2195,10 @@ margin: 3px 0 0 -21px; vertical-align: top; } +.openerp .oe_form .oe_field_translate { // DO NOT FORWARD-PORT + position: relative; + z-index: 1; +} .openerp .oe_form .oe_input_icon_disabled { position: absolute; cursor: default; From 515a5ed900194050930d27d06f237a7c2e627354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Ku=CC=88hn?= Date: Mon, 11 Dec 2017 10:11:04 +0100 Subject: [PATCH 04/10] [FIX] web: correct comments translatable field css Due to mis-use of comments with //, the css style was skipped. The correct way of commenting css is with /* */. --- addons/web/static/src/css/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 73f42c323bb..063ed421131 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2195,7 +2195,7 @@ margin: 3px 0 0 -21px; vertical-align: top; } -.openerp .oe_form .oe_field_translate { // DO NOT FORWARD-PORT +.openerp .oe_form .oe_field_translate { /* DO NOT FORWARD-PORT */ position: relative; z-index: 1; } From 4045e4fe66fc18f3e223a99c781a08a17ee49f60 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 29 May 2018 16:42:16 +0200 Subject: [PATCH 05/10] [FIX] hw_escpos: complying to barcode method A Have a XMLReceipt with the line: 123456789 Print the receipt. Before this commit, jibbrish characters were printed and also kinda 'broke' the spacing between commands e.g. If you add an EAN13 barcode below the code39 it would have failed to print correctly too After this commit, everything prints correctly OPW 1849284 ref: https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=128 closes #24965 --- addons/hw_escpos/escpos/escpos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/hw_escpos/escpos/escpos.py b/addons/hw_escpos/escpos/escpos.py index 4051e65066c..6c93724aedd 100644 --- a/addons/hw_escpos/escpos/escpos.py +++ b/addons/hw_escpos/escpos/escpos.py @@ -522,6 +522,10 @@ class Escpos: # Print Code if code: self._raw(code) + # We are using type A commands + # So we need to add the 'NULL' character + # https://github.com/python-escpos/python-escpos/pull/98/files#diff-a0b1df12c7c67e38915adbe469051e2dR444 + self._raw('\x00') else: raise exception.BarcodeCodeError() From 9e8f70e4849b0eeaca8b5cf51372ecfa23dc561b Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 9 Jul 2018 14:56:33 +0200 Subject: [PATCH 06/10] [FIX] hw_escpos: small fix to avoid error on throwing error --- addons/hw_escpos/escpos/escpos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hw_escpos/escpos/escpos.py b/addons/hw_escpos/escpos/escpos.py index 6c93724aedd..922d5263636 100644 --- a/addons/hw_escpos/escpos/escpos.py +++ b/addons/hw_escpos/escpos/escpos.py @@ -527,7 +527,7 @@ class Escpos: # https://github.com/python-escpos/python-escpos/pull/98/files#diff-a0b1df12c7c67e38915adbe469051e2dR444 self._raw('\x00') else: - raise exception.BarcodeCodeError() + raise BarcodeCodeError() def receipt(self,xml): """ From 4bd58029f498ddc8197c2b5d0fc683b7e54b84cd Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 17 Jul 2018 14:39:32 +0200 Subject: [PATCH 07/10] [FIX] base: avoid duplicated translation entries For records having multiple translated terms per field (like html fields), it was possible to have duplicated entries when synchronizing existing entries with new ones. --- openerp/addons/base/ir/ir_translation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openerp/addons/base/ir/ir_translation.py b/openerp/addons/base/ir/ir_translation.py index 4ebfa0ee4ec..3beb247abe5 100644 --- a/openerp/addons/base/ir/ir_translation.py +++ b/openerp/addons/base/ir/ir_translation.py @@ -491,6 +491,7 @@ class ir_translation(osv.osv): discarded += trans else: trans.write({'src': matches[0], 'state': trans.state}) + trans_src.append(matches[0]) # avoid reuse of term else: outdated += trans From b6ed005e0aa08a315f65fb92161bb13d1fecc36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Wed, 4 Jul 2018 20:53:58 +0200 Subject: [PATCH 08/10] [IMP] doc: remove duplicate line The same content is already there 2 lines above. cherry-pick of 57676dc7d10b50bee44d122d48863586b18e4593 --- doc/reference/guidelines.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/reference/guidelines.rst b/doc/reference/guidelines.rst index 5ae52963b42..669bce0a446 100644 --- a/doc/reference/guidelines.rst +++ b/doc/reference/guidelines.rst @@ -212,7 +212,6 @@ Use the following pattern : *concerned_group* is the short name of the concerned group ('user' for the 'model_name_group_user', 'public' for public user, 'company' for multi-company rules, ...). -* For a group : :samp:`{}_group_{}` where *group_name* is the name of the group, generally 'user', 'manager', ... .. code-block:: xml From a3fd6a2072020f8be41ab76986bc04c1a298528d Mon Sep 17 00:00:00 2001 From: len-odoo Date: Tue, 17 Jul 2018 13:45:23 +0200 Subject: [PATCH 09/10] [FIX] web_forum: fix the comparison of tags ids When checking if tags had changed, a missing .ids made it that a recordset was compared to a set of ids (integers). As a result, to make an edit the forum would always check that the user had sufficent karma to retag, even if it was not needed. opw 1866019 --- addons/website_forum/models/forum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index ebe6bd80b2d..8bbf4717a70 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -502,7 +502,7 @@ class Post(models.Model): self.env.user.sudo().add_karma(post.forum_id.karma_gen_answer_accept * mult) if 'tag_ids' in vals: tag_ids = set(tag.get('id') for tag in self.resolve_2many_commands('tag_ids', vals['tag_ids'])) - if any(set(post.tag_ids) != tag_ids for post in self) and any(self.env.user.karma < post.forum_id.karma_edit_retag for post in self): + if any(set(post.tag_ids.ids) != tag_ids for post in self) and any(self.env.user.karma < post.forum_id.karma_edit_retag for post in self): raise KarmaError(_('Not enough karma to retag.')) if any(key not in trusted_keys for key in vals) and any(not post.can_edit for post in self): raise KarmaError('Not enough karma to edit a post.') From d5baec40abed2498def649bcbbe16c5035acaa66 Mon Sep 17 00:00:00 2001 From: len-odoo Date: Tue, 17 Jul 2018 13:40:34 +0200 Subject: [PATCH 10/10] [FIX] web_forum: disallow tag editing of questions if karma is unsufficient When editing his post, a user can modify the tags even if he doesn't have sufficient karma to do so. Since the backend raises an error, it sends the user to a 403 forbidden page. opw 1866019 --- addons/website_forum/views/website_forum.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index eb0b3a06131..5030f9dba30 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -620,7 +620,7 @@

- +