From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/pos_six/models/__init__.py | 5 +++++ addons/pos_six/models/pos_config.py | 13 +++++++++++++ addons/pos_six/models/pos_payment_method.py | 13 +++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 addons/pos_six/models/__init__.py create mode 100644 addons/pos_six/models/pos_config.py create mode 100644 addons/pos_six/models/pos_payment_method.py (limited to 'addons/pos_six/models') diff --git a/addons/pos_six/models/__init__.py b/addons/pos_six/models/__init__.py new file mode 100644 index 00000000..77e4db1f --- /dev/null +++ b/addons/pos_six/models/__init__.py @@ -0,0 +1,5 @@ +# coding: utf-8 +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import pos_config +from . import pos_payment_method diff --git a/addons/pos_six/models/pos_config.py b/addons/pos_six/models/pos_config.py new file mode 100644 index 00000000..6d986b2d --- /dev/null +++ b/addons/pos_six/models/pos_config.py @@ -0,0 +1,13 @@ +# coding: utf-8 +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + def _force_http(self): + if self.payment_method_ids.filtered(lambda pm: pm.use_payment_terminal == 'six'): + return True + return super(PosConfig, self)._force_http() diff --git a/addons/pos_six/models/pos_payment_method.py b/addons/pos_six/models/pos_payment_method.py new file mode 100644 index 00000000..71a165c6 --- /dev/null +++ b/addons/pos_six/models/pos_payment_method.py @@ -0,0 +1,13 @@ +# coding: utf-8 +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models + + +class PosPaymentMethod(models.Model): + _inherit = 'pos.payment.method' + + def _get_payment_terminal_selection(self): + return super(PosPaymentMethod, self)._get_payment_terminal_selection() + [('six', 'SIX')] + + six_terminal_ip = fields.Char('Six Terminal IP') -- cgit v1.2.3