diff --git a/energy_selfconsumption/models/supply_point_assignation.py b/energy_selfconsumption/models/supply_point_assignation.py index a1f64eba86df0dbcb02e6c26d7eb623be9136ad4..44ce9721e9da4e18724c3624e4bb93f97fba8e2d 100644 --- a/energy_selfconsumption/models/supply_point_assignation.py +++ b/energy_selfconsumption/models/supply_point_assignation.py @@ -21,6 +21,9 @@ class SupplyPointAssignation(models.Model): 'supply_point_id.id'))]) distribution_table_id = fields.Many2one('energy_selfconsumption.distribution_table', required=True) + selfconsumption_project_id = fields.Many2one(related='distribution_table_id.selfconsumption_project_id') + distribution_table_state = fields.Selection(related='distribution_table_id.state') + distribution_table_create_date = fields.Datetime(related='distribution_table_id.create_date') supply_point_id = fields.Many2one('energy_selfconsumption.supply_point', required=True) coefficient = fields.Float(string='Distribution coefficient', digits=(1, 5), required=True, help="The sum of all the coefficients must result in 1") diff --git a/energy_selfconsumption/views/supply_point_views.xml b/energy_selfconsumption/views/supply_point_views.xml index 8d72828fdfa196029cb45211f2286cb57d2c0540..b784773e2715a5e768c97611216f52656cdb30ba 100644 --- a/energy_selfconsumption/views/supply_point_views.xml +++ b/energy_selfconsumption/views/supply_point_views.xml @@ -36,6 +36,18 @@ </div> </group> </group> + + <notebook> + <page string="Self-consumption Projects" name="selfconsumption_project" autofocus="autofocus"> + <field name="supply_point_assignation_ids"> + <tree default_order="distribution_table_create_date desc"> + <field name="selfconsumption_project_id" string="Name"/> + <field name="distribution_table_state"/> + <field name="distribution_table_create_date"/> + </tree> + </field> + </page> + </notebook> </sheet> <div class="oe_chatter"> <field name="message_follower_ids" widget="mail_followers"/>