From 447d522ac063901a18ce22be564976a0a97b7268 Mon Sep 17 00:00:00 2001 From: "Solan Delvenne (sode)" Date: Tue, 20 Sep 2022 10:44:56 +0000 Subject: [PATCH] [IMP] snailmail: Modify the CSS to be compatible with all layouts and Pingen v2 Necessary improvement to the snailmail invoice layout for snailmail to work since Pingen has deprecated their v1 API with the plan to shut it down at the end of 2022 + their v2 API's validation is stricter. closes odoo/odoo#103806 X-original-commit: 69950a650115536f2d57b1f68b5adadd4c0453f3 Signed-off-by: Florian Daloze (fda) Signed-off-by: Solan Delvenne (sode) --- .../src/js/snailmail_external_layout.js | 4 +- .../scss/snailmail_external_layout_asset.scss | 83 ++++++++----------- 2 files changed, 37 insertions(+), 50 deletions(-) diff --git a/addons/snailmail/static/src/js/snailmail_external_layout.js b/addons/snailmail/static/src/js/snailmail_external_layout.js index f24009aa27f..d03ce05fa86 100644 --- a/addons/snailmail/static/src/js/snailmail_external_layout.js +++ b/addons/snailmail/static/src/js/snailmail_external_layout.js @@ -4,5 +4,5 @@ document.addEventListener('DOMContentLoaded', function (evt) { var style = window.getComputedStyle(recipientAddress, null); var height = parseFloat(style.getPropertyValue('height')); var fontSize = parseFloat(style.getPropertyValue('font-size')); - recipientAddress.style.fontSize = (85 / (height / fontSize)) + 'px'; -}); \ No newline at end of file + recipientAddress.style.fontSize = (130 / (height / fontSize)) + 'px'; +}); 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 612dc2c2943..5024f35261a 100644 --- a/addons/snailmail/static/src/scss/snailmail_external_layout_asset.scss +++ b/addons/snailmail/static/src/scss/snailmail_external_layout_asset.scss @@ -1,53 +1,40 @@ -/* Generic report layouts*/ -.header { - max-height: 40mm; - overflow: hidden; -} -.container { - margin-top: 5mm; -} -.o_standard_footer, .o_clean_footer, .o_boxed_footer, .o_background_footer { - max-height: 90px !important; - overflow: hidden; - width: 95%; - div > div:first-child { - padding-left: 10mm; - } -} -.o_background_footer { - padding-left: 8mm; -} -.article>.page { - > h1, > h2, > h3 { - width: 50%; - } -} -.pt-5 { - padding-top: 48px !important; -} -.article > .address.row > div[name="address"] { - height: 65mm; - background-color: #ffffff; - padding-top: 11mm; - padding-left: 5mm; - padding-bottom: 5mm; - left: -20px !important; - address { - height: 28mm; +/*Modifications for the Standard and Boxed document layouts */ +.article.o_report_layout_standard.o_company_1_layout, .article.o_report_layout_boxed.o_company_1_layout { + > .pt-5 { + > .address.row { + width: 100.5% !important; + height: 55mm; + margin-top: -13mm; + > div[name="address"] { + padding-top: 5mm; + } + } } } -/*l10n_de_din layout*/ -.din { - .invoice_address { - top: 27.7mm !important; - } - &.article { - .page { - top: 18.46mm !important; - } - } - &.o_background_footer { - top: -8mm !important; +/*Modifications for Bold and Striped document layouts*/ +.article.o_report_layout_bold.o_company_1_layout, .article.o_report_layout_striped.o_company_1_layout { + > .address.row { + width: 100.5% !important; + height: 60mm; + margin-top: -6mm; + > div[name="address"] { + padding-top: 13mm; + } + } +} + +div .address.row > div[name="address"] { + position: relative !important; + width: 103mm !important; + background-color: #ffffff; + > address { + width: 100% !important; + position: absolute !important; + bottom: 0 !important; + padding-left: 6mm; + padding-top: 3mm; + height: 33mm; + max-height: 33mm; } }