mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-23 18:42:02 +02:00
Initial commit: Pos packages
This commit is contained in:
commit
95dfb9edb0
1301 changed files with 264148 additions and 0 deletions
6
odoo-bringout-oca-ocb-pos_six/pos_six/models/__init__.py
Normal file
6
odoo-bringout-oca-ocb-pos_six/pos_six/models/__init__.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# coding: utf-8
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import pos_config
|
||||
from . import pos_payment_method
|
||||
from . import pos_session
|
||||
14
odoo-bringout-oca-ocb-pos_six/pos_six/models/pos_config.py
Normal file
14
odoo-bringout-oca-ocb-pos_six/pos_six/models/pos_config.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# 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):
|
||||
enforce_https = self.env['ir.config_parameter'].sudo().get_param('point_of_sale.enforce_https')
|
||||
if not enforce_https and self.payment_method_ids.filtered(lambda pm: pm.use_payment_terminal == 'six'):
|
||||
return True
|
||||
return super(PosConfig, self)._force_http()
|
||||
|
|
@ -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')
|
||||
13
odoo-bringout-oca-ocb-pos_six/pos_six/models/pos_session.py
Normal file
13
odoo-bringout-oca-ocb-pos_six/pos_six/models/pos_session.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class PosSession(models.Model):
|
||||
_inherit = 'pos.session'
|
||||
|
||||
def _loader_params_pos_payment_method(self):
|
||||
result = super()._loader_params_pos_payment_method()
|
||||
result['search_params']['fields'].append('six_terminal_ip')
|
||||
return result
|
||||
Loading…
Add table
Add a link
Reference in a new issue