Applicable to Odoo XML and JS files. See LICENSE file on for full copyright and licensing details.
The script was applied to the entire odoo codebase and was able to automatically convert most icons in a few seconds.
There are a few patterns the script doesn't detect or migrates wrong. They require your attention.
- javascript tests
click('.i.fa.fa-star-o')
- code-controlled icons
$('.fa-star').toggleClass('fa-star').toggleClass('fa-star-o')
- css selectors
.fa-star { color: gold }
- html classes when a non fa class is put in between fa classes
class="fa fa-fw mt4 fa-star-o"
(wrongly translated asfas fa-fw mt4 fa-star-o
)
You can find most of those icons by scanning the code for words containing a -o suffix, here is a regexp: \w-o\W
.
usage: odoo-fontawesome.py [-h] file [file ...]
Translate font-awesome v4 icons to v5
positional arguments:
file file to translate
optional arguments:
-h, --help show this help message and exit