19 lines
		
	
	
		
			570 B
		
	
	
	
		
			Python
		
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			570 B
		
	
	
	
		
			Python
		
	
	
| # -*- coding: utf-8 -*-
 | |
| 
 | |
| from odoo import http
 | |
| from odoo.http import request
 | |
| 
 | |
| 
 | |
| class ImageHover(http.Controller):
 | |
| 
 | |
|     @http.route('/image/hover', type='json', auth='public', website=True)
 | |
|     def return_image_hover_effect(self, pid):
 | |
|         try:
 | |
|             product = request.env['product.template'].sudo().browse(int(pid))
 | |
|             if product and product.hover:
 | |
|                 return product.hover
 | |
|             hover = request.env['res.config.settings'].sudo().get_values()
 | |
|             return hover['hover']
 | |
|         except:
 | |
|             return 'use default effect'
 |