summaryrefslogtreecommitdiff
path: root/addons/pos_epson_printer/models
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-10-29 10:15:19 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-10-30 17:06:20 +0000
commit0a23a2bb65f6e59e4db545e6736c754c55463b15 (patch)
tree8e1e92e2bfa59a874819d8817795596188885c49 /addons/pos_epson_printer/models
parentcea51cfc4b00eff472bf0ba3d61704fb8537e9c6 (diff)
[FIX] pos_epson_printer: disable cashdrawer when parent option is unchecked
Open POS Config Enable the option 'Connect Devices' In 'Epson Receipt Printer IP Address' write anything then focus out Enable the 'Cashdrawer' Option Empty 'Epson Receipt Printer IP Address' Disable'Connect Devices' Save Blanking 'Epson Receipt Printer IP Address' leaving 'Cashdrawer' on will lead to crash during the payment session if the user click on 'Open Cashbox' when using cash as a payment method. 'Cashdrawer' should be disabled automatically when needed. opw-2367498 closes odoo/odoo#61083 X-original-commit: 6491f9b20570c374e464194cbce698b00c173847 Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/pos_epson_printer/models')
-rw-r--r--addons/pos_epson_printer/models/pos_config.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/pos_epson_printer/models/pos_config.py b/addons/pos_epson_printer/models/pos_config.py
index 885d9e4d70f..8fe6df3ad0b 100644
--- a/addons/pos_epson_printer/models/pos_config.py
+++ b/addons/pos_epson_printer/models/pos_config.py
@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import fields, models
+from odoo import api, fields, models
class PosConfig(models.Model):
_inherit = 'pos.config'
epson_printer_ip = fields.Char(string='Epson Printer IP', help="Local IP address of an Epson receipt printer.")
+
+ @api.onchange('epson_printer_ip')
+ def _onchange_epson_printer_ip(self):
+ if self.epson_printer_ip in (False, ''):
+ self.iface_cashdrawer = False