From e9ed03ae572e17ae4d3fa428e14a40922aa625bc Mon Sep 17 00:00:00 2001 From: bpa Date: Wed, 26 Oct 2016 17:50:34 +0530 Subject: [PATCH] [IMP] pos_reprint: Improve point of sale configuration form for receipt repriting fields - Bring receipt reprinting configuration fields together - Highlight the reprint button, improve in configuration when reprint option is checked then receipt printer option should be checked - Reorganise the receipt printing options, remove Reprint Receipt button highlighting - Moved print receipt option of the hardware section - If enabled Reprint Receipt then Receipt Printer enable automatically --- addons/point_of_sale/views/pos_config_view.xml | 18 +++++++++++------- addons/pos_reprint/models/pos_config.py | 13 +++++++++++-- addons/pos_reprint/views/pos_config_views.xml | 4 ++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/addons/point_of_sale/views/pos_config_view.xml b/addons/point_of_sale/views/pos_config_view.xml index f94f7905cca..004978817f3 100644 --- a/addons/point_of_sale/views/pos_config_view.xml +++ b/addons/point_of_sale/views/pos_config_view.xml @@ -42,17 +42,25 @@ - - - + + + + + + + + + + + @@ -64,10 +72,6 @@ - - - - diff --git a/addons/pos_reprint/models/pos_config.py b/addons/pos_reprint/models/pos_config.py index f945edc1f07..a72b4df206b 100644 --- a/addons/pos_reprint/models/pos_config.py +++ b/addons/pos_reprint/models/pos_config.py @@ -1,11 +1,20 @@ # -*- 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' iface_reprint = fields.Boolean( string='Receipt Reprinting', help="This allows you to reprint a previously printed receipt.") + + @api.onchange('iface_reprint') + def _onchange_iface_print(self): + if self.iface_reprint: + self.iface_print_via_proxy = self.iface_reprint + + @api.onchange('iface_print_via_proxy') + def _onchange_iface_print_via_proxy(self): + super(PosConfig, self)._onchange_iface_print_via_proxy() + self.iface_reprint = self.iface_print_via_proxy if self.iface_reprint else None diff --git a/addons/pos_reprint/views/pos_config_views.xml b/addons/pos_reprint/views/pos_config_views.xml index 087dbdd2ebe..65c61ec3d53 100644 --- a/addons/pos_reprint/views/pos_config_views.xml +++ b/addons/pos_reprint/views/pos_config_views.xml @@ -5,8 +5,8 @@ pos.config - - + +