Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • coopdevs/comunitats-energetiques/odoo-ce
1 result
Show changes
Commits on Source (30)
Showing
with 1142 additions and 607 deletions
......@@ -52,33 +52,34 @@
"demo/subscription_request_demo.xml",
"demo/energy_selfconsumption_demo.xml",
],
"data": [
"security/ir_rule_data.xml",
"security/res_users_role_data.xml",
"security/ir.model.access.csv",
"data/utm_data.xml",
"data/crm_lead_tag.xml",
"data/product_data.xml",
"data/auth_oauth_provider_data.xml",
"data/ir_cron.xml",
"views/crm_lead_views.xml",
"views/landing_page_view.xml",
"views/res_company_views.xml",
"views/res_config_settings.xml",
"views/res_partner_views.xml",
"views/website_subscription_template.xml",
"views/ce_views.xml",
"views/utm_views.xml",
"views/auth_oauth_views.xml",
"views/view_users_form.xml",
"views/subscription_request_view.xml",
"views/res_users_view.xml",
"views/res_users_role_view.xml",
"views/menus.xml",
"data/mail_template_data.xml",
"data/mail_template_update_data.xml",
"wizards/assign_crm_to_coordinator_company.xml",
"wizards/multicompany_easy_creation.xml",
'data': [
'security/ir_rule_data.xml',
'security/res_users_role_data.xml',
'security/ir.model.access.csv',
'data/utm_data.xml',
'data/crm_lead_tag.xml',
'data/product_data.xml',
'data/auth_oauth_provider_data.xml',
'data/ir_cron.xml',
'views/crm_lead_views.xml',
'views/landing_page_view.xml',
'views/res_company_views.xml',
'views/res_config_settings.xml',
'views/res_partner_views.xml',
'views/website_subscription_template.xml',
'views/ce_views.xml',
'views/utm_views.xml',
'views/auth_oauth_views.xml',
'views/view_users_form.xml',
'views/subscription_request_view.xml',
'views/res_users_view.xml',
'views/res_users_role_view.xml',
'views/menus.xml',
'data/mail_template_data.xml',
'data/mail_template_update_data.xml',
'wizards/assign_crm_to_coordinator_company.xml',
'wizards/multicompany_easy_creation.xml',
'wizards/assign_admin_wizard.xml',
],
"installable": True,
"application": True,
......
......@@ -6,55 +6,16 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-23 11:48+0000\n"
"PO-Revision-Date: 2023-08-23 14:00+0200\n"
"Last-Translator: Daniil Digtyar Vasilieva <daniil.digtyar@somit.coop>\n"
"POT-Creation-Date: 2023-07-05 06:28+0000\n"
"PO-Revision-Date: 2023-07-05 08:46+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ca_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"
#. module: energy_communities
#: model:mail.template,body_html:energy_communities.email_templ_lead_assigned_to_coordinator_id
msgid ""
"\n"
" \n"
" <div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
"\n"
" <p>Hello,</p>\n"
"\n"
" <p>There is a new Energy Community registration request.</p>\n"
"\n"
" <p>Go to Odoo to track this registration.</p>\n"
"\n"
" <p>Yours faithfully,</p>\n"
" <p>Somcomunitats.coop team </p>\n"
" <p><a href=\"https://web-test.somcomunitats.coop/recursos/\">Resources and FAQs</a></p>\n"
"\n"
" </div>\n"
" \n"
" "
msgstr ""
"\n"
" \n"
" <div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
"\n"
" <p>Hola,</p>\n"
"\n"
" <p>Hi ha una nova sol·licitud d’alta de Comunitat Energètica.</p>\n"
"\n"
" <p>Vés al Odoo a fer seguiment d’aquesta alta.</p>\n"
"\n"
" <p>Atentament,</p>\n"
" <p>Equip de somcomunitats.coop</p>\n"
" <p><a href=\"https://web-test.somcomunitats.coop/recursos/\">Recursos i preguntes freqüents</a></p>\n"
"\n"
" </div>\n"
" \n"
" "
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.3.2\n"
#. module: energy_communities
#: model:ir.model.fields,help:energy_communities.field_subscription_request__vat
......@@ -854,7 +815,7 @@ msgstr "Plantilla de gràfic de comptes"
#: code:addons/energy_communities/controllers/website_subscription_voluntary_share.py:0
#, python-format
msgid "Address not found"
msgstr "Adreça no trobada"
msgstr "Adreça no encontrada"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__is_admin_provider
......@@ -916,7 +877,20 @@ msgstr "Empresa assignada"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.ce_crm_lead_view_form
msgid "Assing CRM to coordinator company"
msgstr "Afegir CRM a l'empresa coordinadora"
msgstr "Assignar CRM a empresa coordinadora"
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Assign Admin Wizard"
msgstr "Assistent per assignar una administradora"
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_assign_admin_wizard
msgid "Assign admin Wizard"
msgstr "Assistent per assignar una administradora"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_company_form_ce_inherited
msgid "Assing administrator"
msgstr "Assignar administradora"
#. module: energy_communities
#: code:addons/energy_communities/services/ce_community_service.py:0
......@@ -993,11 +967,9 @@ msgid "CRM Tag"
msgstr "Etiqueta CRM"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_crm_to_coordinator_wizard_form
msgid "Cancel"
msgstr ""
"Cancel\n"
"·lar"
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Cancelar"
msgstr "Cancel·lar"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__chart_template_id
......@@ -1056,6 +1028,13 @@ msgstr "Comunitat"
msgid "Community active services"
msgstr "Serveis actius a la Comunitat"
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#: model:ir.model.fields,field_description:energy_communities.field_res_company__admins
#, python-format
msgid "Community admins"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,help:energy_communities.field_crm_lead__community_company_id
msgid "Community related to this Lead"
......@@ -1087,6 +1066,12 @@ msgstr "Empreses"
msgid "Company"
msgstr "Companyia"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#, python-format
msgid "Company not found"
msgstr "No s'ha trobat la companyia"
#. module: energy_communities
#: model:crm.tag,name:energy_communities.ce_tag_collective_purchases
msgid "Compres col·lectives"
......@@ -1174,9 +1159,16 @@ msgstr "Compte sòcies"
msgid "Cooperator Journal"
msgstr "Diari Sòcies"
#. module: energy_communities
#: model:res.groups,name:energy_communities.role_coordination_res_groups
#: model:res.users.role,name:energy_communities.role_coordination
msgid "Coordination role"
msgstr "Rol de coordinadora"
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#: model:ir.model.fields.selection,name:energy_communities.selection__res_company__hierarchy_level__coordinator
#: model:res.groups,name:energy_communities.group_coordinator
#, python-format
msgid "Coordinator"
msgstr "Coordinadora"
......@@ -1219,13 +1211,13 @@ msgid "Create user for keycloak"
msgstr "Crear usuari de keyCloak/SSO desde la sòcia"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard__create_uid
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__create_uid
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__create_uid
msgid "Created by"
msgstr "Creat per"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard__create_date
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__create_date
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__create_date
msgid "Created on"
msgstr "Creat el"
......@@ -1244,7 +1236,7 @@ msgstr "DNI"
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template__display_name
#: model:ir.model.fields,field_description:energy_communities.field_account_move__display_name
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__display_name
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard__display_name
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__display_name
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__display_name
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__display_name
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag__display_name
......@@ -1290,7 +1282,10 @@ msgid "Eficiencia energètica"
msgstr "Eficiència Energètica"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__email
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share
#, python-format
msgid "Email"
msgstr "Correu electrònic"
......@@ -1353,6 +1348,24 @@ msgstr "Serveis Comunitat Energètica"
msgid "Energy actions in progress"
msgstr "Accions energètiques en curs"
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: One role line can't have multiple users"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: This user have multiple roles for this company"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: You can't remove {} role"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__external_website_link
msgid "External website link"
......@@ -1363,6 +1376,13 @@ msgstr "Enllaç al lloc web extern"
msgid "FREQUENTLY ASKED QUESTIONS"
msgstr "PREGUNTES FREQÜENTS"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__first_name
#, python-format
msgid "First name"
msgstr "Nom"
#. module: energy_communities
#: model:crm.tag,name:energy_communities.ce_tag_citizen_education
msgid "Formació ciutadana"
......@@ -1434,7 +1454,7 @@ msgstr "Prefereixo no compartir-ho"
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template__id
#: model:ir.model.fields,field_description:energy_communities.field_account_move__id
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__id
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard__id
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__id
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__id
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__id
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag__id
......@@ -1527,7 +1547,14 @@ msgstr "Instància"
#: model:res.groups,name:energy_communities.role_internal_user_res_groups
#: model:res.users.role,name:energy_communities.role_internal_user
msgid "Internal User"
msgstr "Usuari intern"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__is_new_admin
#, python-format
msgid "Is a new admin?"
msgstr "És un administrador nou a la plataforma?"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_subscription_request__is_voluntary
......@@ -1537,7 +1564,7 @@ msgstr "És una aportació voluntària"
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_account_move
msgid "Journal Entry"
msgstr "Assentament comptable"
msgstr "Assentament"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__is_keycloak_provider
......@@ -1557,7 +1584,10 @@ msgid "Landing Page"
msgstr "Pàgina de destinació"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__lang
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__lang
#, python-format
msgid "Language"
msgstr "Idioma"
......@@ -1565,7 +1595,7 @@ msgstr "Idioma"
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template____last_update
#: model:ir.model.fields,field_description:energy_communities.field_account_move____last_update
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz____last_update
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard____last_update
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard____last_update
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider____last_update
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead____last_update
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag____last_update
......@@ -1583,17 +1613,24 @@ msgid "Last Modified on"
msgstr "Última modificació el "
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard__write_uid
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__write_uid
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__write_uid
msgid "Last Updated by"
msgstr "Última actualització per"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard__write_date
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__write_date
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__write_date
msgid "Last Updated on"
msgstr "Última actualització el"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__last_name
#, python-format
msgid "Last name"
msgstr "Cognom"
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_crm_lead
msgid "Lead/Opportunity"
......@@ -1817,6 +1854,11 @@ msgstr "Codi Postal"
msgid "Primary Image"
msgstr "Imatge primària"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Procesar"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__product_share_template
msgid "Product Share Template"
......@@ -1857,6 +1899,11 @@ msgstr "Enviar usuari al KeyCloak"
msgid "Realm name"
msgstr "Nom REALM"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__redirect_admin_url
msgid "Redirect Link after update password"
msgstr "Enllaç de redirecció un cop actualitzada la contrasenya"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__community_company_id
msgid "Related Community"
......@@ -1867,6 +1914,11 @@ msgstr "Comunitat relacionada"
msgid "Requests"
msgstr "Sol·licituds"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__reset_password_endpoint
msgid "Reset password URL"
msgstr "URL per escriure la contasenya"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__root_endpoint
msgid "Root URL"
......@@ -1909,6 +1961,12 @@ msgstr "Descripció breu"
msgid "Some mandatory fields have not been filled."
msgstr "Alguns camps obligatoris no s'han omplert."
#. module: energy_communities
#: code:addons/energy_communities/models/res_users.py:0
#, python-format
msgid "Something went wrong. Mail can not be sended. More details: {}"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_users.py:0
#, python-format
......@@ -2250,7 +2308,10 @@ msgstr ""
"KeyCloak"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__vat
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share
#, python-format
msgid "VAT"
msgstr "NIF"
......
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-18 08:54+0000\n"
"PO-Revision-Date: 2023-08-18 08:54+0000\n"
"POT-Creation-Date: 2023-07-05 06:48+0000\n"
"PO-Revision-Date: 2023-07-05 06:48+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
......@@ -453,7 +453,33 @@ msgid "Assign CRM to coordinator company"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/services/ce_community_service.py:0
#: model:ir.model,name:energy_communities.model_assign_crm_to_coordinator_company_wizard
msgid "Assign CRM to coordinator company wizard"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_crm_to_coordinator_company_wizard__assigned_company_id
msgid "Assigned company"
msgstr ""
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.ce_crm_lead_view_form
msgid "Assing CRM to coordinator company"
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Assign Admin Wizard"
msgstr ""
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_assign_admin_wizard
msgid "Assign admin Wizard"
msgstr ""
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_company_form_ce_inherited
msgid "Assing administrator"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/services/ce_community_service.py:0
#: code:addons/energy_communities/services/ce_member_profile_service.py:0
#: code:addons/energy_communities/services/ce_member_profile_service.py:0
......@@ -535,6 +561,11 @@ msgstr ""
msgid "CRM Tag"
msgstr ""
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Cancelar"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__chart_template_id
msgid "Chart Template"
......@@ -600,6 +631,13 @@ msgstr ""
msgid "Community active services"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#: model:ir.model.fields,field_description:energy_communities.field_res_company__admins
#, python-format
msgid "Community admins"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,help:energy_communities.field_crm_lead__community_company_id
msgid "Community related to this Lead"
......@@ -631,6 +669,12 @@ msgstr ""
msgid "Company"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#, python-format
msgid "Company not found"
msgstr ""
#. module: energy_communities
#: model:crm.tag,name:energy_communities.ce_tag_collective_purchases
msgid "Compres col·lectives"
......@@ -719,11 +763,18 @@ msgstr ""
msgid "Cooperator Journal"
msgstr ""
#. module: energy_communities
#: model:res.groups,name:energy_communities.role_coordination_res_groups
#: model:res.users.role,name:energy_communities.role_coordination
msgid "Coordination role"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#: code:addons/energy_communities/models/res_company.py:0
#: code:addons/setup/energy_communities/odoo/addons/energy_communities/models/res_company.py:0
#: model:ir.model.fields.selection,name:energy_communities.selection__res_company__hierarchy_level__coordinator
#: model:res.groups,name:energy_communities.group_coordinator
#, python-format
msgid "Coordinator"
msgstr ""
......@@ -766,11 +817,13 @@ msgid "Create user for keycloak"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__create_uid
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__create_uid
msgid "Created by"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__create_date
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__create_date
msgid "Created on"
msgstr ""
......@@ -784,6 +837,7 @@ msgstr ""
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template__display_name
#: model:ir.model.fields,field_description:energy_communities.field_account_move__display_name
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__display_name
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__display_name
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__display_name
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__display_name
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag__display_name
......@@ -831,7 +885,10 @@ msgid "Eficiencia energètica"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__email
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share
#, python-format
msgid "Email"
msgstr ""
......@@ -900,6 +957,24 @@ msgstr ""
msgid "Energy actions in progress"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: One role line can't have multiple users"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: This user have multiple roles for this company"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: You can't remove {} role"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__external_website_link
msgid "External website link"
......@@ -910,6 +985,13 @@ msgstr ""
msgid "FREQUENTLY ASKED QUESTIONS"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__first_name
#, python-format
msgid "First name"
msgstr ""
#. module: energy_communities
#: model:crm.tag,name:energy_communities.ce_tag_citizen_education
msgid "Formació ciutadana"
......@@ -979,6 +1061,7 @@ msgstr ""
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template__id
#: model:ir.model.fields,field_description:energy_communities.field_account_move__id
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__id
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__id
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__id
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__id
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag__id
......@@ -1077,6 +1160,13 @@ msgstr ""
msgid "Internal User"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__is_new_admin
#, python-format
msgid "Is a new admin?"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_subscription_request__is_voluntary
msgid "Is voluntary contribution"
......@@ -1107,7 +1197,10 @@ msgid "Landing Page"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__lang
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__lang
#, python-format
msgid "Language"
msgstr ""
......@@ -1115,6 +1208,7 @@ msgstr ""
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template____last_update
#: model:ir.model.fields,field_description:energy_communities.field_account_move____last_update
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz____last_update
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard____last_update
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider____last_update
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead____last_update
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag____last_update
......@@ -1132,15 +1226,24 @@ msgid "Last Modified on"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__write_uid
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__write_uid
msgid "Last Updated by"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__write_date
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__write_date
msgid "Last Updated on"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__last_name
#, python-format
msgid "Last name"
msgstr ""
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_crm_lead
msgid "Lead/Opportunity"
......@@ -1398,8 +1501,8 @@ msgid "Postal code"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__primary_image_file
msgid "Primary Image"
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Procesar"
msgstr ""
#. module: energy_communities
......@@ -1448,6 +1551,11 @@ msgstr ""
msgid "Realm name"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__redirect_admin_url
msgid "Redirect Link after update password"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__community_company_id
msgid "Related Community"
......@@ -1458,6 +1566,11 @@ msgstr ""
msgid "Requests"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__reset_password_endpoint
msgid "Reset password URL"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__root_endpoint
msgid "Root URL"
......@@ -1509,6 +1622,12 @@ msgstr ""
#: code:addons/energy_communities/models/res_users.py:0
#: code:addons/setup/energy_communities/odoo/addons/energy_communities/models/res_users.py:0
#, python-format
msgid "Something went wrong. Mail can not be sended. More details: {}"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_users.py:0
#, python-format
msgid "Something went wrong. Please check logs."
msgstr ""
......@@ -1857,7 +1976,10 @@ msgid "Users created by cooperator are pushed automatically to keycloak"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__vat
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share
#, python-format
msgid "VAT"
msgstr ""
......
......@@ -6,55 +6,16 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-30 20:04+0000\n"
"PO-Revision-Date: 2023-05-30 22:44+0200\n"
"POT-Creation-Date: 2023-07-05 07:12+0000\n"
"PO-Revision-Date: 2023-07-07 08:53+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Take .POT and make magic\n"
#. module: energy_communities
#: model:mail.template,body_html:energy_communities.email_templ_lead_assigned_to_coordinator_id
msgid ""
"\n"
" \n"
" <div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
"\n"
" <p>Hello,</p>\n"
"\n"
" <p>There is a new Energy Community registration request.</p>\n"
"\n"
" <p>Go to Odoo to track this registration.</p>\n"
"\n"
" <p>Yours faithfully,</p>\n"
" <p>Somcomunitats.coop team </p>\n"
" <p><a href=\"https://web-test.somcomunitats.coop/recursos/\">Resources and FAQs</a></p>\n"
"\n"
" </div>\n"
" \n"
" "
msgstr ""
"\n"
" \n"
" <div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
"\n"
" <p>Hola,</p>\n"
"\n"
" <p>Hay una nueva solicitud de alta de Comunidad Energética.</p>\n"
"\n"
" <p>Ve a Odoo a hacer seguimiento de esta alta.</p>\n"
"\n"
" <p>Atentamente,</p>\n"
" <p>Equipo de Somcomunitats.coop</p>\n"
" <p><a href=\"https://web-test.somcomunitats.coop/recursos/\">Recursos y preguntas frecuentes</a></p>\n"
"\n"
" </div>\n"
" \n"
" "
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.3.2\n"
#. module: energy_communities
#: model:ir.model.fields,help:energy_communities.field_subscription_request__vat
......@@ -780,6 +741,19 @@ msgstr "Compañía asignada"
#: model_terms:ir.ui.view,arch_db:energy_communities.ce_crm_lead_view_form
msgid "Assing CRM to coordinator company"
msgstr "Asignar CRM a compañía coordinadora"
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Assign Admin Wizard"
msgstr "Asistente de creación de administradoras"
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_assign_admin_wizard
msgid "Assign admin Wizard"
msgstr "Asistente de creación de administradoras"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_company_form_ce_inherited
msgid "Assing administrator"
msgstr "Asignar administradora"
#. module: energy_communities
#: code:addons/energy_communities/services/ce_community_service.py:0
......@@ -855,6 +829,11 @@ msgstr "Iniciativa CRM"
msgid "CRM Tag"
msgstr "Etiqueta CRM"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Cancelar"
msgstr "Cancelar"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__chart_template_id
msgid "Chart Template"
......@@ -898,6 +877,13 @@ msgstr "Comunidad"
msgid "Community active services"
msgstr "Servicios activos en la Comunidad"
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#: model:ir.model.fields,field_description:energy_communities.field_res_company__admins
#, python-format
msgid "Community admins"
msgstr "Administradoras de comunidad"
#. module: energy_communities
#: model:ir.model.fields,help:energy_communities.field_crm_lead__community_company_id
msgid "Community related to this Lead"
......@@ -906,7 +892,7 @@ msgstr "Comunitad relacionada"
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_res_company
msgid "Companies"
msgstr "Empreses"
msgstr "Compañías"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__company_id
......@@ -914,6 +900,12 @@ msgstr "Empreses"
msgid "Company"
msgstr "Compañía"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#, python-format
msgid "Company not found"
msgstr "No se ha encontrado la comunidad"
#. module: energy_communities
#: model:crm.tag,name:energy_communities.ce_tag_collective_purchases
msgid "Compres col·lectives"
......@@ -954,7 +946,7 @@ msgstr ""
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_res_partner
msgid "Contact"
msgstr "Contacte"
msgstr "Contacto"
#. module: energy_communities
#: model:utm.source,name:energy_communities.ce_source_existing_ce_contact
......@@ -992,9 +984,16 @@ msgstr "Cuenta socias"
msgid "Cooperator Journal"
msgstr "Diario Socias"
#. module: energy_communities
#: model:res.groups,name:energy_communities.role_coordination_res_groups
#: model:res.users.role,name:energy_communities.role_coordination
msgid "Coordination role"
msgstr "Rol de coordinadora"
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#: model:ir.model.fields.selection,name:energy_communities.selection__res_company__hierarchy_level__coordinator
#: model:res.groups,name:energy_communities.group_coordinator
#, python-format
msgid "Coordinator"
msgstr "Coordinadora"
......@@ -1025,11 +1024,13 @@ msgid "Create user for keycloak"
msgstr "Crear usuario de KeyCloak/SSO desde la socia"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__create_uid
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__create_uid
msgid "Created by"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__create_date
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__create_date
msgid "Created on"
msgstr ""
......@@ -1043,6 +1044,7 @@ msgstr ""
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template__display_name
#: model:ir.model.fields,field_description:energy_communities.field_account_move__display_name
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__display_name
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__display_name
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__display_name
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__display_name
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag__display_name
......@@ -1088,7 +1090,10 @@ msgid "Eficiencia energètica"
msgstr "Eficiencia Energética"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__email
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share
#, python-format
msgid "Email"
msgstr "Correo electrónico"
......@@ -1145,16 +1150,41 @@ msgstr "Servicios Comunidad Energética"
msgid "Energy actions in progress"
msgstr "Acciones energéticas en curso"
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: One role line can't have multiple users"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: This user have multiple roles for this company"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_company.py:0
#, python-format
msgid "Error: You can't remove {} role"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__external_website_link
msgid "External website link"
msgstr ""
msgstr "Enlace del sitio web"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share_text_template
msgid "FREQUENTLY ASKED QUESTIONS"
msgstr "PREGUNTAS FRECUENTES"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__first_name
#, python-format
msgid "First name"
msgstr "Nombre"
#. module: energy_communities
#: model:crm.tag,name:energy_communities.ce_tag_citizen_education
msgid "Formació ciutadana"
......@@ -1207,7 +1237,9 @@ msgstr "Nivel jerárquico"
#: model_terms:ir.ui.view,arch_db:energy_communities.iban_template_es_ccee
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_shares_template
msgid "I accept that the entity issues direct debit receipts to this account."
msgstr "Confirmo que la persona titular de la cuenta bancaria, sea yo misma u otra persona, autoritza la domiciliación de los recibos."
msgstr ""
"Confirmo que la persona titular de la cuenta bancaria, sea yo misma u otra "
"persona, autoritza la domiciliación de los recibos."
#. module: energy_communities
#: model:ir.model.fields.selection,name:energy_communities.selection__res_partner__gender__not_share
......@@ -1219,6 +1251,7 @@ msgstr "Prefiero no compartirlo"
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template__id
#: model:ir.model.fields,field_description:energy_communities.field_account_move__id
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__id
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__id
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__id
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__id
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag__id
......@@ -1295,6 +1328,19 @@ msgstr "Cuota inicial alta sòcia"
msgid "Instance"
msgstr "Instancia"
#. module: energy_communities
#: model:res.groups,name:energy_communities.role_internal_user_res_groups
#: model:res.users.role,name:energy_communities.role_internal_user
msgid "Internal User"
msgstr "Usuaria de la plataforma"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__is_new_admin
#, python-format
msgid "Is a new admin?"
msgstr "Es una administradora nueva?"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_subscription_request__is_voluntary
msgid "Is voluntary contribution"
......@@ -1323,7 +1369,10 @@ msgid "Landing Page"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__lang
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__lang
#, python-format
msgid "Language"
msgstr "Idioma"
......@@ -1331,6 +1380,7 @@ msgstr "Idioma"
#: model:ir.model.fields,field_description:energy_communities.field_account_chart_template____last_update
#: model:ir.model.fields,field_description:energy_communities.field_account_move____last_update
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz____last_update
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard____last_update
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider____last_update
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead____last_update
#: model:ir.model.fields,field_description:energy_communities.field_crm_tag____last_update
......@@ -1348,15 +1398,24 @@ msgid "Last Modified on"
msgstr "Última modificación el"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__write_uid
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__write_uid
msgid "Last Updated by"
msgstr ""
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__write_date
#: model:ir.model.fields,field_description:energy_communities.field_landing_page__write_date
msgid "Last Updated on"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__last_name
#, python-format
msgid "Last name"
msgstr "Apellido"
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_crm_lead
msgid "Lead/Opportunity"
......@@ -1565,6 +1624,11 @@ msgstr ""
msgid "Postal code"
msgstr ""
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.view_assign_admin_wizard_form
msgid "Procesar"
msgstr "Procesar"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_account_multicompany_easy_creation_wiz__product_share_template
msgid "Product Share Template"
......@@ -1573,7 +1637,7 @@ msgstr "Plantilla de producto aportación"
#. module: energy_communities
#: model:ir.model,name:energy_communities.model_product_template
msgid "Product Template"
msgstr "Plantilla de producte"
msgstr "Plantilla de producto"
#. module: energy_communities
#: code:addons/energy_communities/controllers/website_subscription_main.py:0
......@@ -1605,6 +1669,11 @@ msgstr "Enviar usuario al KeyCloak"
msgid "Realm name"
msgstr "Nombre REALM"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__redirect_admin_url
msgid "Redirect Link after update password"
msgstr "Enlace de redirección después de haber introducido la contraseña"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_crm_lead__community_company_id
msgid "Related Community"
......@@ -1615,6 +1684,11 @@ msgstr "Comunidad relacionada"
msgid "Requests"
msgstr "Solicitudes"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__reset_password_endpoint
msgid "Reset password URL"
msgstr "Enlace de reseteo de contraseña"
#. module: energy_communities
#: model:ir.model.fields,field_description:energy_communities.field_auth_oauth_provider__root_endpoint
msgid "Root URL"
......@@ -1652,6 +1726,12 @@ msgstr ""
msgid "Some mandatory fields have not been filled."
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_users.py:0
#, python-format
msgid "Something went wrong. Mail can not be sended. More details: {}"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/models/res_users.py:0
#, python-format
......@@ -1995,7 +2075,10 @@ msgstr ""
" en KeyCloak"
#. module: energy_communities
#: code:addons/energy_communities/wizards/assign_admin_wizard.py:0
#: model:ir.model.fields,field_description:energy_communities.field_assign_admin_wizard__vat
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share
#, python-format
msgid "VAT"
msgstr "NIF"
......
This diff is collapsed.
......@@ -10,6 +10,7 @@ URL_AUTH = "{root_endpoint}realms/{realm_name}/protocol/openid-connect/auth"
URL_VALIDATION = "{root_endpoint}realms/{realm_name}/protocol/openid-connect/userinfo"
URL_TOKEN = "{root_endpoint}realms/{realm_name}/protocol/openid-connect/token"
URL_JWKS = "{root_endpoint}realms/{realm_name}/protocol/openid-connect/certs"
URL_RESET_PASSWORD = "{root_endpoint}admin/realms/{realm_name}/users/{kc_uid}/execute-actions-email?redirect_uri={odoo_url}&client_id={cliend_id}"
class OAuthProvider(models.Model):
......@@ -17,25 +18,15 @@ class OAuthProvider(models.Model):
is_admin_provider = fields.Boolean(string="Admin provider")
is_keycloak_provider = fields.Boolean(string="Keycloak provider")
superuser = fields.Char(
string="Superuser",
help="A super power user that is able to CRUD users on KC.",
placeholder="admin",
required=False,
)
superuser_pwd = fields.Char(
string="Superuser password",
help='"Superuser" user password',
placeholder='I hope is not "admin"',
required=False,
)
admin_user_endpoint = fields.Char(string="User admin URL", required=True)
root_endpoint = fields.Char(
string="Root URL",
required=True,
default="http://keycloak-ccee.local:8080/auth/",
)
realm_name = fields.Char(string="Realm name", required=True, default="0")
superuser = fields.Char(string='Superuser', help='A super power user that is able to CRUD users on KC.',
placeholder='admin', required=False)
superuser_pwd = fields.Char(string='Superuser password', help='"Superuser" user password',
placeholder='I hope is not "admin"', required=False)
admin_user_endpoint = fields.Char(string='User admin URL')
root_endpoint = fields.Char(string='Root URL', required=True, default='http://keycloak-ccee.local:8080/auth/')
realm_name = fields.Char(string='Realm name', required=True, default='0')
reset_password_endpoint = fields.Char(string='Reset password URL')
redirect_admin_url = fields.Char(string='Redirect Link after update password')
def validate_admin_provider(self):
if not self.client_secret:
......@@ -43,42 +34,30 @@ class OAuthProvider(models.Model):
if not self.superuser_pwd:
raise UserError("Admin provider doesn't have a valid superuser password")
@api.onchange("root_endpoint")
def _onchange_root_endpoint(self):
@api.onchange('root_endpoint', 'realm_name')
def _onchange_update_endpoints(self):
if self.is_keycloak_provider and self.root_endpoint and self.realm_name:
self.admin_user_endpoint = URL_ADMIN_USERS.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.auth_endpoint = URL_AUTH.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.validation_endpoint = URL_VALIDATION.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.token_endpoint = URL_TOKEN.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.jwks_uri = URL_JWKS.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
@api.onchange("realm_name")
def _onchange_realm_name(self):
if self.is_keycloak_provider and self.root_endpoint and self.realm_name:
self.admin_user_endpoint = URL_ADMIN_USERS.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.auth_endpoint = URL_AUTH.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.validation_endpoint = URL_VALIDATION.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.token_endpoint = URL_TOKEN.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
)
self.jwks_uri = URL_JWKS.format(
**{"root_endpoint": self.root_endpoint, "realm_name": self.realm_name}
self.admin_user_endpoint = URL_ADMIN_USERS.format(**{
'root_endpoint': self.root_endpoint, 'realm_name': self.realm_name
})
self.auth_endpoint = URL_AUTH.format(**{
'root_endpoint': self.root_endpoint, 'realm_name': self.realm_name
})
self.validation_endpoint = URL_VALIDATION.format(**{
'root_endpoint': self.root_endpoint, 'realm_name': self.realm_name
})
self.token_endpoint = URL_TOKEN.format(**{
'root_endpoint': self.root_endpoint, 'realm_name': self.realm_name
})
self.jwks_uri = URL_JWKS.format(**{
'root_endpoint': self.root_endpoint, 'realm_name': self.realm_name
})
self.reset_password_endpoint = URL_RESET_PASSWORD.format(
root_endpoint=self.root_endpoint,
realm_name=self.realm_name,
kc_uid='{kc_uid}',
odoo_url=self.redirect_admin_url,
cliend_id=self.client_id,
)
def get_auth_link(self):
......
......@@ -74,6 +74,16 @@ class ResCompany(models.Model):
comodel_name="product.template",
domain=[("is_share", "=", True)],
string="Voluntary share to show on website",
wordpress_base_url = fields.Char(
string=_("Wordpress Base URL (JWT auth)")
)
admins = fields.One2many(
'res.users',
string="Community admins",
compute='_get_admins',
readonly=True,
store=False
)
landing_page_id = fields.Many2one("landing.page", string=_("Landing Page"))
wordpress_db_username = fields.Char(string=_("Wordpress DB Admin Username"))
......@@ -155,6 +165,24 @@ class ResCompany(models.Model):
admins_user_ids.append(role_line.user_id.id)
return any([user in admins_user_ids for user in company_user_ids])
def _get_admin_role_name(self):
if self.hierarchy_level == 'community':
return "role_ce_admin"
elif self.hierarchy_level == 'coordinator':
return "role_coord_admin"
elif self.hierarchy_level == 'instance':
return "role_platform_admin"
def _get_admins(self):
role_name = self._get_admin_role_name()
for rec in self:
role_lines = self.env["res.users.role.line"].search([
("company_id.id", "=", self.id),
("active", "=", True),
("role_id.code", "=", role_name)
])
rec.admins = role_lines.mapped("user_id")
def get_ce_members(self, domain_key="in_kc_and_active"):
domains_dict = {
"in_kc_and_active": [
......@@ -211,6 +239,19 @@ class ResCompany(models.Model):
res.append({"id": tag.id, "name": tag.name, "ext_id": tag.tag_ext_id})
return res
def get_lower_hierarchy_level(self):
if self.hierarchy_level == 'instance':
return 'coordinator'
elif self.hierarchy_level == 'coordinator':
return 'community'
return ''
def get_child_companies(self):
return self.env['res.company'].search([
('hierarchy_level' ,'=', self.get_lower_hierarchy_level()),
('parent_id', '=', self.id),
])
def get_public_web_landing_url(self):
# TODO: Get from landing page or company, for now we don't need
return ""
......
import logging
from odoo.exceptions import ValidationError
from odoo import SUPERUSER_ID, api, fields, models
......@@ -28,6 +29,15 @@ class ResPartner(models.Model):
new_partner = super().create(vals)
return new_partner
# @api.constrains('email') # TODO: Remove!!
# def _check_email(self):
# count_users = self.env['res.partner'].search_count([
# ('email', '=', self.email),
# ('user_ids', '!=', False)
# ])
# if self.email and count_users > 0:
# raise ValidationError(_('The email already registered, please use another email!'))
def cron_update_company_ids_from_user(self):
partner_with_users = self.search(
[("user_ids", "!=", False), ("user_ids.id", "!=", SUPERUSER_ID)]
......
......@@ -60,23 +60,19 @@ class ResUsers(models.Model):
if user.oauth_uid:
# already sync'ed somewhere else
continue
keycloak_user = self._get_or_create_user(token, provider_id, user)
keycloak_key = self._LOGIN_MATCH_KEY.split(":")[0]
keycloak_login_provider = self.env.ref(
"energy_communities.keycloak_login_provider"
)
user.update(
{
"oauth_uid": keycloak_user[keycloak_key],
"oauth_provider_id": keycloak_login_provider.id,
}
)
keycloak_user = self._get_or_create_kc_user(token, provider_id, user)
keycloak_key = self._LOGIN_MATCH_KEY.split(':')[0]
keycloak_login_provider = self.env.ref('energy_communities.keycloak_login_provider')
user.update({
'oauth_uid': keycloak_user[keycloak_key],
'oauth_provider_id': keycloak_login_provider.id,
})
# action = self.env.ref('base.action_res_users').read()[0]
# action['domain'] = [('id', 'in', self.user_ids.ids)]
logger.debug("Create keycloak users STOP")
return True
def _get_users(self, token, provider_id, **params):
def _get_kc_users(self, token, provider_id, **params):
"""Retrieve users from Keycloak.
:param token: a valida auth token from Keycloak
......@@ -120,16 +116,15 @@ class ResUsers(models.Model):
except JSONDecodeError:
raise exceptions.UserError(_("Something went wrong. Please check logs."))
def _get_or_create_user(self, token, provider_id, odoo_user):
def _get_or_create_kc_user(self, token, provider_id, odoo_user):
"""Lookup for given user on Keycloak: create it if missing.
:param token: valid auth token from Keycloak
:param odoo_user: res.users record
"""
odoo_key = self._LOGIN_MATCH_KEY.split(":")[1]
keycloak_user = self._get_users(
token, provider_id, search=odoo_user.mapped(odoo_key)[0]
)
odoo_key = self._LOGIN_MATCH_KEY.split(':')[1]
keycloak_user = self._get_kc_users(
token, provider_id, search=odoo_user.mapped(odoo_key)[0])
if keycloak_user:
if len(keycloak_user) > 1:
# TODO: warn user?
......@@ -137,15 +132,16 @@ class ResUsers(models.Model):
return keycloak_user[0]
else:
values = self._create_user_values(odoo_user)
keycloak_user = self._create_user(token, provider_id, **values)
keycloak_user = self._create_kc_user(token, provider_id, **values)
return keycloak_user
def _create_user_values(self, odoo_user):
"""Prepare Keycloak values for given Odoo user."""
values = {
"username": odoo_user.login,
"email": odoo_user.partner_id.email,
"attributes": {"lang": [odoo_user.lang]},
'username': odoo_user.login,
'email': odoo_user.partner_id.email,
'attributes': {'lang': [odoo_user.lang]},
'enabled': True,
}
if "firstname" in odoo_user.partner_id:
......@@ -175,7 +171,7 @@ class ResUsers(models.Model):
firstname, lastname = name_parts[0], " ".join(name_parts[1:])
return firstname, lastname
def _create_user(self, token, provider_id, **data):
def _create_kc_user(self, token, provider_id, **data):
"""Create a user on Keycloak w/ given data."""
logger.info("CREATE Calling %s" % provider_id.admin_user_endpoint)
headers = {
......@@ -190,8 +186,120 @@ class ResUsers(models.Model):
self._validate_response(resp, no_json=True)
# yes, Keycloak sends back NOTHING on create
# so we are forced to do anothe call to get its data :(
return self._get_users(token, provider_id, search=data["username"])[0]
return self._get_kc_users(token, provider_id, search=data['username'])[0]
def get_role_codes(self):
# TODO Map all code to company and enable (We should update the API schema too)
return self.role_line_ids[0].role_id.code
def send_reset_password_mail(self):
provider_id = self.env.ref('energy_communities.keycloak_admin_provider')
provider_id.validate_admin_provider()
headers = {
'Authorization': 'Bearer %s' % self._get_admin_token(provider_id)
}
headers['Content-Type'] = "application/json"
endpoint = provider_id.reset_password_endpoint.format(
kc_uid = self.oauth_uid
)
response = requests.put(endpoint, headers=headers, data='["UPDATE_PASSWORD", "VERIFY_EMAIL"]')
if response.status_code != 204:
raise exceptions.UserError(
_('Something went wrong. Mail can not be sended. More details: {}').format(response.json())
)
def make_internal_user(self):
already_user = self.env["res.users.role.line"].search([
("user_id.id", "=", self.id),
("active", "=", True),
("role_id.code", "=", "role_internal_user")
])
if not already_user:
role = self.env["res.users.role"].search([(
"code", "=", "role_internal_user"
)])
self.write({'role_line_ids': [(0, 0, {
'user_id': self.id,
'active': True,
'role_id': role.id,
})]})
def make_ce_user(self, company_id, role_name):
role = self.env["res.users.role"].search([(
"code", "=", role_name
)])
current_role = self.env["res.users.role.line"].search([
("user_id", "=", self.id),
("active", "=", True),
("company_id", "=", company_id)
])
if current_role:
current_role.write({"role_id": role})
else:
self.write({
"company_ids": [(4, company_id)],
"role_line_ids": [(0, 0, {
'user_id': self.id,
'active': True,
'role_id': role.id,
'company_id': company_id,
})]
})
def make_coord_user(self, company_id, role_name):
role = self.env["res.users.role"].search([(
"code", "=", role_name
)])
current_role = self.env["res.users.role.line"].search([
("user_id", "=", self.id),
("active", "=", True),
("company_id", "=", company_id)
])
if current_role:
current_role.write({"role_id": role})
else:
self.write({
"company_ids": [(4, company_id)],
"role_line_ids": [(0, 0, {
'user_id': self.id,
'active': True,
'role_id': role.id,
'company_id': company_id,
})]
})
company = self.env["res.company"].browse(company_id)
child_companies = company.get_child_companies()
for child_company in child_companies:
self.make_ce_user(child_company.id, "role_ce_manager")
def add_energy_community_role(self, company_id, role_name):
if role_name == 'role_ce_member' or role_name == 'role_ce_admin':
self.make_ce_user(company_id, role_name)
elif role_name == 'role_coord_worker' or role_name == 'role_coord_admin':
self.make_coord_user(company_id, role_name)
else:
raise exceptions.UserError(
_('Role not found')
)
def create_energy_community_base_user(
cls, vat, first_name, last_name, lang_code, email
):
vals = {
"login": vat,
"firstname": first_name,
"lastname": last_name,
"lang": lang_code,
"email": email,
}
user = cls.create(vals)
user.make_internal_user()
user.create_users_on_keycloak()
user.send_reset_password_mail()
return user
......@@ -3,3 +3,4 @@ landing_page_admin,access_landing_page_admin,model_landing_page,group_admin,1,1,
landing_page_platform_manager,access_landing_page_platform_manager,model_landing_page,group_platform_manager,1,1,1,1
landing_page_public,access_landing_page_public,model_landing_page,base.group_public,1,0,0,0
assign_crm_to_coordinator_company_wizard_admin,assign_crm_to_coordinator_company_wizard_admin,model_assign_crm_to_coordinator_company_wizard,group_platform_manager,1,1,1,1
assign_admin_wizard,assign_admin_wizard_admin,model_assign_admin_wizard,group_admin,1,1,1,1
from . import test_res_company
from . import test_res_users
from . import test_assign_admin_wizard
from faker import Faker
faker = Faker(locale='es_ES')
class CompanySetupMixin(object):
def create_company(self, name, hierarchy_level, parent_id):
return self.company_model.create({
'name': name,
'hierarchy_level': hierarchy_level,
'parent_id': parent_id,
})
class UserSetupMixin(object):
def create_user(self, firstname, lastname, vat=False, email=False):
login = vat if vat else faker.vat_id()
return self.users_model.create({
"login": login.lower(),
"firstname": firstname,
"lastname": lastname,
"email": email if email else faker.email(),
})
def make_community_admin(self, community_admin):
community_admin.write({"company_ids": [(4, self.community.id)]})
self.admin_role = self.env["res.users.role"].search([(
"code", "=", 'role_ce_admin'
)])
self.role_line_model.create({
"user_id": community_admin.id,
"active": True,
"role_id": self.admin_role.id,
"company_id": self.community.id,
})
self.internal_role = self.env["res.users.role"].search([(
"code", "=", "role_internal_user"
)])
self.role_line_model.create({
"user_id": community_admin.id,
"active": True,
"role_id": self.internal_role.id,
})
def make_coord_admin(self, coord_admin):
coord_admin.write({"company_ids": [(4, self.coordination.id)]})
coord_admin.write({"company_ids": [(4, self.community.id)]})
coord_admin_role = self.env["res.users.role"].search([(
"code", "=", 'role_coord_admin'
)])
self.role_line_model.create({
"user_id": coord_admin.id,
"active": True,
"role_id": coord_admin_role.id,
"company_id": self.community.id,
})
self.ce_manager_role = self.env["res.users.role"].search([(
"code", "=", 'role_ce_manager'
)])
self.role_line_model.create({
"user_id": coord_admin.id,
"active": True,
"role_id": self.ce_manager_role.id,
"company_id": self.community.id,
})
self.internal_role = self.env["res.users.role"].search([(
"code", "=", "role_internal_user"
)])
self.role_line_model.create({
"user_id": coord_admin.id,
"active": True,
"role_id": self.internal_role.id,
})
from faker import Faker
from mock import patch
from odoo.tests import common
from odoo.exceptions import ValidationError
from .helpers import UserSetupMixin
faker = Faker(locale='es_ES')
class TestAssingAdminWizard(UserSetupMixin, common.TransactionCase):
def setUp(self):
super().setUp()
self.users_model = self.env['res.users']
self.company_model = self.env['res.company']
self.random_user = self.create_user("Brandom", "Random", '43217763G')
@patch("odoo.addons.energy_communities.models.res_users.ResUsers.add_energy_community_role")
def test__process_data__search_user_case_insensitive(self, add_energy_community_role_mocked):
wizard = self.env['assign.admin.wizard'].create({
'is_new_admin': False,
'vat': '43217763g',
})
wizard.process_data()
add_energy_community_role_mocked.assert_called_once()
def test__process_data__user_not_found(self):
# When we search a new user
wizard = self.env['assign.admin.wizard'].create({
'is_new_admin': False,
'vat': '43217761g',
})
# Raises User not found error
with self.assertRaises(ValidationError):
wizard.process_data()
# Add faker into requirements.txt ?? 🤔
from faker import Faker
from mock import patch
from odoo.tests import common
from odoo.exceptions import UserError, ValidationError
from .helpers import CompanySetupMixin, UserSetupMixin
faker = Faker(locale='es_ES')
class TestResUsers(CompanySetupMixin, UserSetupMixin, common.TransactionCase):
def setUp(self):
super().setUp()
self.users_model = self.env['res.users']
self.company_model = self.env['res.company']
self.role_line_model = self.env["res.users.role.line"]
self.instance = self.company_model.search([
('hierarchy_level', '=', 'instance')
])[0]
self.coordination = self.create_company(
'Coordinator', 'coordinator', self.instance.id,
)
self.community = self.create_company(
'Energy Community', 'community', self.coordination.id,
)
self.platform_admin = self.create_user("Platform", "Admin")
self.community_admin = self.create_user("Community", "Admin")
self.coord_admin = self.create_user("Coord", "Admin")
self.random_user = self.create_user("Brandom", "Random")
self.make_community_admin(self.community_admin)
self.make_coord_admin(self.coord_admin)
@patch("odoo.addons.energy_communities.models.res_users.ResUsers.create_users_on_keycloak")
@patch("odoo.addons.energy_communities.models.res_users.ResUsers.send_reset_password_mail")
def test__create_energy_community_base_user__base_case(
self, reset_password_mocked, create_kc_user_mocked
):
user = self.users_model.create_energy_community_base_user(
vat=faker.vat_id(),
first_name="Tom",
last_name="Bombadil",
lang_code="en_US",
email=faker.email(),
)
# then send_reset_password_mail function was called once time
reset_password_mocked.assert_called_once()
# then create_users_on_keycloak function was called once time
create_kc_user_mocked.assert_called_once()
@patch("odoo.addons.energy_communities.models.res_users.ResUsers.make_ce_user")
def test__add_energy_community_role__make_ce_user(self, make_ce_user_mocked):
self.random_user.add_energy_community_role(self.community.id, 'role_ce_admin')
# then make_ce_user_mocked function was called once time
make_ce_user_mocked.assert_called_with(self.community.id, 'role_ce_admin')
@patch("odoo.addons.energy_communities.models.res_users.ResUsers.make_coord_user")
def test__add_energy_community_role__make_coord_user(self, make_coord_user_mocked):
self.random_user.add_energy_community_role(self.coordination.id, 'role_coord_admin')
# then make_coord_user function was called once time
make_coord_user_mocked.assert_called_with(self.coordination.id, 'role_coord_admin')
def test__add_energy_community_role__role_not_found(self):
with self.assertRaises(UserError):
self.users_model.add_energy_community_role(
role_name="onering_owner",
company_id=self.coordination.id,
)
def test__make_ce_user__already_user(self):
self.community_admin.make_ce_user(self.community.id, "role_ce_member")
rl = self.role_line_model.search([
("user_id", "=", self.community_admin.id),
("company_id", "=", self.community.id),
])
self.assertEqual(len(rl), 1)
self.assertEqual(rl[0].role_id.code, "role_ce_member")
self.assertIn(
self.community,
self.community_admin.company_ids
)
def test__make_ce_user__new_user(self):
self.random_user.make_ce_user(self.community.id, "role_ce_member")
rl = self.role_line_model.search([
("user_id", "=", self.random_user.id),
("role_id.code", "=", "role_ce_member"),
("company_id", "=", self.community.id),
])
self.assertEqual(len(rl), 1)
self.assertIn(
self.community,
self.random_user.company_ids
)
def test__make_internal_user__new_user(self):
# When we call make_internal_user with a new user
self.random_user.make_internal_user()
# Then creates new role_line with "role_internal_user"
role_lines = self.role_line_model.search([
("user_id", "=", self.random_user.id),
("role_id.code", "=", "role_internal_user"),
])
self.assertEqual(len(role_lines), 1)
role_line = role_lines[0]
# and role_line has not company
self.assertEqual(list(role_line.company_id), [])
def test__make_internal_user__already_user(self):
# When we call make_internal_user with existing user
self.community_admin.make_internal_user()
# Then anything is created
rl = self.role_line_model.search([
("user_id", "=", self.community_admin.id),
("role_id.code", "=", "role_internal_user"),
])
self.assertEqual(len(rl), 1)
def test__make_coord_user__new_user(self):
self.random_user.make_coord_user(self.coordination.id, 'role_coord_admin')
rl_coord = self.role_line_model.search([
("user_id", "=", self.random_user.id),
("role_id.code", "=", "role_coord_admin"),
("company_id", "=", self.coordination.id),
])
self.assertEqual(len(rl_coord), 1)
self.assertIn(
self.coordination,
self.random_user.company_ids
)
rl_ce = self.role_line_model.search([
("user_id", "=", self.random_user.id),
("role_id.code", "=", "role_ce_manager"),
("company_id", "=", self.community.id),
])
self.assertEqual(len(rl_ce), 1)
self.assertIn(
self.community,
self.random_user.company_ids
)
def test__make_coord_user__already_user(self):
other_coord = self.create_company(
'Coordinator 2', 'coordinator', self.instance.id,
)
self.coord_admin.make_coord_user(other_coord.id, 'role_coord_admin')
rl_coord = self.role_line_model.search([
("user_id", "=", self.coord_admin.id),
("role_id.code", "=", "role_coord_admin"),
])
self.assertEqual(len(rl_coord), 2)
self.assertIn(self.coordination, self.coord_admin.company_ids)
self.assertIn(other_coord, self.coord_admin.company_ids)
......@@ -6,34 +6,20 @@
<field name="inherit_id" ref="auth_oauth.view_oauth_provider_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='css_class']" position="after">
<field name="is_keycloak_provider" />
<field
name="root_endpoint"
attrs="{'invisible': [('is_keycloak_provider','=',False)]}"
/>
<field
name="realm_name"
attrs="{'invisible': [('is_keycloak_provider','=',False)]}"
/>
<field
name="is_admin_provider"
attrs="{'invisible': [('is_keycloak_provider','=',False)]}"
/>
<field
name="superuser"
attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"
/>
<field
name="superuser_pwd"
attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"
/>
<field
name="admin_user_endpoint"
attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"
/>
<field name="is_keycloak_provider"/>
<field name="root_endpoint" attrs="{'invisible': [('is_keycloak_provider','=',False)]}"/>
<field name="realm_name" attrs="{'invisible': [('is_keycloak_provider','=',False)]}"/>
<field name="is_admin_provider" attrs="{'invisible': [('is_keycloak_provider','=',False)]}"/>
<field name="superuser" attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"/>
<field name="superuser_pwd" attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"/>
<field name="admin_user_endpoint" attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"/>
<field name="redirect_admin_url" attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"/>
<field name="reset_password_endpoint" attrs="{'invisible': ['|', ('is_admin_provider','=',False),
('is_keycloak_provider', '=', False)]}"/>
</xpath>
</field>
</record>
......
......@@ -78,4 +78,12 @@
eval="[('source_id','=', ref('ce_source_creation_ce_proposal'))]"
/>
</record>
<record id="action_open_assign_admin_wizard" model="ir.actions.act_window">
<field name="name">Create User</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">assign.admin.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>
......@@ -38,39 +38,12 @@
/>
<menuitem id="ce_crm_leads_menu" name="Requests" parent="ce_root_menu" />
<menuitem
id="ce_crm_leads_ce_info_menu"
name="EC Information"
parent="ce_crm_leads_menu"
action="ce_crm_leads_ce_info_action"
groups="group_admin"
/>
<menuitem
id="ce_crm_leads_ce_contact_menu"
name="EC Contact"
parent="ce_crm_leads_menu"
action="ce_crm_leads_ce_contact_action"
groups="group_admin"
/>
<menuitem
id="ce_crm_leads_general_info_menu"
name="General Information"
parent="ce_crm_leads_menu"
action="ce_crm_leads_general_info_action"
groups="group_admin"
/>
<menuitem
id="ce_crm_leads_future_zone_info_menu"
name="Information future EC's by location"
parent="ce_crm_leads_menu"
action="ce_crm_leads_future_zone_info_action"
groups="group_platform_manager"
/>
<menuitem
id="ce_crm_leads_new_ce_request_menu"
name="EC Creation"
parent="ce_crm_leads_menu"
action="ce_crm_leads_new_ce_request_action"
groups="group_platform_manager"
/>
<menuitem id="ce_crm_leads_ce_info_menu" name="EC Information" parent="ce_crm_leads_menu" action="ce_crm_leads_ce_info_action" groups="group_admin" />
<menuitem id="ce_crm_leads_ce_contact_menu" name="EC Contact" parent="ce_crm_leads_menu" action="ce_crm_leads_ce_contact_action" groups="group_admin" />
<menuitem id="ce_crm_leads_general_info_menu" name="General Information" parent="ce_crm_leads_menu" action="ce_crm_leads_general_info_action" groups="group_admin" />
<menuitem id="ce_crm_leads_future_zone_info_menu" name="Information future EC's by location" parent="ce_crm_leads_menu" action="ce_crm_leads_future_zone_info_action" groups="group_platform_manager" />
<menuitem id="ce_crm_leads_new_ce_request_menu" name="EC Creation" parent="ce_crm_leads_menu" action="ce_crm_leads_new_ce_request_action" groups="group_platform_manager" />
<menuitem id="ce_users_menu" name="Users" parent="ce_root_menu" />
<menuitem id="ce_create_user_wizard" name="Create user" parent="ce_users_menu" action="action_open_assign_admin_wizard" groups="group_admin" />
</odoo>
......@@ -13,38 +13,30 @@
</xpath>
<xpath expr="//sheet" position="before">
<header>
<field name="landing_page_id" invisible="1" />
<field name="landing_page_id" invisible="1"/>
<button
name="create_landing"
type="object"
string="Create landing page"
attrs="{'invisible': [('landing_page_id','!=',False)]}"
/>
name="create_landing"
type="object"
string="Create landing page"
attrs="{'invisible': [('landing_page_id','!=',False)]}"
/>
</header>
</xpath>
<xpath expr="//field[@name='logo']" position="before">
<div class='oe_button_box'>
<button
name="get_landing_page_form"
type="object"
string="My landing page"
class="oe_stat_button"
icon="fa-globe"
attrs="{'invisible': [('landing_page_id','=',False)]}"
/>
<button name="get_landing_page_form" type="object" string="My landing page" class="oe_stat_button" icon="fa-globe" attrs="{'invisible': [('landing_page_id','=',False)]}" />
</div>
<field name="admins" invisible="True"></field>
</xpath>
<xpath expr="//notebook" position="inside">
<page string="Energy Communities">
<group>
<field name="hierarchy_level" />
<field name="parent_id_filtered_ids" invisible="True" />
<field
name="parent_id"
domain="[('id', 'in', parent_id_filtered_ids)]"
/>
<field name="voluntary_share_id" />
<field name="ce_tag_ids" />
<field name="hierarchy_level"></field>
<field name="parent_id_filtered_ids" invisible="True"></field>
<field name="parent_id" domain="[('id', 'in', parent_id_filtered_ids)]"></field>
<field name="voluntary_share_id"></field>
<field name="ce_tag_ids"/>
<field name="admins"/>
</group>
</page>
</xpath>
......
from . import assign_crm_to_coordinator_company
from . import multicompany_easy_creation
from . import assign_admin_wizard
\ No newline at end of file
import re
from odoo import models, fields, api
from odoo.tools.translate import _
from odoo.exceptions import ValidationError
class AssignAdminWizard(models.TransientModel):
_name = 'assign.admin.wizard'
_description = 'Assign admin Wizard'
is_new_admin = fields.Boolean(string="Is a new admin?")
first_name = fields.Char(string="First name")
last_name = fields.Char(string="Last name")
vat = fields.Char(string="VAT")
email = fields.Char(string="Email")
lang = fields.Many2one('res.lang', string="Language")
role = fields.Selection(selection='_get_available_roles', string="Role")
@api.model
def _get_available_roles(self):
company = self.env['res.company'].browse(self.env.company.id)
if company.hierarchy_level == 'community':
return [
('role_ce_admin', _("Energy Community Administrator")),
('role_ce_member', _("Energy Community Member")),
]
elif company.hierarchy_level == 'coordinator':
return [
('role_coord_admin', _("Coordinator Admin")),
('role_coord_worker', _("Coordinator Worker"))
]
return []
def process_data(self):
vat = re.sub(r"[^a-zA-Z0-9]", "", self.vat).lower()
if self.is_new_admin:
user = self.env['res.users'].create_energy_community_base_user(
vat=vat,
first_name=self.first_name,
last_name=self.last_name,
lang_code=self.lang.code,
email=self.email,
)
else:
user = self.env['res.users'].search([
('login', 'ilike', vat)
], limit=1)
if not user:
raise ValidationError(_('User not found'))
company_id = self.env.company.id
user.add_energy_community_role(company_id, self.role)
return True