# -*- coding: utf-8 -*- ############################################################################# # # Cybrosys Technologies Pvt. Ltd. # # Copyright (C) 2023-TODAY Cybrosys Technologies() # Author: JANISH BABU (odoo@cybrosys.com) # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. # # 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. # # You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE # (LGPL v3) along with this program. # If not, see . # ############################################################################# from odoo import fields, models class SaleOrder(models.Model): """Inherits the model sale.order""" _inherit = 'sale.order' is_image_true = fields.Boolean(string="Is Show Image True", help="Show Image in Sale order Line", compute="_compute_is_image_true") def _compute_is_image_true(self): """Method _compute_is_image_true returns True if the Show Image option in the sale configuration is true""" for rec in self: rec.is_image_true = True if rec.env[ 'ir.config_parameter'].sudo().get_param( 'sale_product_image.is_show_product_image_in_sale_report') else False