From dc4a9d3db79ea24fb0350fa547e3a5cb2159440e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Mon, 3 Dec 2018 13:16:52 +0000 Subject: [PATCH] [FIX] account,purchase,repair,sale,web: fix report layouts Following BS4 migration and adding sections and notes. ===== Document templates: - Remove margin from

in "informations" to allow them to be correctly centered vertically on their container. - Also add a mt- and mb- on their

to better handle them going to a new line when there are too many of them. - Add class for section and note to be able to customize them in layouts. - Add class for price_total to be able to customize it in layouts instead of relying on :last-child. - Add "page-break-inside: avoid;" on the "total" table to not split it between pages when it can be avoided. - Fix sale report template "Informations" to use col-auto just like invoice See 6b8d7bb6d68221f77dabb223de4160fdfb87a6f8 ===== Boxed layout: - fix section & note style - fix borders in general - fix the total table Background layout: - fix section style - fix the total table Clean layout: - fix page number vertical align task-1889346 closes odoo/odoo#27782 --- addons/account/views/report_invoice.xml | 42 ++++++------ .../report/purchase_order_templates.xml | 20 +++--- .../report/repair_templates_repair_order.xml | 36 +++++----- addons/sale/report/sale_report_templates.xml | 44 ++++++------ addons/sale/views/sale_portal_templates.xml | 2 +- .../static/src/scss/layout_background.scss | 54 +++++++++------ addons/web/static/src/scss/layout_boxed.scss | 67 ++++++++++++------- addons/web/static/src/scss/layout_clean.scss | 32 +++++---- addons/web/static/src/scss/report.scss | 15 +++++ 9 files changed, 184 insertions(+), 128 deletions(-) diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 3a653d3b78f..75140895390 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -19,36 +19,36 @@ -
-
+
+
Description: -

+

-
+
Invoice Date: -

+

-
+
Due Date: -

+

-
+
Source: -

+

-
+
Customer Code: -

+

-
+
Reference: -

+

- +
@@ -75,7 +75,7 @@ - + @@ -92,7 +92,7 @@ - @@ -130,17 +130,17 @@
+
- + - + - @@ -151,13 +151,13 @@ - - +
Subtotal
+ +
Total diff --git a/addons/purchase/report/purchase_order_templates.xml b/addons/purchase/report/purchase_order_templates.xml index a475acce4ca..4418b15b0a6 100644 --- a/addons/purchase/report/purchase_order_templates.xml +++ b/addons/purchase/report/purchase_order_templates.xml @@ -26,22 +26,22 @@

Purchase Order Confirmation #

Cancelled Purchase Order #

-
-
+
+
Our Order Reference: -

+

-
+
Your Order Reference: -

+

-
+
Order Date: -

+

- +
@@ -78,7 +78,7 @@
Description
-
+
@@ -95,7 +95,7 @@ t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> - +
Total -
-
+
+
Product to Repair: -

+

-
+
Lot/Serial Number:
-
+
Warranty: -

+

-
+
Printing Date: -

+

- +
@@ -68,7 +68,7 @@ - + - - + - @@ -118,11 +118,11 @@
Description
Parts
Parts

(Add)

@@ -85,14 +85,14 @@
+
Operations
Operations
@@ -108,7 +108,7 @@ +
-
+
- + - - + - diff --git a/addons/sale/report/sale_report_templates.xml b/addons/sale/report/sale_report_templates.xml index ea923c1fd80..8e678b1fcd6 100644 --- a/addons/sale/report/sale_report_templates.xml +++ b/addons/sale/report/sale_report_templates.xml @@ -37,37 +37,37 @@ -
-
+
+
Your Reference: -

+

-
+
Date Ordered: -

+

-
+
Quotation Date: -

+

-
+
Salesperson: -

+

-
+
Payment Terms: -

+

-
+
Expiration Date: -

+

-
Total Without Taxes
Taxes +
Total +
+
@@ -94,7 +94,7 @@ - + - @@ -145,23 +145,23 @@
@@ -110,7 +110,7 @@ +
-
+
- + - + - @@ -170,14 +170,14 @@ - - + +
Subtotal
 on  + +
Total diff --git a/addons/sale/views/sale_portal_templates.xml b/addons/sale/views/sale_portal_templates.xml index 9a428d7ab19..38f14849235 100644 --- a/addons/sale/views/sale_portal_templates.xml +++ b/addons/sale/views/sale_portal_templates.xml @@ -449,7 +449,7 @@ -
diff --git a/addons/web/static/src/scss/layout_background.scss b/addons/web/static/src/scss/layout_background.scss index ff2d0cef3b0..9c47ac72a27 100644 --- a/addons/web/static/src/scss/layout_background.scss +++ b/addons/web/static/src/scss/layout_background.scss @@ -34,34 +34,48 @@ background-position: bottom center; background-repeat: no-repeat; min-height: 620px; + + .table { + border-top: 1px solid gray('300'); + } + + .table td, .table th { + border-top: none; + } thead tr th, h2 { color: $o-brand-odoo; } tbody { color: gray('700'); - tr:nth-child(odd) { - background-color: rgba(220, 205, 216, 0.2); - } - tr td { - border-top: none; + tr { + &:nth-child(odd) { + background-color: rgba(220, 205, 216, 0.2); + } + &.o_line_section { + color: $o-brand-odoo; + background-color: rgba(73, 80, 87, 0.2) !important; + } } } /*Total table*/ - .row > .col-4 > table { - tr:nth-child(odd) { - background-color: transparent !important; - } - tr:first-child td { - /*we could get rid of this rule if .border-black td would be terminated in report.scss*/ - border-top: none !important; - } - tr:last-child td { - color: $o-brand-odoo; - } - } - #total { - table tr:last-child td { - border-bottom: 1px solid black; + /* row div rule compat 12.0 */ + .row > div > table, + div#total table { + tr { + &:nth-child(odd) { + background-color: transparent !important; + } + /* first-child & last-child rule compat 12.0 */ + &:first-child, + &:last-child, + &.o_subtotal, + &.o_total { + border-top: none !important; + td { + color: $o-brand-odoo; + border-top: 1px solid gray('400') !important; + } + } } } } diff --git a/addons/web/static/src/scss/layout_boxed.scss b/addons/web/static/src/scss/layout_boxed.scss index b0b2fb1f743..bf19b6fb7ae 100644 --- a/addons/web/static/src/scss/layout_boxed.scss +++ b/addons/web/static/src/scss/layout_boxed.scss @@ -23,52 +23,73 @@ } } .o_report_layout_boxed { - // This is not a general rule since the id is not used in all the reports, - // we should make a general structure for report body to use it everywhere - #informations { - border: 1px solid gray('700'); - padding-top: 10px; - margin: 0; - } > h2 { text-transform: uppercase; } table { border: 1px solid gray('700'); thead { + border-bottom: 2px solid gray('700'); tr th { - border-bottom: 3px solid gray('700') !important; text-transform: uppercase; + border: 1px solid gray('700'); } } tbody { color: gray('700'); tr { td { + // remove border-top from standard layout border-top: none; border-right: 1px solid gray('700'); } - td:last-child { + &.o_line_section td, + &.o_line_note td, + &.is-subtotal td { + border-top: 1px solid gray('700'); + border-bottom: 1px solid gray('700'); + } + &.o_line_section td { + background-color: gray('700'); + color: #fff; + } + &.is-subtotal, + td.o_price_total { background-color: gray('200'); } } } } + /* compat 12.0 */ + .page > table:not(.o_main_table) tr td:last-child { + background-color: gray('200'); + } + /* compat 12.0 */ + .row:not(#total) > div > table tr:not(:first-child):not(:last-child) td:last-child { + background-color: gray('200'); + } /*Total table*/ - .row > .col-4 > table { - td { - border-right: none; - } - tr:last-child td, tr:first-child td { - /*we could get rid of this rule if .border-black td would be terminated in report.scss*/ - border-top: none !important; - } - tr:first-child td { - background-color: transparent; - } - tr:last-child td { - background-color: gray('700'); - color: #fff; + /* row div rule compat 12.0 */ + .row > div > table, + div#total table { + tr { + &:first-child, + &.o_subtotal { + border-bottom: 1px solid gray('700'); + + td:first-child { + border-right: none; + } + } + &:last-child td, + &.o_total td { + background-color: gray('700'); + color: #fff; + + &:first-child { + border-right: none; + } + } } } } diff --git a/addons/web/static/src/scss/layout_clean.scss b/addons/web/static/src/scss/layout_clean.scss index 06b2e808dd4..910abc763a4 100644 --- a/addons/web/static/src/scss/layout_clean.scss +++ b/addons/web/static/src/scss/layout_clean.scss @@ -18,12 +18,10 @@ font-weight: bolder; } .pagenumber { - width: 35px; - height: 35px; border: 3px solid $o-brand-odoo; background-color: $o-brand-primary; color: white; - padding-top: 6px; + padding: 4px 8px; text-align: center; } } @@ -36,6 +34,10 @@ color: $o-brand-odoo; } table { + &.o_main_table { + margin-bottom: 0; + } + thead { color: $o-brand-odoo; tr th { @@ -66,18 +68,22 @@ } } /*Total table*/ - .row > .col-4 { - width: 43%; - position: relative; - top: -20px; - > table { - tr:last-child td { - border-top: 1px solid gray('200') !important; - } - tr:first-child td { - /*we could get rid of this rule if .border-black td would be terminated in report.scss*/ + /* compat 12.0 */ + .row:not(#total) > div:has(table) { + top: -16px; + } + /* row col rule compat 12.0 */ + .row > div > table, + div#total table { + tr { + &:first-child td, + &.o_subtotal { border-top: none !important; } + &:last-child td, + &.o_total { + border-top: 1px solid gray('200') !important; + } } } } diff --git a/addons/web/static/src/scss/report.scss b/addons/web/static/src/scss/report.scss index 37a7630225b..e901b5b9364 100644 --- a/addons/web/static/src/scss/report.scss +++ b/addons/web/static/src/scss/report.scss @@ -44,3 +44,18 @@ body { .o_underline { text-decoration: underline; } + +/*Total table*/ +div#total { + page-break-inside: avoid; + table { + tr { + &.o_subtotal, + &.o_total { + td { + border-top: 1px solid black !important; + } + } + } + } +}