You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							51 lines
						
					
					
						
							1.9 KiB
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							51 lines
						
					
					
						
							1.9 KiB
						
					
					
				| # -*- coding: utf-8 -*- | |
| ############################################################################# | |
| # | |
| #    Cybrosys Technologies Pvt. Ltd. | |
| # | |
| #    Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | |
| #    Author: Cybrosys Techno Solutions(<https://www.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 <http://www.gnu.org/licenses/>. | |
| # | |
| ############################################################################# | |
| from odoo import fields, models, api | |
| 
 | |
| 
 | |
| class RecentApps(models.Model): | |
|     _name = 'recent.apps' | |
|     _description = 'Recent Apps' | |
| 
 | |
|     name = fields.Char(compute='_compute_icon', store=True) | |
|     app_id = fields.Integer() | |
|     icon = fields.Binary(compute='_compute_icon', store=True) | |
|     type = fields.Char(compute='_compute_type', store=True) | |
|     user_id = fields.Many2one('res.users') | |
| 
 | |
|     @api.depends('app_id') | |
|     def _compute_type(self): | |
|         menu_ui = self.env['ir.ui.menu'] | |
|         for rec in self: | |
|             app = menu_ui.browse(rec.app_id) | |
|             la = str(app.web_icon) | |
|             spl_word = '.' | |
|             res = la.split(spl_word, 1) | |
|             splitString = res[1] | |
|             rec.type = splitString | |
|     @api.depends('app_id') | |
|     def _compute_icon(self): | |
|         menu_ui = self.env['ir.ui.menu'] | |
|         for rec in self: | |
|             app = menu_ui.browse(rec.app_id) | |
|             rec.icon = app._compute_web_icon_data(app.web_icon) | |
|             rec.name = app.name
 | |
| 
 |