Skip to content
Snippets Groups Projects
Commit 283b8408 authored by Daniil Digtyar Vasilieva's avatar Daniil Digtyar Vasilieva :call_me: Committed by Enrico Stano
Browse files

[IMP] energy_selfconsumption_cooperator: rename cooperator_id to partner_id

parent 814147fe
No related branches found
No related tags found
2 merge requests!187Release 14.0.1.1.13,!155[IMP] energy_selfconsumption: importation of selfconsumption inscriptions, supply points and distribution tables by CSV
......@@ -4,13 +4,13 @@ from odoo import fields, models, api
class SupplyPoint(models.Model):
_inherit = "energy_selfconsumption.supply_point"
cooperator_id = fields.Many2one(
"res.partner",
partner_id = fields.Many2one(
string="Cooperator",
required=True,
domain=[("member", "=", True)],
required=True,
help="Cooperator subscribed to the self-consumption project"
)
@api.onchange('cooperator_id')
@api.onchange('partner_id')
def _onchange_cooperator_id(self):
self.owner_id = self.cooperator_id
self.owner_id = self.partner_id
......@@ -27,7 +27,7 @@
<field name="inherit_id" ref="energy_selfconsumption.view_partner_form_inherit" />
<field name="arch" type="xml">
<xpath expr="//button[@name='get_supply_points']" position="attributes">
<attribute name="context">{'default_cooperator_id': id}</attribute>
<attribute name="context">{'default_partner_id': id}</attribute>
</xpath>
</field>
</record>
......
......@@ -10,8 +10,8 @@
/>
<field name="arch" type="xml">
<xpath expr="//field[@name='owner_id']" position="replace">
<field name="cooperator_id" options="{'no_create': True}"/>
<field name="owner_id" domain="['|', ('member', '=' , False), ('id', '=', cooperator_id)]"/>
<field name="partner_id" options="{'no_create': True}"/>
<field name="owner_id" domain="['|', ('member', '=' , False), ('id', '=', partner_id)]"/>
</xpath>
</field>
</record>
......
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