Skip to content
Snippets Groups Projects
Commit 626dc506 authored by Emanuel Buzey's avatar Emanuel Buzey
Browse files

[FIX] selfconsumption: Adjustments for Improved Readability and Layout

1. CAU: Add a space between the field name and its value to enhance readability.

2. Table: Remove the coefficient value and leave it blank. Additionally, adjust the height of the fields for improved layout.

3. Remove all other tables, leaving only the self-populating table for simplicity.

4. Update the filename to improve clarity: Change the name of the .txt file.
parent 6c94964b
No related branches found
No related tags found
2 merge requests!195[REL] 14.0.2.0.0,!192[IMP] self_consumption: adding reports and documents
Pipeline #48757 passed with warnings
import base64
import io
from datetime import datetime
from odoo import _, fields, models
from odoo.exceptions import ValidationError
......@@ -172,8 +171,10 @@ class Selfconsumption(models.Model):
line = f"{data['code']};{str(data['coefficient']).replace('.', ',')}\n"
file_content += line
date = datetime.now()
year = date.strftime("%Y")
wizard = self.env["energy_selfconsumption.report_wizard"].create(
{"report_data": file_content, "file_name": "Coeficiente_de_reparto.txt"}
{"report_data": file_content, "file_name": f"{self.code}_{year}.txt"}
)
return {
......
......@@ -6,7 +6,6 @@
<field name="arch" type="xml">
<form string="Generate Partition Coefficient Report">
<group>
<field name="report_data" readonly="1" />
<field name="file_name" readonly="1" />
</group>
<footer>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment