mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 11:32:06 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
from . import pos_config
|
||||
from . import res_config_settings
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# Copyright 2024 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class PosConfig(models.Model):
|
||||
_inherit = "pos.config"
|
||||
|
||||
logo = fields.Binary()
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright 2024 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
pos_config_logo = fields.Image(related="pos_config_id.logo", readonly=False)
|
||||
has_pos_config_logo = fields.Boolean(
|
||||
help="Use an alternative logo for this store",
|
||||
compute="_compute_has_pos_config_logo",
|
||||
inverse="_inverse_has_pos_config_logo",
|
||||
)
|
||||
|
||||
@api.depends("pos_config_id")
|
||||
def _compute_has_pos_config_logo(self):
|
||||
for config in self:
|
||||
config.has_pos_config_logo = bool(config.pos_config_logo)
|
||||
|
||||
def _inverse_has_pos_config_logo(self):
|
||||
for config in self:
|
||||
if not config.has_pos_config_logo:
|
||||
config.pos_config_logo = False
|
||||
Loading…
Add table
Add a link
Reference in a new issue