[FIX] point_of_sale: enable automatic web printing without printer

Prior to this commit, automatic printing was only functional when
a printer was configured with the Point of Sale. It did not support web
printing. This commit rectifies this issue, allowing automatic printing
to work seamlessly with or without a physical printer setup, supporting
web printing.

opw-3706400

closes odoo/odoo#154066

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
Pedram (pebr)
2024-02-15 18:21:29 +00:00
parent 054d05067b
commit ed9f5debbe
2 changed files with 15 additions and 14 deletions
@@ -355,11 +355,15 @@ export class PaymentScreen extends Component {
? this.currentOrder.finalized
: true;
if (this.hardwareProxy.printer && invoiced_finalized) {
const printResult = await this.printer.print(OrderReceipt, {
data: this.pos.get_order().export_for_printing(),
formatCurrency: this.env.utils.formatCurrency,
});
if (invoiced_finalized) {
const printResult = await this.printer.print(
OrderReceipt,
{
data: this.pos.get_order().export_for_printing(),
formatCurrency: this.env.utils.formatCurrency,
},
{ webPrintFallback: true }
);
if (printResult && this.pos.config.iface_print_skip_screen) {
this.pos.removeOrder(this.currentOrder);
@@ -20,17 +20,12 @@
.pos, .pos * {
position: static !important;
}
.pos .receipt-screen .pos-receipt-container {
position: absolute !important;
top: 0;
left: 0;
}
.pos .receipt-screen .pos-receipt-container, .pos .receipt-screen .pos-receipt-container *, .render-container * {
.render-container .pos-receipt * {
visibility: visible;
background: white !important;
color: black !important;
}
.pos .pos-receipt {
.render-container .pos-receipt {
margin: 0 !important;
margin-left: auto !important;
margin-right: auto !important;
@@ -43,7 +38,9 @@
top: 10px;
left: 10px;
}
.o-main-components-container {
display: none;
.o-main-components-container {
position: absolute !important;
top: 0;
left: 0;
}
}