Skip to content
Snippets Groups Projects
Commit bd7310aa authored by Emanuel Buzey's avatar Emanuel Buzey Committed by Daniil Digtyar Vasilieva
Browse files

[IMP] energy_selfconsumption: add button to open invoicing mode configuration wizard

parent 1e1ad6ee
No related branches found
No related tags found
2 merge requests!253[REL] Release 06/11/23,!211[IMP] energy_selfconsumption: invoicing acquired power
This commit is part of merge request !211. Comments created here will be created in the context of that merge request.
......@@ -162,6 +162,18 @@ class Selfconsumption(models.Model):
"context": {"default_selfconsumption_id": self.id},
}
def set_invoicing_mode(self):
return {
"name": _("Define Invoicing Mode"),
"type": "ir.actions.act_window",
"view_mode": "form",
"res_model": "energy_selfconsumption.define_invoicing_mode.wizard",
"views": [(False, "form")],
"view_id": False,
"target": "new",
"context": {"default_selfconsumption_id": self.id},
}
def action_selfconsumption_import_wizard(self):
self.ensure_one()
return {
......
......@@ -11,3 +11,4 @@ access_energy_selfconsumption_selfconsumption_import_wizard_admin,energy_selfcon
access_energy_selfconsumption_distribution_table_import_wizard_admin,energy_selfconsumption.distribution_table_import.wizard.admin,model_energy_selfconsumption_distribution_table_import_wizard,energy_project.group_admin,1,1,1,1
access_energy_selfconsumption_contract_generation_wizard_admin,energy_selfconsumption.contract_generation.wizard.admin,model_energy_selfconsumption_contract_generation_wizard,energy_project.group_admin,1,1,1,1
accces_energy_selfconsumption_coefficient_report,energy_selfconsumption.coefficient_report.admin,model_energy_selfconsumption_coefficient_report,energy_project.group_admin,1,1,1,1
access_energy_elfconsumptionn_define_invoicing_mode_admin,energy_selfconsumption.define_invoicing_mode.wizard.admin,model_energy_selfconsumption_define_invoicing_mode_wizard,energy_project.group_admin,1,1,1,1
......@@ -69,6 +69,12 @@
string="Download Partition Coefficient"
attrs="{'invisible':[('state','not in',['activation', 'active'])]}"
/>
<button
type="object"
string="Define Invoicing Mode"
name="set_invoicing_mode"
attrs="{'invisible':[('state','not in',['draft'])]}"
/>
<field
name="state"
......
from . import selfconsumption_import_wizard
from . import distribution_table_import_wizard
from . import contract_generation_wizard
from . import define_invoicing_mode_wizard
from odoo import _, fields, models
class ContractGenerationWizard(models.TransientModel):
_name = "energy_selfconsumption.define_invoicing_mode.wizard"
INVOICING_VALUES = [
("power_acquired", _("By power acquired")),
("energy_delivered", _("By energy delivered")),
(
"energy_delivered_hourly",
_("For energy delivered hourly variable coefficients (CSV)"),
),
]
invoicing_mode = fields.Selection(
INVOICING_VALUES,
string=_("Invoicing Mode"),
default="power_acquired",
required=True,
)
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