ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Rebuild `tabDesktop Icon` table


#1

Greetings.

I’m testing changes in the icon configuration of a custom app (icon shown, background color, etc.); however, I can’t make the changes to be reflected in the Frappé Desk. What I’m doing is changing the my_app/my_module/config/desktop.py file and, afterwards, refreshing / reloading the Desk to see the new config without success.

I noted that the corresponding .pyc file (i.e. config/desktop.pyc) is not being rebuilt, so I’m suspecting that Frappé is not taking into account the changes to this code: even if I restart the server or execute bench clear-cache.

By looking at the database I found the tabDesktop Icon table which contains the site icons’ original configuration, and, apparently, those records are not being updated with module code changes. The only way I found to reload the new configuration was to uninstall / reinstall the app, something that seems a little excessive for what I’m trying to do.

So, my question is: there’s a way to rebuild the tabDesktop Icon table data to reflect any changes in visual configuration of the Desk’s icons?

Thanks in advance for any help with my problem.


EDIT - I just updated the table directly in bench mysql with something like

update `tabDesktop Icon` set color = "#B97A57" where name = "65098446f8";

and after a Desk / Reload I got the expected change!


#2

The standard icons are synced after every bench migrate

As you figured, you have to clear the cache after changing the values!


#3

Awesome! Thanks for your help!

bench migrate did the trick, and was the only thing I didn’t try! :sweat_smile:


#4

For others who face similar issues. Note that when you update the icon in DocType and it doesn’t reflect in desktop, it’s because one has to remove it so that the record gets deleted from tabDesktop Icon table and then re-add to the desktop. Alternative is to update the icon in tabDesktop Icon table from values in tabDocType table. Joining column is tabDesktop Icon.label = tabDocType.name