añadido addon desde la tienda de apps de Odoo. Imal-Tech

This commit is contained in:
snt 2024-09-08 16:01:48 +02:00
parent 40d7d88038
commit f0e0ce3d07
26 changed files with 631 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api, tools
class ProductTemplate(models.Model):
""" Inherit Product Template Settings to add default image product from setting """
_inherit = "product.template"
@api.model_create_multi
def create(self, vals_list):
for val_list in vals_list:
if not val_list['image_1920']:
product_default_image = self.env['ir.config_parameter'].sudo().get_param(
'res.config.settings.product_default_image')
if product_default_image:
val_list['image_1920'] = product_default_image
return super(ProductTemplate, self).create(vals_list)