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

[IMP] energy_selfconsumption: add price and recurring invoicing fields

parent bd7310aa
No related branches found
No related tags found
2 merge requests!253[REL] Release 06/11/23,!211[IMP] energy_selfconsumption: invoicing acquired power
......@@ -34,6 +34,7 @@
"wizards/selfconsumption_import_wizard_views.xml",
"wizards/distribution_table_import_wizard_views.xml",
"wizards/contract_generation_wizard_views.xml",
"wizards/define_invoicing_mode_wizard_view.xml",
"reports/selfconsumption_reports.xml",
],
}
......@@ -13,9 +13,33 @@ class ContractGenerationWizard(models.TransientModel):
),
]
RULE_TYPE_OPTIONS = [
("daily", _("Day(s)")),
("weekly", _("Week(s)")),
("monthly", _("Month(s)")),
("monthlylastday", _("Month(s) last day")),
("quarterly", _("Quarter(s)")),
("semesterly", _("Semester(s)")),
("yearly", _("Year(s)")),
]
invoicing_mode = fields.Selection(
INVOICING_VALUES,
string=_("Invoicing Mode"),
default="power_acquired",
required=True,
)
price = fields.Float(required=True)
recurrence_interval = fields.Integer(
default=1,
string=_("Invoice Every"),
help=_("Invoice every (Days/Week/Month/Year)"),
)
recurring_rule_type = fields.Selection(
RULE_TYPE_OPTIONS,
default="monthly",
string=_("Recurrence"),
help=_("Specify Interval for automatic invoice generation."),
)
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record model="ir.ui.view" id="define_invoicing_mode_wizard_form_view">
<field
name="name"
>energy_selfconsumption.define_invoicing_mode.wizard.form</field>
<field
name="model"
>energy_selfconsumption.define_invoicing_mode.wizard</field>
<field name="arch" type="xml">
<form string="Define Invoicing Mode Wizard">
<sheet>
<group>
<group col="1">
<field name="invoicing_mode" />
<field
name="price"
string="kWh Price (€/kWh)"
attrs="{'invisible': [('invoicing_mode', 'not in', ['energy_delivered', 'energy_delivered_hourly'])]}"
/>
<field
name="price"
string="kWn Price per day (€/kWn/dia)"
attrs="{'invisible': [('invoicing_mode', '!=', 'power_acquired')]}"
/>
</group>
<group col="2">
<field name="recurrence_interval" />
<field name="recurring_rule_type" />
</group>
</group>
</sheet>
</form>
</field>
</record>
</data>
</odoo>
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