Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing from upstream Vauxoo/addons-vauxoo (15.0) #317

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

bt-admin
Copy link

bt_gitbot

When the node had a style like
"background-color: #99CCFF; font-weight: bold;" the style that comes
after the "; " (with the white-space after the ;) was not being found on
the method `css2excel`.
That happened because the `get_odoo_style` returned the styles like:
`{'background-color': '#99CCFF', ' font-weight': 'bold'}` and the
`process_css` didn't find ' font-weight' in its keys.

So now cleaning the values on the `get_odoo_style` by removing the
whitespaces from the beginning and the end of the string, the method
will now return `{'background-color': '#99CCFF', 'font-weight': 'bold'}`
and the `process_css` will find 'font-weight' in its keys.
Before this change there was a traceback when a `font-size` was added:
```python
File "/usr/local/lib/python3.8/dist-packages/xlwt/BIFFRecords.py", line 725, in __init__
    self._rec_data = pack('<5H4B%ds' % uname_len, height, options, colour_index, weight, escapement,
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/odoo/instance/odoo/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/instance/odoo/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
struct.error: required argument is not an integer
```

That happened because the `height` expected for the fonts is an integer
value and the `get_font_height` was returning `float` values, for
example: "125.0", now we are rounding the new size to 0 decimals to
return the closest integer for that size.
@bt-admin bt-admin added the 15.0 label Jan 25, 2024
@bt-admin bt-admin merged commit 2bdc153 into brain-tec:15.0 Jan 25, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants