Añade la funcionalidad de pos_empty_default_image pra poder mostraar el formato en productos sin imagen
This commit is contained in:
parent
f1c8cf8414
commit
913de79db8
14 changed files with 284 additions and 41 deletions
|
@ -1,2 +1,5 @@
|
|||
from . import res_product
|
||||
from . import pos_config
|
||||
from . import product_template
|
||||
from . import product_product
|
||||
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import res_product
|
||||
|
16
product_library/models/pos_config.py
Normal file
16
product_library/models/pos_config.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Copyright (C) 2020 - Today:
|
||||
# GRAP (http://www.grap.coop)
|
||||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class PosConfig(models.Model):
|
||||
_inherit = 'pos.config'
|
||||
|
||||
iface_fixed_font_size = fields.Integer(
|
||||
string="Fixed Font Size",
|
||||
help="Font size of the product name, when it has no image."
|
||||
" Set '0' will set adaptative font-size, depending on the"
|
||||
" length of the name.")
|
20
product_library/models/product_product.py
Normal file
20
product_library/models/product_product.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Copyright (C) 2017 - Today:
|
||||
# GRAP (http://www.grap.coop)
|
||||
# Akretion (http://www.akretion.com)
|
||||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class ProductProduct(models.Model):
|
||||
_inherit = 'product.product'
|
||||
|
||||
@api.multi
|
||||
@api.depends('image')
|
||||
def _compute_has_image(self):
|
||||
for product in self:
|
||||
product.has_image = product.image
|
||||
|
||||
has_image = fields.Boolean(
|
||||
compute='_compute_has_image', string='Has Image', store=True)
|
Loading…
Add table
Add a link
Reference in a new issue