From 1fda2168872348e66c26bc92dc63f58c2d13ad92 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Thu, 6 Jul 2017 17:01:33 +0200 Subject: [PATCH 1/3] [FIX] l10n_fr_certification: set auto_install to False Due to recent decision by the French government this might not be mandatory for french companies --- addons/l10n_fr_certification/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_fr_certification/__openerp__.py b/addons/l10n_fr_certification/__openerp__.py index e83e9102914..7e2ea327d54 100644 --- a/addons/l10n_fr_certification/__openerp__.py +++ b/addons/l10n_fr_certification/__openerp__.py @@ -9,7 +9,7 @@ """, 'depends': ['l10n_fr'], 'installable': True, - 'auto_install': True, + 'auto_install': False, 'application': True, 'data': [ 'views/no_cancel.xml', From a1f1f85be2039b6f3443e2f1b504373f4e62e4d8 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Mon, 26 Jun 2017 14:44:20 +0200 Subject: [PATCH 2/3] [FIX] workflow: insertion of duplicates in many2many relation --- openerp/workflow/workitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/workflow/workitem.py b/openerp/workflow/workitem.py index 29d3294dc0f..6a8e2d600fc 100644 --- a/openerp/workflow/workitem.py +++ b/openerp/workflow/workitem.py @@ -242,7 +242,7 @@ class WorkflowItem(object): transitions.append((transition['id'], self.workitem['inst_id'])) if test and transitions: - cr.executemany('insert into wkf_witm_trans (trans_id,inst_id) values (%s,%s)', transitions) + cr.executemany('insert into wkf_witm_trans (trans_id,inst_id) values (%s,%s) except (select trans_id,inst_id from wkf_witm_trans)', transitions) cr.execute('delete from wkf_workitem where id=%s', (self.workitem['id'],)) for t in transitions: self._join_test(t[0], t[1], stack) From 63ad8b95976ef0514168cbfb101a370bd857be87 Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Thu, 6 Jul 2017 14:58:23 +0200 Subject: [PATCH 3/3] [FIX] tools: prevent crashes with Pillow >= 4.2.0 From Pillow 4.2, it is forbidden to save RGBA images as JPEG ( https://github.com/python-pillow/Pillow/commit/e4d6223c944cf44c468cc65a560b94dfcf351a62 ) A crash was occurring when loading demo JPGs as image_resize_and_sharpen() was silently changing image mode to RGBA. Now we ensure that we return the original image mode. We also avoid crashes when converting from PNG to JPG --- openerp/tools/image.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openerp/tools/image.py b/openerp/tools/image.py index 251569c7247..ce50298b094 100644 --- a/openerp/tools/image.py +++ b/openerp/tools/image.py @@ -93,7 +93,7 @@ def image_resize_image(base64_source, size=(1024, 1024), encoding='base64', file if image.size != size: image = image_resize_and_sharpen(image, size) - if image.mode not in ["1", "L", "P", "RGB", "RGBA"]: + if image.mode not in ["1", "L", "P", "RGB", "RGBA"] or (filetype == 'JPEG' and image.mode == 'RGBA'): image = image.convert("RGB") background_stream = StringIO.StringIO() @@ -110,6 +110,7 @@ def image_resize_and_sharpen(image, size, preserve_aspect_ratio=False, factor=2. :param preserve_aspect_ratio: boolean (default: False) :param factor: Sharpen factor (default: 2.0) """ + origin_mode = image.mode if image.mode != 'RGBA': image = image.convert('RGBA') image.thumbnail(size, Image.ANTIALIAS) @@ -120,6 +121,8 @@ def image_resize_and_sharpen(image, size, preserve_aspect_ratio=False, factor=2. # create a transparent image for background and paste the image on it image = Image.new('RGBA', size, (255, 255, 255, 0)) image.paste(resized_image, ((size[0] - resized_image.size[0]) / 2, (size[1] - resized_image.size[1]) / 2)) + if image.mode != origin_mode: + image = image.convert(origin_mode) return image def image_save_for_web(image, fp=None, format=None):