From f160f9b3fe5f5863ecbdc24c631af44c086b0cea Mon Sep 17 00:00:00 2001 From: Juliana Date: Mon, 26 Jul 2021 16:23:17 +0200 Subject: [PATCH] Change ticket receipt print web --- models/__init__.py | 3 +- models/pos_order.py | 44 +++++++++++++++++++++ static/src/css/style.css | 85 ++++++++++++++++++++++++++++++++++++++++ static/src/js/screens.js | 2 +- 4 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 models/pos_order.py diff --git a/models/__init__.py b/models/__init__.py index 3c65d6e..2361a0f 100755 --- a/models/__init__.py +++ b/models/__init__.py @@ -2,4 +2,5 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import pos_config -from . import report_ticketformat \ No newline at end of file +from . import report_ticketformat +from . import pos_order \ No newline at end of file diff --git a/models/pos_order.py b/models/pos_order.py new file mode 100644 index 0000000..0ed76e5 --- /dev/null +++ b/models/pos_order.py @@ -0,0 +1,44 @@ +# Copyright 2021 Le Filament () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models, api + + +class PosOrder(models.Model): + _inherit = 'pos.order' + + # ------------------------------------------------------ + # Fields declaration + # ------------------------------------------------------ + + # ------------------------------------------------------ + # SQL Constraints + # ------------------------------------------------------ + + # ------------------------------------------------------ + # Default methods + # ------------------------------------------------------ + + # ------------------------------------------------------ + # Computed fields / Search Fields + # ------------------------------------------------------ + + # ------------------------------------------------------ + # Onchange / Constraints + # ------------------------------------------------------ + + # ------------------------------------------------------ + # CRUD methods (ORM overrides) + # ------------------------------------------------------ + def test_paid(self): + for order in self: + if order.config_id.is_balance_free: + return True + return super(PosOrder, self).test_paid() + # ------------------------------------------------------ + # Actions + # ------------------------------------------------------ + + # ------------------------------------------------------ + # Business methods + # ------------------------------------------------------ diff --git a/static/src/css/style.css b/static/src/css/style.css index 77bb2e4..66f29a7 100644 --- a/static/src/css/style.css +++ b/static/src/css/style.css @@ -40,4 +40,89 @@ margin: 0 auto; border: 3px solid #000 !important; width: 60%; +} + +@media print { + * { + color: black !important; + } + body { + margin: 0; + color: white !important; + /* avoid black background if backgrounds are printed */ + background: initial; + } + .o_notification_manager, + .oe_leftbar, + .oe_loading, + .pos .pos-topheader, + .pos .pos-leftpane, + .pos .keyboard_frame, + .pos .scale-screen-custo, + .pos .pos-header-custo, + .pos .pos-topheader-title, + .pos .pos-confirm-screen .pos-topheader-bal, + .pos .pos-confirm-screen .pos-header-custo, + .pos .pos-confirm-screen .back-presentation, + .pos .pos-confirm-screen .product-name, + .pos .pos-confirm-screen .product-price, + .pos .pos-confirm-screen .centered-content .button { + display: none !important; + } + .pos, + .pos .pos-content, + .pos .rightpane, + .pos .screen, + .pos .window, + .pos .window .subwindow, + .pos .subwindow .subwindow-container{ + display: block; + position: static; + height: auto; + } + .pos{ + background: white !important; + } + .pos .rightpane { + left: 0px !important; + background-color: white; + } + .pos .pos-confirm-screen { + text-align: center; + } + .pos .pos-confirm-screen .centered-content{ + position: static; + border: none; + } + .pos .pos-receipt-container { + text-align: left; + } + .pos-actionbar { + display: none !important; + } + .debug-widget{ + display: none !important; + } + .pos *{ + text-shadow: none !important; + box-shadow: none !important; + background: transparent !important; + } + .pos .pos-sale-ticket{ + margin: 0; + margin-left: auto !important; + margin-right: auto !important; + border: none !important; + font-size: 13px !important; + width: 266px !important; + } + .o_debug_manager { + display: none !important; + } + .o_chat_window { + display: none !important; + } + .blockUI { + display: none !important; + } } \ No newline at end of file diff --git a/static/src/js/screens.js b/static/src/js/screens.js index 4ca6434..4ab51a0 100644 --- a/static/src/js/screens.js +++ b/static/src/js/screens.js @@ -39,7 +39,7 @@ odoo.define('vracoop_balance_ticketing.screens', function (require) { handle_auto_print: function() { if (this.should_auto_print()) { this.print(); - this.click_next(); +// this.click_next(); // } } else { this.lock_screen(false);