Skip to content
Snippets Groups Projects
Commit 872610fb authored by Daniil Digtyar Vasilieva's avatar Daniil Digtyar Vasilieva :call_me:
Browse files

[IMP] energy_selfconsumption: show period selected

parent 5e7dabb0
No related branches found
No related tags found
1 merge request!250[IMP] energy_selfconsumption: add email template
This commit is part of merge request !247. Comments created here will be created in the context of that merge request.
......@@ -7,6 +7,27 @@ class InvoicingWizard(models.TransientModel):
power = fields.Float(string="Total Energy Generated (kWh)")
contract_ids = fields.Many2many("contract.contract", readonly=True)
next_period_date_start = fields.Date(
string="Next Period Start",
compute="_compute_next_period_date_start_and_end",
readonly=True,
)
next_period_date_end = fields.Date(
string="Next Period End",
compute="_compute_next_period_date_start_and_end",
readonly=True,
)
@api.depends("contract_ids")
def _compute_next_period_date_start_and_end(self):
for record in self:
if len(record.contract_ids) > 0:
record.next_period_date_start = record.contract_ids[
0
].next_period_date_start
record.next_period_date_end = record.contract_ids[
0
].next_period_date_end
@api.constrains("contract_ids")
def constraint_contract_ids(self):
......
......@@ -9,6 +9,10 @@
<field name="arch" type="xml">
<form string="Invoicing Energy Delivered">
<sheet>
<group>
<field name="next_period_date_start" />
<field name="next_period_date_end" />
</group>
<group>
<field name="power" />
<field name="contract_ids">
......
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