diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 07f30ba28a2..fef233c4d05 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -53,7 +53,7 @@ class MrpProduction(models.Model): domain=[('type', 'in', ['product', 'consu'])], readonly=True, required=True, states={'confirmed': [('readonly', False)]}) - product_tmpl_id = fields.Many2one('product.template', 'Product Template', related='product_id.product_tmpl_id') + product_tmpl_id = fields.Many2one('product.template', 'Product Template', related='product_id.product_tmpl_id', readonly=True) product_qty = fields.Float( 'Quantity To Produce', default=1.0, digits=dp.get_precision('Product Unit of Measure'), diff --git a/addons/web_editor/static/lib/summernote/src/js/EventHandler.js b/addons/web_editor/static/lib/summernote/src/js/EventHandler.js index 578bcfd7a0c..a924e7def8a 100644 --- a/addons/web_editor/static/lib/summernote/src/js/EventHandler.js +++ b/addons/web_editor/static/lib/summernote/src/js/EventHandler.js @@ -365,7 +365,7 @@ define([ (keycode > 185 && keycode < 193) || // ;=,-./` (in order) (keycode > 218 && keycode < 223))) { // [\]' (in order)) eventName = 'visible'; - } else if (!keycode) { + } else if (!keycode && event.key !== 'Dead') { self.invoke('restoreRange', $editable); } // ODOO: end_modification) diff --git a/odoo/addons/base/ir/ir_actions_report.py b/odoo/addons/base/ir/ir_actions_report.py index 6db74fffcf7..10a0b0b634e 100644 --- a/odoo/addons/base/ir/ir_actions_report.py +++ b/odoo/addons/base/ir/ir_actions_report.py @@ -44,6 +44,7 @@ def _get_wkhtmltopdf_bin(): # Check the presence of Wkhtmltopdf and return its version at Odoo start-up wkhtmltopdf_state = 'install' +wkhtmltopdf_dpi_zoom_ratio = False try: process = subprocess.Popen( [_get_wkhtmltopdf_bin(), '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE @@ -61,6 +62,8 @@ else: wkhtmltopdf_state = 'upgrade' else: wkhtmltopdf_state = 'ok' + if LooseVersion(version) >= LooseVersion('0.12.2'): + wkhtmltopdf_dpi_zoom_ratio = True if config['workers'] == 1: _logger.info('You need to start Odoo with at least two workers to print a pdf version of the reports.') @@ -234,14 +237,19 @@ class IrActionsReport(models.Model): else: command_args.extend(['--margin-top', str(paperformat_id.margin_top)]) + dpi = None if specific_paperformat_args and specific_paperformat_args.get('data-report-dpi'): - command_args.extend(['--dpi', str(specific_paperformat_args['data-report-dpi'])]) + dpi = int(specific_paperformat_args['data-report-dpi']) elif paperformat_id.dpi: if os.name == 'nt' and int(paperformat_id.dpi) <= 95: _logger.info("Generating PDF on Windows platform require DPI >= 96. Using 96 instead.") - command_args.extend(['--dpi', '96']) + dpi = 96 else: - command_args.extend(['--dpi', str(paperformat_id.dpi)]) + dpi = paperformat_id.dpi + if dpi: + command_args.extend(['--dpi', str(dpi)]) + if wkhtmltopdf_dpi_zoom_ratio: + command_args.extend(['--zoom', str(96.0 / dpi)]) if specific_paperformat_args and specific_paperformat_args.get('data-report-header-spacing'): command_args.extend(['--header-spacing', str(specific_paperformat_args['data-report-header-spacing'])])