Browse Source

Mar 13 : [FIX] Bug Fixed 'backend_theme_infinito'

pull/249/head
AjmalCybro 2 years ago
parent
commit
e26ffd9feb
  1. 2
      backend_theme_infinito/__manifest__.py
  2. 11
      backend_theme_infinito/models/recent_apps.py
  3. 1
      backend_theme_infinito/static/src/js/navbar.js
  4. 3
      backend_theme_infinito/static/src/js/recentApps.js
  5. 6
      backend_theme_infinito/static/src/xml/sidebar.xml

2
backend_theme_infinito/__manifest__.py

@ -27,7 +27,7 @@
Main Highlight Of The Theme Is You Can Dynamically Change The Colors, Main Highlight Of The Theme Is You Can Dynamically Change The Colors,
Views, Buttons, Different Types Sidebar...Etc""", Views, Buttons, Different Types Sidebar...Etc""",
"category": "Themes/Backend", "category": "Themes/Backend",
"version": "16.0.1.0.0", "version": "16.0.1.0.1",
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',

11
backend_theme_infinito/models/recent_apps.py

@ -29,8 +29,19 @@ class RecentApps(models.Model):
name = fields.Char(compute='_compute_icon', store=True) name = fields.Char(compute='_compute_icon', store=True)
app_id = fields.Integer() app_id = fields.Integer()
icon = fields.Binary(compute='_compute_icon', store=True) icon = fields.Binary(compute='_compute_icon', store=True)
type = fields.Char(compute='_compute_type', store=True)
user_id = fields.Many2one('res.users') 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') @api.depends('app_id')
def _compute_icon(self): def _compute_icon(self):
menu_ui = self.env['ir.ui.menu'] menu_ui = self.env['ir.ui.menu']

1
backend_theme_infinito/static/src/js/navbar.js

@ -309,7 +309,6 @@ patch(ControlPanel.prototype, 'backend_theme_infinito/static/src/js/navbar.Contr
ev.target.classList.add("active"); ev.target.classList.add("active");
this.state.infinitoBookmarks.push(action_id) this.state.infinitoBookmarks.push(action_id)
this.state.infinitoMenuBookmarks.push(book); this.state.infinitoMenuBookmarks.push(book);
console.log(this.state)
} else { } else {
let index = this.state.infinitoBookmarks.indexOf(action_id); let index = this.state.infinitoBookmarks.indexOf(action_id);
this.state.infinitoBookmarks.splice(index, 1); this.state.infinitoBookmarks.splice(index, 1);

3
backend_theme_infinito/static/src/js/recentApps.js

@ -26,7 +26,8 @@ InfinitoRecentApps.template = xml`
<t t-foreach="recentApps" t-as="app" t-key="app"> <t t-foreach="recentApps" t-as="app" t-key="app">
<a class="icon" t-attf-href="#menu_id={{app.app_id}}"> <a class="icon" t-attf-href="#menu_id={{app.app_id}}">
<div class="img_wrapper"> <div class="img_wrapper">
<img class="sidebar_img" t-attf-src="data:image/svg+xml;base64,{{app.icon}}" width="40px" height="40px"/> <img t-if="app.type=='svg'" class="sidebar_img" t-attf-src="data:image/svg+xml;base64,{{app.icon}}" width="40px" height="40px"/>
<img t-if="app.type=='png'" class="sidebar_img" t-attf-src="data:image/png;base64,{{app.icon}}" width="40px" height="40px"/>
</div> </div>
<span class="zoomIn" t-esc="app.name"/> <span class="zoomIn" t-esc="app.name"/>
</a> </a>

6
backend_theme_infinito/static/src/xml/sidebar.xml

@ -84,7 +84,7 @@
<t t-if="sidebarIcon"> <t t-if="sidebarIcon">
<img t-att-title="app.name" <img t-att-title="app.name"
style="width: 30px;height:30px;" style="width: 30px;height:30px;"
t-attf-src="data:image/svg+xml;base64,{{app.webIconData}}"/> t-attf-src="data:image/png;base64,{{app.webIconData}}"/>
<span class="sidebar_app_name" style="margin-left: 10px;"> <span class="sidebar_app_name" style="margin-left: 10px;">
<t t-esc="app.name"/> <t t-esc="app.name"/>
@ -99,7 +99,7 @@
<t t-elif="sidebarIcon"> <t t-elif="sidebarIcon">
<img t-att-title="app.name" <img t-att-title="app.name"
style="width: 60px;height:60px;" style="width: 60px;height:60px;"
t-attf-src="data:image/svg+xml;base64,{{app.webIconData}}"/> t-attf-src="data:image/png;base64,{{app.webIconData}}"/>
</t> </t>
</a> </a>
</li> </li>
@ -162,7 +162,7 @@
<div class="img_wrapper"> <div class="img_wrapper">
<img t-att-title="app.name" <img t-att-title="app.name"
style="width: 70px !important;height: 70px !important;border-radius: 10px !important;margin: 5px 5px 5px -5px;" style="width: 70px !important;height: 70px !important;border-radius: 10px !important;margin: 5px 5px 5px -5px;"
t-attf-src="data:image/svg+xml;base64,{{app.webIconData}}"/> t-attf-src="data:image/png;base64,{{app.webIconData}}"/>
<!-- <img t-attf-src="data:image/png;base64,{{app.webIconData}}"/>--> <!-- <img t-attf-src="data:image/png;base64,{{app.webIconData}}"/>-->
</div> </div>
<!-- <b class="a_app_menu_title"><t t-esc="app.name"/></b>--> <!-- <b class="a_app_menu_title"><t t-esc="app.name"/></b>-->

Loading…
Cancel
Save