From a2ddef022f730ad1bfda4b8819510e74fe1dd3bc Mon Sep 17 00:00:00 2001 From: Romain Estievenart Date: Wed, 14 Apr 2021 09:46:21 +0000 Subject: [PATCH] [IMP] pos_*: Ticket/Order kanban screens on mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using a list view isn't the best way to display data on small screen. We had to change this behavior to display a kanban view of orders. We also merge design of "Ticket" screen and "Order Management" screen. Task ID: 2453679 X-original-commit: d0e53721a97c14419a2f81ef8aa8be317cc5644a Part-of: odoo/odoo#79448 Co-authored-by: Adrien Dieudonné --- addons/point_of_sale/static/src/css/pos.css | 145 +++++------------- .../xml/Screens/TicketScreen/TicketScreen.xml | 57 ++++--- .../static/src/xml/Screens/TicketScreen.xml | 10 +- addons/pos_sale/static/src/css/pos_sale.css | 10 -- .../SaleOrderManagementScreen.js | 2 +- .../OrderManagementScreen/SaleOrderList.xml | 14 +- .../SaleOrderManagementControlPanel.xml | 2 +- .../OrderManagementScreen/SaleOrderRow.xml | 30 +++- 8 files changed, 113 insertions(+), 157 deletions(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index a91fcba2666..facca7d38c6 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -484,13 +484,6 @@ td { -webkit-flex: 1; flex: 1; } -.pos .orders { - display: -webkit-flex; - display: flex; - vertical-align: top; - margin-left: 0px; - overflow: hidden; -} /* c) The session buttons */ @@ -1259,7 +1252,6 @@ td { .pos .screen { position:absolute; - text-align: center; top:0px; bottom:0px; width:100%; @@ -2880,59 +2872,6 @@ td { /* Order Management */ -.order-row { - display: flex; - flex-direction: row; - justify-content: space-evenly; - background-color: rgb(230,230,230); -} - -.order-list .order-row:hover { - color: white; - background-color: rgb(110,200,155); - font-weight: bold; -} - -.order-row.highlight { - color: white; - background-color: rgb(110,200,155); - font-weight: bold; -} - -.order-row.lighter { - background-color: #f5f5f5; - cursor: pointer; -} - -.order-row .header { - font-size: medium; - font-weight: bolder; - flex-grow: 1; - flex-basis: 0; - text-align: left; - padding: 10px 10px; - background-color: #cecece; - border-bottom: solid 1px; - border-top: solid 1px -} - -.order-row .header.total { - text-align: right; -} - -.order-row .item { - font-size: medium; - flex-grow: 1; - flex-basis: 0; - text-align: left; - padding: 10px 10px; - border-bottom: solid rgb(150,150,150) 1px; -} - -.order-row .item.total { - text-align: right; -} - .item .page-controls { display: flex; flex-direction: row; @@ -3101,53 +3040,71 @@ td { /* TICKET SCREEN */ -.ticket-screen .orders { - display: flex; - flex-flow: column nowrap; - overflow: hidden; - overflow-y: hidden; +.pos .orders { overflow-y: auto; font-size: medium; } -.ticket-screen .orders .header-row{ +.pos .orders .header-row{ display: flex; - flex-flow: row nowrap; - flex: 1; - justify-content: space-evenly; background: #868686; color: white; } -.ticket-screen .orders .order-row { - display: flex; - flex-flow: row nowrap; - flex: 1; - justify-content: space-evenly; +@media screen and (min-width: 768px) { + .pos .orders .order-row { + display: flex; + cursor: pointer; + } + + .pos .orders .order-row:nth-child(odd) { + background: #DDD; + } + + .pos .orders .order-row:nth-child(even) { + background: white; + } +} +@media screen and (max-width: 768px) { + .pos .orders .order-row { + margin: 5px; + border: 1px solid #C9CCD2; /* $border-color */ + background: white; /* $o-view-background-color */ + } } -.ticket-screen .orders .order-row.highlight { +.pos .orders .order-row:hover, .pos .orders .order-row.highlight { color: white; background-color: rgb(110,200,155); } -.ticket-screen .orders .col { +.pos .orders .col { display: flex; + justify-content: space-between; flex: 1; padding: 10px; - text-align: start; } -.ticket-screen .orders .col.start { - justify-content: flex-start; +@media screen and (min-width: 768px) { + .pos .orders .col.end { + justify-content: flex-end; + } } -.ticket-screen .orders .col.center { - justify-content: center; -} +@media screen and (max-width: 768px) { + .pos .orders .order-row > .col > div:first-child { + font-weight: bold; + } -.ticket-screen .orders .col.end { - justify-content: flex-end; + .ticket-screen .order-row .delete-button { + margin-top: 5px; + justify-content: center; + background: #d23f3a /* o-text-color('danger') */ ; + color: white; + } + .ticket-screen .order-row .delete-button .fa-trash { + margin-right: 5px; + } } .ticket-screen .orders .col.very-narrow { @@ -3162,19 +3119,6 @@ td { flex: 1.5; } -.ticket-screen .order-row:nth-child(odd) { - background: #DDD; -} - -.ticket-screen .order-row:nth-child(even) { - background: white; -} - -.ticket-screen .order-row:hover { - background: rgb(110,200,155); - color: white; -} - .ticket-screen .empty-order-list { text-align: center; margin: 48px; @@ -3189,16 +3133,11 @@ td { font-size: 64px; } -.ticket-screen .pointer { - cursor: pointer; -} - .ticket-screen .controls { display: flex; justify-content: space-between; align-items: center; margin: 0px 10px; - border-bottom: dashed 1px rgb(215,215,215); flex: 0 0 80px; } diff --git a/addons/point_of_sale/static/src/xml/Screens/TicketScreen/TicketScreen.xml b/addons/point_of_sale/static/src/xml/Screens/TicketScreen/TicketScreen.xml index 861c39dc4ef..39eecce4d6f 100644 --- a/addons/point_of_sale/static/src/xml/Screens/TicketScreen/TicketScreen.xml +++ b/addons/point_of_sale/static/src/xml/Screens/TicketScreen/TicketScreen.xml @@ -54,43 +54,50 @@
-
-
Date
-
Receipt Number
-
Customer
-
Cardholder Name
-
Employee
+
+
Date
+
Receipt Number
+
Customer
+
Cardholder Name
+
Employee
Total
-
Status
-
+
Status
+
-
-
- +
+
+
Date
+
-
- +
+
Receipt Number
+
-
- +
+
Customer
+
-
- +
+
Cardholder Name
+
-
- +
+
Employee
+
- +
Total
+
-
- +
+
Status
+
-
- +
+