odoo/documentation#13522
Created by fw-bot
Statuses:
- ci/documentation: (runtime 1053s)
- ci/codeowner_coverage: (runtime 9s)
- label
- odoo-dev:saas-18.2-master-ui-icons-spreadsheet-sali-438532-fw
- head
- e4cdc81f3e8753b620f55824b5da466c2b3327da
- merged
- 3 weeks ago by Documentation, Samuel Lieber (sali)
odoo/documentation | |
---|---|
18.0 | #13386 |
saas-18.1 | #13520 |
saas-18.2 | #13522 |
saas-18.3 | #13523 |
master | #13524 |
[FW][ADD] UI: odoo spreadsheets svg icons
Task: #4792034
This PR proposes introducing the o-spreadsheet icons into the Odoo documentation.
How this works
The Spreadsheet library in Odoo contains two QWeb template files for SVG icons:
- o_spreadsheet/icons.xml
- o_spreadsheet/o_spreadsheet.xml
These were used to generate an SVG sprite file (extensions/odoo_theme/static/img/odoo-spreadsheet-icons.svg
), which can then be utilized by the SVG <use>
element to call nodes by ID in the sprite.
This SVG sprite file is then included in the main page layout (extensions/odoo_theme/layout.html
)
The RST :icon:
role was updated to accomodate an os-*
icon specifier.
The SVG sprite file can be generated automatically via a simple script outlined in this gist:
https://gist.github.com/samueljlieber/5ae7648a5ca08e0bfc8455861825e2ff
Why?
> This PR attempts to scale an earlier method I used, the RST raw-html(raw)
role includes the <svg>
markup directly in the Global Filters doc (see this diff).
>
> This was/is not scalable, is not usable throughout multiple docs, and will decay over time as the o-spreadsheet library is updated. This PR attempts to find a solution for using o-spreadsheet icons in documentation.
<img width="960" alt="os-icons-versions" src="https://github.com/user-attachments/assets/d93ca04f-cedf-4a39-80d8-7cd13d06818c" />
Example
With this implementation, o-spreadsheet icons can be used like so:
This is the :icon:`os-global-filters` :guilabel:`(global filters)` icon!
Forward-Port-Of: #13386