pos_cashdro_allow_manual: move config from paymet.method to res.config
This commit is contained in:
parent
d994ab600e
commit
86101218e9
8 changed files with 48 additions and 38 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 "
|
||||
|
|
@ -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
|
||||
12
pos_cashdro_allow_manual/models/res_config_settings.py
Normal file
12
pos_cashdro_allow_manual/models/res_config_settings.py
Normal 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,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue