Skip to content
Snippets Groups Projects
Commit 69c48276 authored by Benjamí               Ramos's avatar Benjamí Ramos
Browse files

Merge branch 'release/14.0.1.1.12' into '14.0'

Release 14.0.1.1.12

See merge request !173
parents b5769d7e 54cb2dff
No related branches found
Tags v14.0.1.1.12
2 merge requests!239Draft: [REL] energy_communities: dependency energy_selfconsumption bump to,!173Release 14.0.1.1.12
Pipeline #38166 passed
Showing
with 396 additions and 45 deletions
{ {
'name': "Energy Community", 'name': "Energy Community",
'version': '14.0.1.1.11', 'version': '14.0.1.1.12',
'depends': [ 'depends': [
'account', 'account',
'cooperator_account_banking_mandate', 'cooperator_account_banking_mandate',
......
from odoo import SUPERUSER_ID, api
import logging
logger = logging.getLogger(__name__)
def migrate(cr, version):
logger.info("Running post migration {}".format(version))
env = api.Environment(cr, SUPERUSER_ID, {})
internal_user_role = env.ref('energy_communities.role_internal_user')
odoo_base_user_ids = [u.id for u in (env.ref("base.user_root"),
env.ref("base.user_admin"),
env.ref("base.default_user"),
env.ref("base.public_user"),
env.ref("base.template_portal_user_id"))]
instance_company_id = env['res.company'].search([('hierarchy_level','=','instance')])
logger.info("Running post migration {}. Instance company: {}".format(version, instance_company_id.name))
coordinator_company_ids = env['res.company'].search([('hierarchy_level','=','coordinator')])
logger.info("Running post migration {}. Coordinator companies: {}".format(version, coordinator_company_ids.mapped('name')))
# get all target users to manage
target_users = env['res.users'].search([('id', 'not in', odoo_base_user_ids)])
logger.info("Running post migration {}. All Target users ({}): {}".format(version,
len(target_users), str(target_users.mapped('name'))))
# get users that must be setted as platform_admins
target_users_platform_admins = target_users.filtered(lambda u: instance_company_id in u.company_ids)
logger.info("Running post migration {}. Platform admin users ({}): {}".format(version,
len(target_users_platform_admins), str(target_users_platform_admins.mapped('name'))))
target_users = target_users - target_users_platform_admins
# get users that must be setted as coordinator_admins
target_users_coordinator_admins = env['res.users']
for u in target_users:
if u.company_ids & coordinator_company_ids:
target_users_coordinator_admins |= u
logger.info("Running post migration {}. Coordinator admin users ({}): {}".format(version,
len(target_users_coordinator_admins), str(target_users_coordinator_admins.mapped('name'))))
# get users that must be setted as CE users (admin or member) per its company_ids
target_users = target_users - target_users_coordinator_admins
logger.info("Running post migration {}. CE admn & member users ({}): {}".format(version,
len(target_users), str(target_users.mapped('name'))))
# loop1 --> update the plattform_admin_users
for u in target_users_platform_admins:
logger.info("Running post migration {}. Platform admin users: {}".format(version, u.name))
# delete all existing role lines
u.write({'role_line_ids':[(5,0,0)]})
# add the internal role
u.write({'role_line_ids':[(0,0,{
"user_id": u.id,
"active": True,
"role_id": internal_user_role.id,})]})
# add the platform admin role
u.write({'role_line_ids':[(0,0,{
"user_id": u.id,
"active": True,
"role_id": env.ref('energy_communities.role_platform_admin').id,})]})
# loop2 --> update the Coordinators users
for u in target_users_coordinator_admins:
logger.info("Running post migration {}. Coordinator admin users: {}".format(version, u.name))
original_company_ids = env['res.company'].browse(u.company_ids.mapped('id'))
logger.info("Original user companies {}".format(original_company_ids.mapped('name')))
# get the companies that are sons of the Coordinator ones
coord_company_ids = u.company_ids & coordinator_company_ids
logger.info("Coordinator companies {}".format(coord_company_ids.mapped('name')))
coord_hierarchy_company_ids = env['res.company']
for coord_c in coord_company_ids:
coord_hierarchy_company_ids |= env['res.company'].search(
[('hierarchy_level','=','community'),('parent_id','=',coord_c.id)])
logger.info("Sons of coord companies {}".format(coord_hierarchy_company_ids.mapped('name')))
# delete all existing role lines
u.write({'role_line_ids':[(5,0,0)]})
# add the internal role
u.write({'role_line_ids':[(0,0,{
"user_id": u.id,
"active": True,
"role_id": internal_user_role.id,})]})
# update the user company_ids
for c in coord_hierarchy_company_ids:
if c not in original_company_ids:
logger.info("Company added to user {}".format(c.name))
u.write({'company_ids':[(4,c.id)]})
# add the coord_admin role
for coord_c in coord_company_ids:
u.write({'role_line_ids':[(0,0,{
"company_id": coord_c.id,
"user_id": u.id,
"active": True,
"role_id": env.ref('energy_communities.role_coord_admin').id,})]})
# add the ce_manager role
for coord_son in coord_hierarchy_company_ids:
u.write({'role_line_ids':[(0,0,{
"company_id": coord_son.id,
"user_id": u.id,
"active": True,
"role_id": env.ref('energy_communities.role_ce_manager').id,})]})
# add role_line (member_ce) for the companies that are not under the coordinator ones
# TODO: it can be that a user originally has a role different than ce_member for those companies
# that are not under the Coordinator's hierarchy, but we here are simplifiying and assigning ce_member
full_hierarchy_company_ids = coord_hierarchy_company_ids | coord_company_ids
for not_coord_hie_c in original_company_ids - full_hierarchy_company_ids:
u.write({'role_line_ids':[(0,0,{
"company_id": not_coord_hie_c.id,
"user_id": u.id,
"active": True,
"role_id": env.ref('energy_communities.role_ce_member').id,})]})
# loop3 --> update the CE users (u)
for u in target_users:
role_to_use = env.ref('energy_communities.role_ce_member')
already_has_internal = False
# get the roles in role_lines that don't have any company_id mantained
roles_no_company = list(set([rl.role_id for rl in u.role_line_ids if (not rl.company_id and rl.active)]))
for r in roles_no_company:
if r == internal_user_role:
already_has_internal = True
if r in (
env.ref('energy_communities.role_ce_admin'),
env.ref('energy_communities.role_ce_manager'),
env.ref('energy_communities.role_coord_admin'),
env.ref('energy_communities.role_coord_worker'),
env.ref('energy_communities.role_platform_admin',)):
role_to_use = env.ref('energy_communities.role_ce_admin')
# review & clean all existing role_line_ids &
# get the role_lines that already have
companies_with_role_line = []
for rl_id in [l.id for l in u.role_line_ids]:
rl = env['res.users.role.line'].browse([rl_id])
if not rl.company_id:
if rl.role_id != internal_user_role:
u.write({'role_line_ids':[(3,rl_id)]})
else: #role_lines with company assigned
if not rl.active:
u.write({'role_line_ids':[(3,rl_id)]})
elif rl.company_id not in u.company_ids:
u.write({'role_line_ids':[(3,rl_id)]})
else:
companies_with_role_line.append(rl.company_id)
# add internal role if needed
if not already_has_internal:
u.write({'role_line_ids':[(0,0,{
"user_id": u.id,
"active": True,
"role_id": internal_user_role.id,})]})
# add remaining per company role_lines
for c in u.company_ids:
if c not in companies_with_role_line:
u.write({'role_line_ids':[(0,0,{
"company_id": c.id,
"user_id": u.id,
"active": True,
"role_id": role_to_use.id,})]})
...@@ -28,20 +28,94 @@ ...@@ -28,20 +28,94 @@
<field name="name">Energy Community Member</field> <field name="name">Energy Community Member</field>
<field name="code">role_ce_member</field> <field name="code">role_ce_member</field>
<field name="implied_ids" eval="[ <field name="implied_ids" eval="[
(5, 0, 0),
(4, ref('group_user')), (4, ref('group_user')),
(4, ref('base.group_portal'))]"/> ]"/>
</record> </record>
<record model="res.users.role" id="role_ce_admin"> <record model="res.users.role" id="role_ce_admin">
<field name="name">Energy Community Administrator</field> <field name="name">Energy Community Administrator</field>
<field name="code">role_ce_admin</field> <field name="code">role_ce_admin</field>
<field name="implied_ids" <field name="implied_ids" eval="[
eval="[ (5, 0, 0),
(4, ref('group_admin')), (4, ref('group_admin')),
(4, ref('sale.group_delivery_invoice_address')), (4, ref('sale.group_delivery_invoice_address')),
(4, ref('account.group_account_invoice')), (4, ref('account.group_account_invoice')),
(4, ref('account.group_account_manager')),
(4, ref('account.group_account_user')),
(4, ref('base.group_partner_manager')),
(4, ref('base.group_multi_company')),
(4, ref('base.group_allow_export')),
(4, ref('cooperator.cooperator_group_manager')),
(4, ref('sales_team.group_sale_manager')),
(4, ref('purchase.group_purchase_manager')),
(4, ref('account.group_account_manager')),
(4, ref('account_payment_order.group_account_payment')),
(4, ref('crm.group_use_lead')),
(4, ref('mass_mailing.group_mass_mailing_user')),
(4, ref('l10n_es_aeat.group_account_aeat')),
]"/>
</record>
<record model="res.users.role" id="role_ce_manager">
<field name="name">Energy Community Manager</field>
<field name="code">role_ce_manager</field>
<field name="implied_ids" eval="[
(5, 0, 0),
(4, ref('group_admin')),
(4, ref('sale.group_delivery_invoice_address')),
(4, ref('account.group_account_invoice')),
(4, ref('account.group_account_manager')),
(4, ref('account.group_account_user')),
(4, ref('base.group_partner_manager')),
(4, ref('base.group_multi_company')),
(4, ref('base.group_allow_export')),
(4, ref('cooperator.cooperator_group_manager')),
(4, ref('sales_team.group_sale_manager')),
(4, ref('purchase.group_purchase_manager')),
(4, ref('account.group_account_manager')),
(4, ref('account_payment_order.group_account_payment')),
(4, ref('crm.group_use_lead')),
(4, ref('mass_mailing.group_mass_mailing_user')),
(4, ref('l10n_es_aeat.group_account_aeat')),
]"/>
</record>
<record model="res.users.role" id="role_coord_admin">
<field name="name">Coordinator Admin</field>
<field name="code">role_coord_admin</field>
<field name="implied_ids" eval="[
(5, 0, 0),
(4, ref('group_admin')),
(4, ref('sale.group_delivery_invoice_address')),
(4, ref('account.group_account_invoice')),
(4, ref('account.group_account_manager')),
(4, ref('account.group_account_user')),
(4, ref('base.group_partner_manager')),
(4, ref('base.group_multi_company')),
(4, ref('base.group_allow_export')),
(4, ref('cooperator.cooperator_group_manager')),
(4, ref('sales_team.group_sale_manager')),
(4, ref('purchase.group_purchase_manager')),
(4, ref('account.group_account_manager')),
(4, ref('account_payment_order.group_account_payment')),
(4, ref('crm.group_use_lead')),
(4, ref('mass_mailing.group_mass_mailing_user')),
(4, ref('l10n_es_aeat.group_account_aeat')),
]"/>
</record>
<record model="res.users.role" id="role_coord_worker">
<field name="name">Coordinator Worker</field>
<field name="code">role_coord_worker</field>
<field name="implied_ids" eval="[
(5, 0, 0),
(4, ref('group_user')),
(4, ref('sale.group_delivery_invoice_address')),
(4, ref('account.group_account_invoice')),
(4, ref('account.group_account_manager')),
(4, ref('account.group_account_user')),
(4, ref('base.group_partner_manager')), (4, ref('base.group_partner_manager')),
(4, ref('base.group_user')),
(4, ref('base.group_multi_company')), (4, ref('base.group_multi_company')),
(4, ref('base.group_allow_export')), (4, ref('base.group_allow_export')),
(4, ref('cooperator.cooperator_group_manager')), (4, ref('cooperator.cooperator_group_manager')),
...@@ -59,12 +133,15 @@ ...@@ -59,12 +133,15 @@
<field name="name">Platform admin role</field> <field name="name">Platform admin role</field>
<field name="code">role_platform_admin</field> <field name="code">role_platform_admin</field>
<field name="implied_ids" eval="[ <field name="implied_ids" eval="[
(5, 0, 0),
(4, ref('group_platform_manager')), (4, ref('group_platform_manager')),
(4, ref('group_admin')),
(4, ref('base.group_erp_manager')), (4, ref('base.group_erp_manager')),
(4, ref('sale.group_delivery_invoice_address')), (4, ref('sale.group_delivery_invoice_address')),
(4, ref('account.group_account_invoice')), (4, ref('account.group_account_invoice')),
(4, ref('account.group_account_manager')),
(4, ref('account.group_account_user')),
(4, ref('base.group_partner_manager')), (4, ref('base.group_partner_manager')),
(4, ref('base.group_user')),
(4, ref('base.group_system')), (4, ref('base.group_system')),
(4, ref('base.group_multi_company')), (4, ref('base.group_multi_company')),
(4, ref('base.group_allow_export')), (4, ref('base.group_allow_export')),
...@@ -79,4 +156,13 @@ ...@@ -79,4 +156,13 @@
(4, ref('l10n_es_aeat.group_account_aeat')) (4, ref('l10n_es_aeat.group_account_aeat'))
]"/> ]"/>
</record> </record>
<record model="res.users.role" id="role_internal_user">
<field name="name">Internal User</field>
<field name="code">role_internal_user</field>
<field name="implied_ids" eval="[
(5, 0, 0),
(4, ref('base.group_user')),
]"/>
</record>
</odoo> </odoo>
...@@ -17,32 +17,58 @@ class CRMLeadService(Component): ...@@ -17,32 +17,58 @@ class CRMLeadService(Component):
create_dict = super().create(params) create_dict = super().create(params)
crm_lead = json.loads(create_dict.response[0].decode("utf-8")) crm_lead = json.loads(create_dict.response[0].decode("utf-8"))
# get utm source from payload
target_source_xml_id = self._get_source_xml_id(params)
if target_source_xml_id:
# setup utm source on crm lead
crm_lead_id = crm_lead.get('id', False)
self._setup_lead_utm_source(crm_lead_id, target_source_xml_id)
# select autoresponder notification id based on utm source
template_external_id = self._get_autoresponder_email_template(
target_source_xml_id)
# send auto responder email and notify admins
email_values = {"email_to": params["email_from"]}
if template_external_id:
template = self.env.ref(
"energy_communities.{}".format(template_external_id)
)
template.sudo().send_mail(
crm_lead["id"], email_values=email_values)
# Add template to chatter message
self.env["crm.lead"].post_template_to_chatter(template.id)
return crm_lead
def _setup_lead_utm_source(self, lead_id, source_xml_id):
lead = self.env['crm.lead'].browse(lead_id)
if lead:
utm_source = self.env.ref('energy_communities.'+source_xml_id)
lead.write({
'source_id': utm_source.id
})
def _get_source_xml_id(self, params):
metadata = params["metadata"] metadata = params["metadata"]
target_source_xml_id = None target_source_xml_id = None
for data in metadata: for data in metadata:
if data["key"] == "source_xml_id": if data["key"] == "source_xml_id":
target_source_xml_id = data["value"] target_source_xml_id = data["value"]
return target_source_xml_id
def _get_autoresponder_email_template(self, source_xml_id):
template_external_id = None template_external_id = None
if target_source_xml_id == "ce_source_creation_ce_proposal": if source_xml_id == "ce_source_creation_ce_proposal":
template_external_id = "email_templ_lead_ce_creation_receipt_confirm_id" template_external_id = "email_templ_lead_ce_creation_receipt_confirm_id"
elif target_source_xml_id == "ce_source_existing_ce_contact": elif source_xml_id == "ce_source_existing_ce_contact":
template_external_id = "email_templ_lead_request_contact_confirm_id" template_external_id = "email_templ_lead_request_contact_confirm_id"
elif target_source_xml_id == "ce_source_existing_ce_info": elif source_xml_id == "ce_source_existing_ce_info":
template_external_id = "email_templ_lead_request_ce_news_confirm_id" template_external_id = "email_templ_lead_request_ce_news_confirm_id"
elif target_source_xml_id == "ce_source_future_location_ce_info": elif source_xml_id == "ce_source_future_location_ce_info":
template_external_id = ( template_external_id = (
"email_templ_lead_request_advise_future_ce_confirm_id" "email_templ_lead_request_advise_future_ce_confirm_id"
) )
elif target_source_xml_id == "ce_source_general_info": elif source_xml_id == "ce_source_general_info":
template_external_id = "email_templ_lead_request_platform_news_confirm_id" template_external_id = "email_templ_lead_request_platform_news_confirm_id"
return template_external_id
email_values = {"email_to": params["email_from"]}
if template_external_id:
template = self.env.ref(
"energy_communities.{}".format(template_external_id)
)
template.sudo().send_mail(crm_lead["id"], email_values=email_values)
# Add template to chatter message
self.env["crm.lead"].post_template_to_chatter(template.id)
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"author": "Coopdevs Treball SCCL & Som Energia SCCL", "author": "Coopdevs Treball SCCL & Som Energia SCCL",
"website": "https://somcomunitats.coop/", "website": "https://somcomunitats.coop/",
"category": "Customizations", "category": "Customizations",
"version": "14.0.1.1.1", "version": "14.0.1.1.2",
"depends": [ "depends": [
"base", "base",
"mail", "mail",
...@@ -18,5 +18,6 @@ ...@@ -18,5 +18,6 @@
"security/res_groups.xml", "security/res_groups.xml",
"security/ir.model.access.csv", "security/ir.model.access.csv",
"security/ir_rule_data.xml", "security/ir_rule_data.xml",
"views/inscription_views.xml",
], ],
} }
...@@ -24,7 +24,7 @@ class Project(models.Model): ...@@ -24,7 +24,7 @@ class Project(models.Model):
# address fields # address fields
street = fields.Char(required=True) street = fields.Char(required=True)
street2 = fields.Char(required=True) street2 = fields.Char()
zip = fields.Char(change_default=True, required=True) zip = fields.Char(change_default=True, required=True)
city = fields.Char(required=True) city = fields.Char(required=True)
state_id = fields.Many2one( state_id = fields.Many2one(
...@@ -35,5 +35,6 @@ class Project(models.Model): ...@@ -35,5 +35,6 @@ class Project(models.Model):
required=True, required=True,
) )
country_id = fields.Many2one( country_id = fields.Many2one(
"res.country", string="Country", ondelete="restrict", required=True "res.country", string="Country", ondelete="restrict", required=True,
default=lambda self: self.env.ref('base.es')
) )
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="inscription_view_tree" model="ir.ui.view">
<field name="name">Inscription List</field>
<field name="model">energy_project.inscription</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="partner_id" options="{'no_create': True}" width="50%" />
<field name="effective_date" width="50%" />
</tree>
</field>
</record>
</data>
</odoo>
...@@ -18,6 +18,15 @@ ...@@ -18,6 +18,15 @@
/> />
</record> </record>
<record model="res.users.role" id="energy_communities.role_ce_manager">
<field
name="implied_ids"
eval="[
(4, ref('energy_project.group_admin')),
]"
/>
</record>
<record model="res.users.role" id="energy_communities.role_platform_admin"> <record model="res.users.role" id="energy_communities.role_platform_admin">
<field <field
name="implied_ids" name="implied_ids"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"author": "Coopdevs Treball SCCL & Som Energia SCCL", "author": "Coopdevs Treball SCCL & Som Energia SCCL",
"website": "https://somcomunitats.coop/", "website": "https://somcomunitats.coop/",
"category": "Customizations", "category": "Customizations",
"version": "14.0.1.1.1", "version": "14.0.1.1.2",
"depends": [ "depends": [
"base", "base",
"mail", "mail",
......
...@@ -14,14 +14,22 @@ class Selfconsumption(models.Model): ...@@ -14,14 +14,22 @@ class Selfconsumption(models.Model):
for record in self: for record in self:
record.distribution_table_count = len(record.distribution_table_ids) record.distribution_table_count = len(record.distribution_table_ids)
def _compute_inscription_count(self):
for record in self:
record.inscription_count = len(record.inscription_ids)
project_id = fields.Many2one( project_id = fields.Many2one(
"energy_project.project", required=True, ondelete="cascade" "energy_project.project", required=True, ondelete="cascade"
) )
code = fields.Char(string="CAU") code = fields.Char(string="CAU")
power = fields.Float(string="Generation Power (kWh)") cil = fields.Char(string="CIL", help="Production facility code for liquidation purposes")
owner_id = fields.Many2one("res.partner", string="Owner", required=True, default=lambda self: self.env.company.partner_id)
power = fields.Float(string="Generation Power (kW)")
distribution_table_ids = fields.One2many('energy_selfconsumption.distribution_table', 'selfconsumption_project_id', distribution_table_ids = fields.One2many('energy_selfconsumption.distribution_table', 'selfconsumption_project_id',
readonly=True) readonly=True)
distribution_table_count = fields.Integer(compute=_compute_distribution_table_count) distribution_table_count = fields.Integer(compute=_compute_distribution_table_count)
inscription_ids = fields.One2many('energy_project.inscription', 'project_id', readonly=True)
inscription_count = fields.Integer(compute=_compute_inscription_count)
def get_distribution_tables(self): def get_distribution_tables(self):
self.ensure_one() self.ensure_one()
...@@ -33,6 +41,17 @@ class Selfconsumption(models.Model): ...@@ -33,6 +41,17 @@ class Selfconsumption(models.Model):
'domain': [('selfconsumption_project_id', '=', self.id)], 'domain': [('selfconsumption_project_id', '=', self.id)],
'context': {'create': True, 'default_selfconsumption_project_id': self.id}, 'context': {'create': True, 'default_selfconsumption_project_id': self.id},
} }
def get_inscriptions(self):
self.ensure_one()
return {
'type': 'ir.actions.act_window',
'name': 'Inscriptions',
'view_mode': 'tree,form',
'res_model': 'energy_project.inscription',
'domain': [('project_id', '=', self.id)],
'context': {'create': True, 'default_project_id': self.id},
}
def set_activation(self): def set_activation(self):
for record in self: for record in self:
...@@ -42,6 +61,8 @@ class Selfconsumption(models.Model): ...@@ -42,6 +61,8 @@ class Selfconsumption(models.Model):
for record in self: for record in self:
if not record.code: if not record.code:
raise ValidationError(_("Project must have a valid Code.")) raise ValidationError(_("Project must have a valid Code."))
if not record.cil:
raise ValidationError(_("Project must have a valid CIL."))
if not record.power or record.power <= 0: if not record.power or record.power <= 0:
raise ValidationError(_("Project must have a valid Generation Power.")) raise ValidationError(_("Project must have a valid Generation Power."))
if not record.distribution_table_ids.filtered_domain([('state', '=', 'validated')]): if not record.distribution_table_ids.filtered_domain([('state', '=', 'validated')]):
......
...@@ -21,6 +21,9 @@ class SupplyPointAssignation(models.Model): ...@@ -21,6 +21,9 @@ class SupplyPointAssignation(models.Model):
'supply_point_id.id'))]) 'supply_point_id.id'))])
distribution_table_id = fields.Many2one('energy_selfconsumption.distribution_table', required=True) 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) supply_point_id = fields.Many2one('energy_selfconsumption.supply_point', required=True)
coefficient = fields.Float(string='Distribution coefficient', digits=(1, 5), required=True, coefficient = fields.Float(string='Distribution coefficient', digits=(1, 5), required=True,
help="The sum of all the coefficients must result in 1") help="The sum of all the coefficients must result in 1")
......
energy_selfconsumption/static/description/icon.png

3.63 KiB | W: | H:

energy_selfconsumption/static/description/icon.png

2.69 KiB | W: | H:

energy_selfconsumption/static/description/icon.png
energy_selfconsumption/static/description/icon.png
energy_selfconsumption/static/description/icon.png
energy_selfconsumption/static/description/icon.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
</header> </header>
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">
<button class="oe_stat_button" type="object" name="get_inscriptions"
icon="fa-pencil-square-o" context="{'default_effective_date': today}">
<field string="Inscriptions" name="inscription_count" widget="statinfo"/>
</button>
<button class="oe_stat_button" type="object" name="get_distribution_tables" <button class="oe_stat_button" type="object" name="get_distribution_tables"
icon="fa-table" context="{'default_owner_id': id}" icon="fa-table" context="{'default_owner_id': id}"
attrs="{'invisible': [('state', '==', 'draft')]}"> attrs="{'invisible': [('state', '==', 'draft')]}">
...@@ -61,10 +66,18 @@ ...@@ -61,10 +66,18 @@
name="code" name="code"
attrs="{'readonly': [('state', 'not in', ['draft', 'activation'])]}" attrs="{'readonly': [('state', 'not in', ['draft', 'activation'])]}"
/> />
<field
name="cil"
attrs="{'readonly': [('state', 'not in', ['draft', 'activation'])]}"
/>
<field <field
name="power" name="power"
attrs="{'readonly': [('state', 'not in', ['draft', 'activation'])]}" attrs="{'readonly': [('state', 'not in', ['draft', 'activation'])]}"
/> />
<field
name="owner_id"
attrs="{'readonly': [('state', 'not in', ['draft', 'activation'])]}"
/>
</group> </group>
<group> <group>
<span class="o_form_label o_td_label" name="address_name"> <span class="o_form_label o_td_label" name="address_name">
...@@ -89,22 +102,6 @@ ...@@ -89,22 +102,6 @@
</div> </div>
</group> </group>
</group> </group>
<group>
<field
name="inscription_ids"
widget="one2many"
mode="list"
context="{'default_project_id':id, 'default_effective_date': today}"
>
<tree editable="bottom">
<field
name="partner_id"
options="{'no_create': True}"
/>
<field name="effective_date"/>
</tree>
</field>
</group>
</sheet> </sheet>
<div class="oe_chatter"> <div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/> <field name="message_follower_ids" widget="mail_followers"/>
...@@ -121,6 +118,12 @@ ...@@ -121,6 +118,12 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Self-Consumption Projects"> <tree string="Self-Consumption Projects">
<field name="name"/> <field name="name"/>
<field name="street"/>
<field name="street2"/>
<field name="state_id"/>
<field name="zip"/>
<field name="country_id"/>
<field name="power"/>
<field name="state"/> <field name="state"/>
</tree> </tree>
</field> </field>
......
...@@ -36,6 +36,18 @@ ...@@ -36,6 +36,18 @@
</div> </div>
</group> </group>
</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> </sheet>
<div class="oe_chatter"> <div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/> <field name="message_follower_ids" widget="mail_followers"/>
......
...@@ -6,7 +6,7 @@ setuptools.setup( ...@@ -6,7 +6,7 @@ setuptools.setup(
"depends_override": { "depends_override": {
"account_lock_date_update": "odoo14-addon-account-lock-date-update==14.0.2.0.1.dev10", "account_lock_date_update": "odoo14-addon-account-lock-date-update==14.0.2.0.1.dev10",
"account_reconciliation_widget": "odoo14-addon-account-reconciliation-widget==14.0.2.0.2", "account_reconciliation_widget": "odoo14-addon-account-reconciliation-widget==14.0.2.0.2",
"community_maps": "odoo14-addon-community-maps==14.0.0.1.11", "community_maps": "odoo14-addon-community-maps==14.0.0.1.13",
"cooperator_account_payment": "odoo14-addon-cooperator-account-payment==14.0.1.0.2", "cooperator_account_payment": "odoo14-addon-cooperator-account-payment==14.0.1.0.2",
"cooperator_account_banking_mandate": "odoo14-addon-cooperator-account-banking-mandate==14.0.1.0.5", "cooperator_account_banking_mandate": "odoo14-addon-cooperator-account-banking-mandate==14.0.1.0.5",
"crm_metadata": "odoo14-addon-crm-metadata==14.0.1.0.0", "crm_metadata": "odoo14-addon-crm-metadata==14.0.1.0.0",
......
...@@ -4,7 +4,7 @@ setuptools.setup( ...@@ -4,7 +4,7 @@ setuptools.setup(
setup_requires=['setuptools-odoo'], setup_requires=['setuptools-odoo'],
odoo_addon={ odoo_addon={
"depends_override": { "depends_override": {
"energy_project": "odoo14-addon-energy-project==14.0.1.1.1", "energy_project": "odoo14-addon-energy-project==14.0.1.1.2",
} }
} }
) )
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