odoo/documentation#13386
Created by Documentation, Samuel Lieber (sali)
Statuses:
- ci/documentation: (runtime 1013s)
- ci/codeowner_coverage: (runtime 4s)
- label
- odoo-dev:master-ui-icons-spreadsheet-sali
- head
- 9f9eea4d0c6066dcfef3f34f4592e096a2d5884f
- 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 |
[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!