Browse Source

Change ticket receipt print web

12.0
Juliana 3 years ago
parent
commit
f160f9b3fe
  1. 3
      models/__init__.py
  2. 44
      models/pos_order.py
  3. 85
      static/src/css/style.css
  4. 2
      static/src/js/screens.js

3
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
from . import report_ticketformat
from . import pos_order

44
models/pos_order.py

@ -0,0 +1,44 @@
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# 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
# ------------------------------------------------------

85
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;
}
}

2
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);

Loading…
Cancel
Save