pos_cashdro_allow_manual: move config from paymet.method to res.config

This commit is contained in:
Luis 2026-04-28 10:47:43 +02:00
parent d994ab600e
commit 86101218e9
8 changed files with 48 additions and 38 deletions

View file

@ -1,4 +1,4 @@
# Copyright 2026 Criptomart
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import pos_payment_method
from . import pos_session
from . import pos_config
from . import res_config_settings

View file

@ -3,11 +3,11 @@
from odoo import fields, models
class PosPaymentMethod(models.Model):
_inherit = "pos.payment.method"
class PosConfig(models.Model):
_inherit = "pos.config"
cashdro_allow_manual_amount = fields.Boolean(
string="Permitir importe manual",
string="Permitir importe manual CashDro",
help=(
"Cuando está activado, aparece un botón 'Manual' en la pantalla de "
"pago del TPV que permite confirmar el importe de la línea sin pasar "

View file

@ -1,12 +0,0 @@
# Copyright 2026 Criptomart
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
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("cashdro_allow_manual_amount")
return result

View file

@ -0,0 +1,12 @@
# Copyright 2026 Criptomart
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
pos_cashdro_allow_manual_amount = fields.Boolean(
related="pos_config_id.cashdro_allow_manual_amount",
readonly=False,
)