diff options
| author | Christophe Monniez <moc@odoo.com> | 2021-01-08 11:09:21 +0000 |
|---|---|---|
| committer | Christophe Monniez <moc@odoo.com> | 2021-03-29 06:27:14 +0000 |
| commit | 933744231e9fca9fcf6d877364be8596c714415b (patch) | |
| tree | 9e374a4c8ec48d5dd53c14e68ab33e75f023b3f8 /doc/reference/javascript_reference.rst | |
| parent | 7acd8528b72c43f59f39b1eb6370d913ca62d4cf (diff) | |
[IMP] base: improve qweb barcode widget
When printing barcodes for a large amount of records, wkhtmltopdf will
make the same amount of http requests to the server in order to retrieve
barcodes. This can lead to performance issues or wkhtml to crash.
Fortunately, an already existsing qweb widget exists that include
barcodes images as inline base64.
With this commit, the web widget is a bit improved to accept attributes
for the generated image tag. Each option dictionary key starting with
`img_` will be converted into a tag attribute with the corresponding
value.
e.g.: `'img_alt': 'Barcode'` will result in `<img alt="Barcode"...`
The `alt` img attribute now defaults to `'Barcode %s' % value` with the
barcode value.
Finally, if the `symbology` option is not given, the widget defaults to
`Code128`. If `symbology` is set to `auto`, the action report will try
to guess the barcode type, based on the len of the value.
Cherry-pick of db8b3f1dbf780287fe807ab8d05f2858f3fa03f1
This backport of an improvement will permit to fix existing databases
that use the route `/report/barcode/...` in their reports with a large
amount of barcodes to print.
A `Mea Culpa for my sins` improvement was also done in this cherry-pick
and will be forward-ported up to master: a safer lxml.html Element is
used to build the img element.
closes odoo/odoo#68414
X-original-commit: c3eafec76c75b4e3b02e358bab66e2a05938b9db
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions
