From e47e78e2e9005268bc7ba6d22ac581c6cec23e82 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 26 Oct 2017 16:22:33 +0200 Subject: [PATCH 1/4] [FIX] website_slides: pdf slide viewer slug When trying to get the pdf content in an IFrame, the url based on ID was not found and then redirected to a rewritten URL eventually with wrong protocol (https became http). This causes a bug in modern browser that doesn't allow mixed content if the base website is in https. By using the slug in the URL, there is no redirection and we avoid changing the protocol. Thanks @Gorash and @nim-odoo opw-777950 --- addons/website_slides/view/website_slides_embed.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_slides/view/website_slides_embed.xml b/addons/website_slides/view/website_slides_embed.xml index 4dd3036d2d6..89ae0f8e4db 100644 --- a/addons/website_slides/view/website_slides_embed.xml +++ b/addons/website_slides/view/website_slides_embed.xml @@ -61,7 +61,7 @@
@@ -135,7 +135,7 @@
- + From c44024b50befd4d8237c53bb18738e0aac4107f3 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Fri, 27 Oct 2017 12:38:33 +0200 Subject: [PATCH 2/4] [FIX] account, l10n_*: preserve existing tags on upgrade Taxes tags for some localization have been rewrote in order to improve the taxes report. However, these changes delete the existing account.tags on stable version. These "[l10n_*] one tag per grid in tax reports" should target master instead of 9.0. -opw: 777464 --- addons/account/models/chart_template.py | 6 ++++++ addons/l10n_fr/__init__.py | 5 +++++ addons/l10n_fr/__openerp__.py | 1 + addons/l10n_lu/__init__.py | 5 +++++ addons/l10n_lu/__openerp__.py | 1 + addons/l10n_no/__init__.py | 5 +++++ addons/l10n_no/__openerp__.py | 1 + addons/l10n_pl/__init__.py | 5 +++++ addons/l10n_pl/__openerp__.py | 1 + addons/l10n_sg/__init__.py | 5 +++++ addons/l10n_sg/__openerp__.py | 1 + addons/l10n_th/__init__.py | 5 +++++ addons/l10n_th/__openerp__.py | 1 + addons/l10n_vn/__init__.py | 5 +++++ addons/l10n_vn/__openerp__.py | 1 + 15 files changed, 48 insertions(+) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 1c341db156d..e54c0c926de 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -36,6 +36,12 @@ def migrate_tags_on_taxes(cr, registry): if len(tax_id) == 1: registry['account.tax'].write(cr, SUPERUSER_ID, tax_id, {'tag_ids': [(6,0,[x.id for x in tax_template.tag_ids])]}) +def preserve_existing_tags_on_taxes(cr, registry, module): + ''' This is a utility function used to preserve existing previous tags during upgrade of the module.''' + xml_record_ids = registry['ir.model.data'].search(cr, SUPERUSER_ID, [('model', 'in', ['account.account.tag']), ('module', 'like', module)]) + if xml_record_ids: + cr.execute("update ir_model_data set noupdate = 't' where id in %s", (tuple(xml_record_ids),)) + # --------------------------------------------------------------- # Account Templates: Account, Tax, Tax Code and chart. + Wizard # --------------------------------------------------------------- diff --git a/addons/l10n_fr/__init__.py b/addons/l10n_fr/__init__.py index daea072a981..ceec906fad2 100644 --- a/addons/l10n_fr/__init__.py +++ b/addons/l10n_fr/__init__.py @@ -4,3 +4,8 @@ # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr import l10n_fr + + +def _preserve_tag_on_taxes(cr, registry): + from openerp.addons.account.models.chart_template import preserve_existing_tags_on_taxes + preserve_existing_tags_on_taxes(cr, registry, 'l10n_fr') diff --git a/addons/l10n_fr/__openerp__.py b/addons/l10n_fr/__openerp__.py index 3f3c2b52be0..8722cea4764 100644 --- a/addons/l10n_fr/__openerp__.py +++ b/addons/l10n_fr/__openerp__.py @@ -41,4 +41,5 @@ configuration of their taxes and fiscal positions manually. 'demo': [], 'auto_install': False, 'installable': True, + 'post_init_hook': '_preserve_tag_on_taxes', } diff --git a/addons/l10n_lu/__init__.py b/addons/l10n_lu/__init__.py index 67dee8c60db..78920d0b259 100644 --- a/addons/l10n_lu/__init__.py +++ b/addons/l10n_lu/__init__.py @@ -1,2 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. + + +def _preserve_tag_on_taxes(cr, registry): + from openerp.addons.account.models.chart_template import preserve_existing_tags_on_taxes + preserve_existing_tags_on_taxes(cr, registry, 'l10n_lu') diff --git a/addons/l10n_lu/__openerp__.py b/addons/l10n_lu/__openerp__.py index 60e65493b7e..0226b035f7e 100644 --- a/addons/l10n_lu/__openerp__.py +++ b/addons/l10n_lu/__openerp__.py @@ -43,4 +43,5 @@ Notes: 'demo': [], 'installable': True, 'auto_install': False, + 'post_init_hook': '_preserve_tag_on_taxes', } diff --git a/addons/l10n_no/__init__.py b/addons/l10n_no/__init__.py index f331cf7cd78..402eb78952d 100644 --- a/addons/l10n_no/__init__.py +++ b/addons/l10n_no/__init__.py @@ -1,2 +1,7 @@ # -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. + + +def _preserve_tag_on_taxes(cr, registry): + from openerp.addons.account.models.chart_template import preserve_existing_tags_on_taxes + preserve_existing_tags_on_taxes(cr, registry, 'l10n_no') diff --git a/addons/l10n_no/__openerp__.py b/addons/l10n_no/__openerp__.py index 7ec28b9783d..653586f17b4 100644 --- a/addons/l10n_no/__openerp__.py +++ b/addons/l10n_no/__openerp__.py @@ -16,4 +16,5 @@ Updated for Odoo 9 by Bringsvor Consulting AS 'account_tax.xml','account_chart_template.yml'], "active": False, "installable": True + 'post_init_hook': '_preserve_tag_on_taxes', } diff --git a/addons/l10n_pl/__init__.py b/addons/l10n_pl/__init__.py index f331cf7cd78..1caaad5449a 100644 --- a/addons/l10n_pl/__init__.py +++ b/addons/l10n_pl/__init__.py @@ -1,2 +1,7 @@ # -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. + + +def _preserve_tag_on_taxes(cr, registry): + from openerp.addons.account.models.chart_template import preserve_existing_tags_on_taxes + preserve_existing_tags_on_taxes(cr, registry, 'l10n_pl') diff --git a/addons/l10n_pl/__openerp__.py b/addons/l10n_pl/__openerp__.py index c738e5bc1bb..6da22326b52 100644 --- a/addons/l10n_pl/__openerp__.py +++ b/addons/l10n_pl/__openerp__.py @@ -30,4 +30,5 @@ Wewnętrzny numer wersji OpenGLOBE 1.02 'account_chart_template.yml' ], 'installable': True, + 'post_init_hook': '_preserve_tag_on_taxes', } diff --git a/addons/l10n_sg/__init__.py b/addons/l10n_sg/__init__.py index 5c72bf53544..3d96174edc6 100644 --- a/addons/l10n_sg/__init__.py +++ b/addons/l10n_sg/__init__.py @@ -2,3 +2,8 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (C) 2014 Tech Receptives (). + + +def _preserve_tag_on_taxes(cr, registry): + from openerp.addons.account.models.chart_template import preserve_existing_tags_on_taxes + preserve_existing_tags_on_taxes(cr, registry, 'l10n_sg') diff --git a/addons/l10n_sg/__openerp__.py b/addons/l10n_sg/__openerp__.py index 55d16ecda57..7793a266a02 100644 --- a/addons/l10n_sg/__openerp__.py +++ b/addons/l10n_sg/__openerp__.py @@ -34,4 +34,5 @@ After installing this module, the Configuration wizard for accounting is launche 'account_chart_template.yml', ], 'installable': True, + 'post_init_hook': '_preserve_tag_on_taxes', } diff --git a/addons/l10n_th/__init__.py b/addons/l10n_th/__init__.py index 67dee8c60db..61aa1e44699 100644 --- a/addons/l10n_th/__init__.py +++ b/addons/l10n_th/__init__.py @@ -1,2 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. + + +def _preserve_tag_on_taxes(cr, registry): + from openerp.addons.account.models.chart_template import preserve_existing_tags_on_taxes + preserve_existing_tags_on_taxes(cr, registry, 'l10n_th') diff --git a/addons/l10n_th/__openerp__.py b/addons/l10n_th/__openerp__.py index aa4557c9563..26bd74ad91e 100644 --- a/addons/l10n_th/__openerp__.py +++ b/addons/l10n_th/__openerp__.py @@ -19,4 +19,5 @@ Thai accounting chart and localization. 'account_chart_template.yml', ], 'installable': True, + 'post_init_hook': '_preserve_tag_on_taxes', } diff --git a/addons/l10n_vn/__init__.py b/addons/l10n_vn/__init__.py index 34293fdfe8d..665f0578bbe 100644 --- a/addons/l10n_vn/__init__.py +++ b/addons/l10n_vn/__init__.py @@ -2,3 +2,8 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. # This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved. + + +def _preserve_tag_on_taxes(cr, registry): + from openerp.addons.account.models.chart_template import preserve_existing_tags_on_taxes + preserve_existing_tags_on_taxes(cr, registry, 'l10n_vn') diff --git a/addons/l10n_vn/__openerp__.py b/addons/l10n_vn/__openerp__.py index ef8efe0555d..b495d0914c9 100644 --- a/addons/l10n_vn/__openerp__.py +++ b/addons/l10n_vn/__openerp__.py @@ -21,4 +21,5 @@ This module applies to companies based in Vietnamese Accounting Standard (VAS). "data" : ["account_chart.xml","account_tax.xml","account_chart_template.yml"], "demo" : [], "installable": True, + 'post_init_hook': '_preserve_tag_on_taxes', } From 6e1e350e512982315b060228a4f52c8e482ff364 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 27 Oct 2017 14:57:33 +0200 Subject: [PATCH 3/4] [FIX] l10n_no: typo missing comma in c44024b50 --- addons/l10n_no/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_no/__openerp__.py b/addons/l10n_no/__openerp__.py index 653586f17b4..ac87ce0c068 100644 --- a/addons/l10n_no/__openerp__.py +++ b/addons/l10n_no/__openerp__.py @@ -15,6 +15,6 @@ Updated for Odoo 9 by Bringsvor Consulting AS "data" : ["account_chart.xml", 'account_tax.xml','account_chart_template.yml'], "active": False, - "installable": True + "installable": True, 'post_init_hook': '_preserve_tag_on_taxes', } From f41690538dc15ecee2918a316f52c03683e88004 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 25 Oct 2017 14:13:36 +0200 Subject: [PATCH 4/4] [FIX] point_of_sale: date string ECMA 5.1 in Date() Before this commit, when opening the POS in IE11, then the customer list, the list was empty. This was due to condition that was wrongly evaluated as false due to the fact that IE11 apparently only wants ECMA5.1 to deal with constructing Date() from a string. After this commit, we construct the Date() object with the right string, and the list of customers doesn't disappear. OPW 776463 For reference: http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15 closes #20468 --- addons/point_of_sale/static/src/js/db.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index 8c61f5ff6ae..4fdaa652a82 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -255,10 +255,12 @@ var PosDB = core.Class.extend({ for(var i = 0, len = partners.length; i < len; i++){ partner = partners[i]; - if ( this.partner_write_date && + var local_partner_date = (this.partner_write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z'); + var dist_partner_date = (partner.write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z'); + if ( this.partner_write_date && this.partner_by_id[partner.id] && - new Date(this.partner_write_date).getTime() + 1000 >= - new Date(partner.write_date).getTime() ) { + new Date(local_partner_date).getTime() + 1000 >= + new Date(dist_partner_date).getTime() ) { // FIXME: The write_date is stored with milisec precision in the database // but the dates we get back are only precise to the second. This means when // you read partners modified strictly after time X, you get back partners that were