From b102b3ee83cccd37d7df54e0d4083a6f6b3790f4 Mon Sep 17 00:00:00 2001 From: "Laurent Desausoi (lade)" Date: Tue, 10 May 2022 14:51:40 +0000 Subject: [PATCH] [FIX] snailmail: fix the font-size of the address in the report When generating the PDF for the SnailMail report, a script is executed to adapt the size of the address to match Pingen requirements (as per [1]). Step to reproduce the issue: 1) Have a contact created that has VAT configure 2) Create an invoice and 'Send and Print' 3) Select the POST button to send via POST 4) In dev mode, go to Techincal > Snailmail Letters 5) Download the PDF of the newly created invoice You should see that the font becomes extremely tiny. Solution: There are different elements that needs to be corrected to solve the issue. 1) The CSS used to specify the `height` requirement of the address was not properly loaded (the path was incorrect) 2) The JS selector used into the resize script is incorrect 3) The CSS selector into the CSS file was invalid All these issues are due to incomplete migrations. [1]: https://github.com/odoo/odoo/commit/c50f5da4160c63dcc79900dc882cd36c9ad96b2e opw-2819823 closes odoo/odoo#96055 X-original-commit: 7bbdbdcde2315155d17fb30d5496c3daf9a5c4cf Signed-off-by: Florian Daloze (fda) Signed-off-by: Desausoi Laurent (lade) --- addons/snailmail/static/src/js/snailmail_external_layout.js | 2 +- .../static/src/scss/snailmail_external_layout_asset.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/snailmail/static/src/js/snailmail_external_layout.js b/addons/snailmail/static/src/js/snailmail_external_layout.js index 9e0acac096a..f24009aa27f 100644 --- a/addons/snailmail/static/src/js/snailmail_external_layout.js +++ b/addons/snailmail/static/src/js/snailmail_external_layout.js @@ -1,6 +1,6 @@ // Change address font-size if needed document.addEventListener('DOMContentLoaded', function (evt) { - var recipientAddress = document.querySelector(".address.row > div[name='address'] > div") + var recipientAddress = document.querySelector(".address.row > div[name='address'] > address"); var style = window.getComputedStyle(recipientAddress, null); var height = parseFloat(style.getPropertyValue('height')); var fontSize = parseFloat(style.getPropertyValue('font-size')); diff --git a/addons/snailmail/static/src/scss/snailmail_external_layout_asset.scss b/addons/snailmail/static/src/scss/snailmail_external_layout_asset.scss index a5c259fa711..612dc2c2943 100644 --- a/addons/snailmail/static/src/scss/snailmail_external_layout_asset.scss +++ b/addons/snailmail/static/src/scss/snailmail_external_layout_asset.scss @@ -25,7 +25,7 @@ .pt-5 { padding-top: 48px !important; } -.article > div > .address.row > div[name="address"] { +.article > .address.row > div[name="address"] { height: 65mm; background-color: #ffffff; padding-top: 11mm;