Skip to content

[16.0][MIG] controller_report_xls: Migration to 16.0. t#87779 #1700

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

Conversation

CDanielSanSeg
Copy link
Contributor

[MIG] controller_report_xls: Migration to 16.0

@hugho-ad hugho-ad requested a review from luisg123v July 2, 2025 01:22
Copy link
Contributor

@hugho-ad hugho-ad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@luisg123v
Copy link
Contributor

Please fix PR title.

@hugho-ad hugho-ad changed the title 16.0 migrate controller report xls from 15 to 16 [16.0][MIG] controller_report_xls: Migration to 16.0 Jul 2, 2025
@hugho-ad
Copy link
Contributor

hugho-ad commented Jul 2, 2025

@luisg123v
done

@luisg123v
Copy link
Contributor

Missing task ID on PR title

@CDanielSanSeg CDanielSanSeg changed the title [16.0][MIG] controller_report_xls: Migration to 16.0 [16.0][MIG] controller_report_xls: Migration to 16.0. t#87779 Jul 3, 2025
hbto and others added 22 commits July 4, 2025 12:00
… funcion, to avoid mistake for minimal changes in their values
Trying to fix this pylint errors.

cmd: [u'/home/runbot/instance/extra_addons/odoo-extra/runbot/static/build/35660-8-0-8-0-lo/pylint_run.sh']
�[7;33m************* Module openerp.addons.controller_report_xls.controllers.main�[0m
openerp.addons.controller_report_xls.controllers.main:2: [F0401(�[1;4;31mimport-error�[0m), ] �[1;4;31mUnable to import 'openerp.addons.web.http'�[0m
openerp.addons.controller_report_xls.controllers.main:3: [E0611(�[1;31mno-name-in-module�[0m), ] �[1;31mNo name 'url_decode' in module 'werkzeug'�[0m
…count the README.md

description an a predefined module descriptor footer (Footer includes an
image with Vauxoo Large Logo.

This was created using an script Vauxoo/gist-vauxoo/description2html.
… Vauxoo Logo.

This was apply using the script Vauxoo/gist-vauxoo/description2html.
…re that odoo apps refresh the new index.html description
moylop260 and others added 17 commits July 4, 2025 12:00
 - [REF] aging_due_report: Migration to new api, small fixes
 - [IMP] controller_report_xls: take in consideration thead, tbody, map some the styles from css to xfstyle
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.
- Updated __manifest__.py: set license to LGPL-3, switched to HTTPS for
  URL, removed unnecessary keys.
- Removed outdated copyright header from main controller.
- Refreshed es.po with current project metadata.
- Deleted redundant translation files (es_ES, es_MX, es_PA, es_VE) to
  avoid duplication.
- Fix undefined variable 'cssstyle' in get_css_style function
- Fix undefined variable 'result' in match_color_index function
- Improve string comparison using truthiness instead of empty string
  check
- Remove controllers/main.py, as the controller logic has been
  consolidated into reports/report_xls.py.
- Update imports to reflect the new structure.
- Modernize the codebase while maintaining backward compatibility for
  XLS report generation.
@CDanielSanSeg CDanielSanSeg force-pushed the 16.0-migrate_controller_report_xls_from_15_to_16-CDanielSanSeg branch 2 times, most recently from f4697cd to 8022237 Compare July 4, 2025 18:41
@CDanielSanSeg
Copy link
Contributor Author

@luisg123v can you check this MR?

@CDanielSanSeg CDanielSanSeg force-pushed the 16.0-migrate_controller_report_xls_from_15_to_16-CDanielSanSeg branch from 8022237 to 3df6a70 Compare July 4, 2025 19:45
@CDanielSanSeg CDanielSanSeg force-pushed the 16.0-migrate_controller_report_xls_from_15_to_16-CDanielSanSeg branch from 3df6a70 to ca54b9c Compare July 4, 2025 19:47
@CDanielSanSeg CDanielSanSeg requested a review from luisg123v July 4, 2025 20:12
@hugho-ad
Copy link
Contributor

@luisg123v

comments Done

Copy link
Contributor

@luisg123v luisg123v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@luisg123v luisg123v merged commit c087a1d into Vauxoo:16.0 Jul 11, 2025
3 checks passed
@luisg123v luisg123v deleted the 16.0-migrate_controller_report_xls_from_15_to_16-CDanielSanSeg branch July 11, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.