Initial commit: Pos packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 95dfb9edb0
1301 changed files with 264148 additions and 0 deletions

View file

@ -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 res_config_settings

View file

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import 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.")

View file

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
pos_epson_printer_ip = fields.Char(compute='_compute_pos_epson_printer_ip', store=True, readonly=False)
@api.depends('pos_epson_printer_ip', 'pos_other_devices')
def _compute_pos_iface_cashdrawer(self):
"""We are just adding depends on this compute."""
super()._compute_pos_iface_cashdrawer()
def _is_cashdrawer_displayed(self, res_config):
return super()._is_cashdrawer_displayed(res_config) or (res_config.pos_other_devices and bool(res_config.pos_epson_printer_ip))
@api.depends('pos_other_devices', 'pos_config_id')
def _compute_pos_epson_printer_ip(self):
for res_config in self:
if not res_config.pos_other_devices:
res_config.pos_epson_printer_ip = ''
else:
res_config.pos_epson_printer_ip = res_config.pos_config_id.epson_printer_ip