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