Skip to content

[16.0][FIX] lighting_reporting_vanguard_product: round Flujo total to integer on datasheet#97

Merged
eantones merged 1 commit into16.0from
16.0-fix-lighting_reporting_vanguard_product-flujo_total_integer
Apr 22, 2026
Merged

[16.0][FIX] lighting_reporting_vanguard_product: round Flujo total to integer on datasheet#97
eantones merged 1 commit into16.0from
16.0-fix-lighting_reporting_vanguard_product-flujo_total_integer

Conversation

@eantones
Copy link
Copy Markdown
Member

Summary

  • The Flujo total row on the Vanguard technical datasheet (FUENTES DE LUZ section) rendered the raw total_flux value through get_format_lang_decimal, which preserves every non-trailing-zero decimal. A value of 3516.4125 was shown as 3.516,4125 lm, confusing Novolux's technical department and their customers.
  • Reported by Gisela de la Cruz (Novolux Ecommerce Manager); final spec from Albert Orteu (Lighting Projects): "sense cap decimal, números naturals" — Flujo total must always render as an integer, keeping the unit.
  • Fix: extend _get_color_temperature_flux_values with an as_integer=False kwarg that coerces the value with round(...) before handing it off to the existing get_format_lang_decimal helper (which uses %g for integer-valued numbers, matching how nominal_flux already renders integer values in this module). Storage and all other datasheet fields (nominal flux, wattage, color consistency, etc.) untouched.

Test plan

  • Install/upgrade lighting_reporting_vanguard_product with --stop-after-init — loads clean
  • Browser-generated PDFs on product 989A-L0106B-01 (Vanguard / Español) via IMPRIMIR FICHA TÉCNICA → Odoo wizard:
    • Before: Flujo total (2x) 239,39lm
    • After: Flujo total (2x) 239lm
    • Flujo nominal (2x) 200lm unchanged, full CSS/paperformat identical
  • Regression on products where total_flux is already integer (282.0, 152.0, 4320.0) — output unchanged
  • pre-commit run -a passes clean

Closes task #2564.

…er on datasheet

The Flujo total row on the vanguard technical datasheet (FUENTES DE LUZ
section) was rendered via get_format_lang_decimal, which preserves all
non-trailing-zero decimals — so a raw value of 3516.4125 was shown as
"3.516,4125 lm", confusing the technical department and end customers.

Per Albert Orteu (Lighting Projects), the spec is "sense cap decimal,
números naturals" — Flujo total must always render as a natural integer,
with the unit preserved.

Extend _get_color_temperature_flux_values with an as_integer kwarg that
coerces the value with int(round(...)) before handing it off to the
existing get_format_lang_decimal helper (which returns "%g" for
integer-valued numbers, matching how nominal_flux already renders
integer values in this module). Storage is untouched and all other
flux/wattage/color-consistency fields keep their prior formatting.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.56%. Comparing base (ec84011) to head (bd35a92).
⚠️ Report is 1 commits behind head on 16.0.

Files with missing lines Patch % Lines
...ard_product/models/lighting_product_source_line.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             16.0      #97      +/-   ##
==========================================
- Coverage   43.57%   43.56%   -0.02%     
==========================================
  Files         283      283              
  Lines        8128     8130       +2     
  Branches     1569     1570       +1     
==========================================
  Hits         3542     3542              
- Misses       4491     4493       +2     
  Partials       95       95              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eantones eantones merged commit 077dd16 into 16.0 Apr 22, 2026
5 of 6 checks passed
@eantones eantones deleted the 16.0-fix-lighting_reporting_vanguard_product-flujo_total_integer branch April 22, 2026 12:38
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.

1 participant