From 258eaa7a3ce7c25e93f1b9940351335bfcda2aeb Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 15 Nov 2018 16:48:12 +0100 Subject: [PATCH 1/6] =?UTF-8?q?[FIX]=20web=5Feditor:=20firefox=20`=C2=B4?= =?UTF-8?q?=20accent=20no=20break=20position?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On firefox if we do for example: ALT+GR + [ALT+GRable ´ key] Firefox may send keys "AltGr" and "Dead" instead of just "AltGr". This was possibly causing caret to go a position too low when writing speedily with diacritical marks. opw-1903865 closes #28739 --- addons/web_editor/static/lib/summernote/src/js/EventHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 09a7b00082a..1cb9cd8e1c7 100644 --- a/addons/web_editor/static/lib/summernote/src/js/EventHandler.js +++ b/addons/web_editor/static/lib/summernote/src/js/EventHandler.js @@ -361,7 +361,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) From 7b8c415fc5759e492b6d8f8d51708496b83a0d47 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 19 Nov 2018 10:51:29 +0100 Subject: [PATCH 2/6] purchase_mrp: qty_received not updated on a PO Steps to reproduce the bug: - Let's consider a product P with a BOM in kit - Create a PO with P and confirm it - Cancel the shipment and the PO - Reset to draft the PO and confirm it - Valide the new shipment and receive P Bug: The qty_received was not updated opw:1904678 --- addons/purchase_mrp/models/purchase_mrp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase_mrp/models/purchase_mrp.py b/addons/purchase_mrp/models/purchase_mrp.py index 25bfef78e85..6af86f3ce97 100644 --- a/addons/purchase_mrp/models/purchase_mrp.py +++ b/addons/purchase_mrp/models/purchase_mrp.py @@ -23,7 +23,8 @@ class PurchaseOrderLine(models.Model): # In the case of a kit, we need to check if all components are shipped. Since the BOM might # have changed, we don't compute the quantities but verify the move state. if bom: - bom_delivered = all([move.state == 'done' for move in self.move_ids]) + moves = self.move_ids.filtered(lambda m: m.picking_id and m.picking_id.state != 'cancel') + bom_delivered = all([move.state == 'done' for move in moves]) if bom_delivered: return self.product_qty else: From 8a6162d00d1cc1cf709f1a98c775ab4de8eabc19 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Tue, 13 Nov 2018 12:28:24 +0100 Subject: [PATCH 3/6] [FIX] mrp: User with no products write access cannot create production order As the product_tmpl_id field is related one but not readonly, the creation of production order triggers a write on product.product model --- addons/mrp/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index cfc80e4415d..342894ccd3a 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'), From e81809b89d24f2fd309ddaf1d523231109752995 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Tue, 13 Nov 2018 11:39:59 +0100 Subject: [PATCH 4/6] [FIX] mrp: Allow mrp user to delete stock_move_lot links With an mrp user, add lots lines to mrp production order moves. Then, try to delete one line, the dustbin icon does not appear. opw-1908930 --- addons/mrp/security/ir.model.access.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index f8d4ed0f121..aabf18c4835 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -57,5 +57,5 @@ access_mrp_unbuild,mrp.unbuild,model_mrp_unbuild,group_mrp_user,1,0,0,0 access_mrp_unbuild_manager,mrp.unbuild manager,model_mrp_unbuild,group_mrp_manager,1,1,1,1 access_mrp_message_mrp_user,mrp.message,model_mrp_message,group_mrp_user,1,0,0,0 access_mrp_message_mrp_manager,mrp.message,model_mrp_message,group_mrp_manager,1,1,1,1 -access_stock_move_lots,stock.move.lots,model_stock_move_lots,group_mrp_user,1,1,1,0 +access_stock_move_lots,stock.move.lots,model_stock_move_lots,group_mrp_user,1,1,1,1 access_stock_move_lots_manager,stock.move.lots,model_stock_move_lots,group_mrp_manager,1,1,1,1 From 1f8788deefc2fd07428695207393ed4d94997216 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 21 Nov 2018 17:31:15 +0100 Subject: [PATCH 5/6] [FIX] purchase: es_AR translation typo Fixing it directly by commit since there is no es_AR on transifex. The issue of the ticket has been solved by transifex, this is for another similar issue that has been found. opw-1907924 closes #28923 --- addons/purchase/i18n/es_AR.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/i18n/es_AR.po b/addons/purchase/i18n/es_AR.po index 18f7531759f..cbcc5fde375 100644 --- a/addons/purchase/i18n/es_AR.po +++ b/addons/purchase/i18n/es_AR.po @@ -27,7 +27,7 @@ msgstr "# de líneas" #: model:mail.template,subject:purchase.email_template_edi_purchase #: model:mail.template,subject:purchase.email_template_edi_purchase_done msgid "${object.company_id.name} Order (Ref ${object.name or 'n/a' })" -msgstr "${object.company_id.name} Orden (Ref ${object.name o 'n/a' })" +msgstr "${object.company_id.name} Orden (Ref ${object.name or 'n/a' })" #. module: purchase #: model:ir.model.fields,help:purchase.field_purchase_config_settings_group_uom From af476c6949dfe70b2379c41c8ab0b728358e3782 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 21 Nov 2018 09:12:37 +0000 Subject: [PATCH 6/6] [FIX] report: support for wkhtmltopdf 0.12.5 This revision brings the compatibility for our reports using wkhtmltopdf 0.12.5. Up to now, the supported wkhtmltopdf version was 0.12.1. The goal of this revision is to add the compatibility to wkhtmltopdf 0.12.5, while keeping the same exact rendering than in 0.12.1. There is a behavior change with the `--dpi` parameter, which no longer has a "zoom" level effect as it did with 0.12.1. To deal with it, we pass the `--zoom` parameter when the detected version installed of wkhtmltopdf is after 0.12.2, with a ratio 96:dpi. 96 being the default dpi of wkhtmltopdf. This trick allows to render the reports with the exact same zoom level, whatever the dpi value configured in the reports paperformat. (at least with dpi values up to 149, after 150, included, the dpi parameter with wkhtmltopdf 0.12.1 as a weird behavior, it no longer zoom out) opw-1907346 closes odoo/odoo#28864 --- addons/report/models/report.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/addons/report/models/report.py b/addons/report/models/report.py index 771cd3ab366..0361775ca07 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -50,6 +50,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 @@ -67,6 +68,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.') @@ -524,14 +527,19 @@ class Report(models.Model): else: command_args.extend(['--margin-top', str(paperformat.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.dpi: if os.name == 'nt' and int(paperformat.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.dpi)]) + dpi = paperformat.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'])])