diff --git a/som_gurb/demo/som_gurb_demo.xml b/som_gurb/demo/som_gurb_demo.xml
index e3ddc1d44..3fab9570f 100644
--- a/som_gurb/demo/som_gurb_demo.xml
+++ b/som_gurb/demo/som_gurb_demo.xml
@@ -11,5 +11,8 @@
10
+
+ 30
+
diff --git a/som_gurb/i18n/es_ES.po b/som_gurb/i18n/es_ES.po
index fb30db2c3..a3fe5a6d5 100644
--- a/som_gurb/i18n/es_ES.po
+++ b/som_gurb/i18n/es_ES.po
@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Som Energia\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2024-06-18 11:30+0000\n"
-"PO-Revision-Date: 2024-06-18 09:36+0000\n"
+"POT-Creation-Date: 2024-07-24 15:51+0000\n"
+"PO-Revision-Date: 2024-07-24 13:59+0000\n"
"Last-Translator: Som Energia \n"
"Language-Team: Spanish (Spain) (http://trad.gisce.net/projects/p/somenergia/language/es_ES/)\n"
"MIME-Version: 1.0\n"
@@ -45,6 +45,25 @@ msgstr "Generación urbana"
msgid "Data fi"
msgstr "Fecha fin"
+#. module: som_gurb
+#: model:poweremail.templates,def_body_text:som_gurb.email_gurb_activation
+#: model:poweremail.templates,def_body_text:som_gurb.email_gurb_in_progress
+#: model:poweremail.templates,def_body_text:som_gurb.email_gurb_welcome
+#: model:poweremail.templates,def_body_text:som_gurb.email_signature_process_gurb
+#: model:poweremail.templates,def_body_text:som_gurb.email_signature_process_gurb_lead
+msgid ""
+"\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Email text\n"
+" \n"
+" \n"
+" \n"
+" "
+msgstr "\n \n \n \n \n Email text\n \n \n \n "
+
#. module: som_gurb
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
@@ -70,6 +89,11 @@ msgstr "Documento"
msgid "Nom"
msgstr "Nombre"
+#. module: som_gurb
+#: field:som.gurb.cups,owner_cups:0
+msgid "Persona propietària"
+msgstr "Persona propietaria"
+
#. module: som_gurb
#: view:som.gurb:0
msgid "Activar"
@@ -116,6 +140,11 @@ msgstr "Ya existe un servicio con esa lista de precios."
msgid "Betes assignades + extres"
msgstr "Betas asignadas + extras"
+#. module: som_gurb
+#: model:ir.model,name:som_gurb.model_wizard_create_gurb_cups_signature
+msgid "Wizard per crear la Signatura d'un Gurb Cups"
+msgstr "Wizard para crear la Signatura de un Gurb Cups"
+
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_report_backend_som_gurb_documents
msgid "report.backend.som.gurb.documents"
@@ -146,6 +175,13 @@ msgstr "Reobertura"
msgid "Es crearan {} factures d'inscripció."
msgstr "Se crearán {} facturas de inscripción."
+#. module: som_gurb
+#: model:poweremail.templates,def_subject:som_gurb.email_gurb_activation
+#: model:poweremail.templates,def_subject:som_gurb.email_gurb_in_progress
+#: model:poweremail.templates,def_subject:som_gurb.email_gurb_welcome
+msgid "TODO"
+msgstr "TODO"
+
#. module: som_gurb
#: selection:som.gurb,state:0
msgid "Grup registrat"
@@ -182,6 +218,12 @@ msgstr "Error ! You can not create recursive categories."
msgid "Cas cancel·lat per GURB"
msgstr "Caso cancelado por GURB"
+#. module: som_gurb
+#: model:poweremail.templates,def_subject:som_gurb.email_signature_process_gurb
+#: model:poweremail.templates,def_subject:som_gurb.email_signature_process_gurb_lead
+msgid "CORREU DEMANANT LA SIGNATURA I PAGAMENT COST ADHESIÓ GURB"
+msgstr "CORREO PIDIENDO LA FIRMA Y PAGO COSTE ADHESIÓN GURB"
+
#. module: som_gurb
#: field:som.gurb.cups,initial_invoice_id:0
msgid "Factura"
@@ -207,11 +249,6 @@ msgstr "Error! No puedes crear categorías recursivas."
msgid "Per poder obrir el GURB s'ha d'omplir el camp: {}"
msgstr "Para poder abrir el GURB se debe rellenar el campo: {}"
-#. module: som_gurb
-#: view:som.gurb:0
-msgid "Vols tornar a la primera obertura?"
-msgstr "¿Quieres volver a la primera apertura?"
-
#. module: som_gurb
#: selection:wizard.gurb.create.initial.invoice,state:0
msgid "End"
@@ -227,6 +264,11 @@ msgstr "Días reapertura"
msgid "Betes extres (kW)"
msgstr "Betas extras (kW)"
+#. module: som_gurb
+#: model:ir.actions.act_window,name:som_gurb.action_wizard_sign_gurb_cups_documents_form
+msgid "Signar GURB documents"
+msgstr "Firmar GURB documentos"
+
#. module: som_gurb
#: model:product.template,name:som_gurb.initial_quota_gurb_product_template
msgid "Quota inicial del GURB"
@@ -253,26 +295,41 @@ msgstr "CUPS"
msgid "CUPS GURB"
msgstr "CUPS GURB"
+#. module: som_gurb
+#: field:wizard.create.gurb.cups.signature,email:0
+msgid "Email"
+msgstr "Email"
+
#. module: som_gurb
#: selection:som.gurb,state:0
msgid "Complet"
msgstr "Completo"
#. module: som_gurb
-#: code:addons/som_gurb/models/som_gurb_cups.py:152
-msgid "El CUPS id {} no té pòlisses actives. No es pot afegir cap servei"
-msgstr "El CUPS id {} no tiene pólizas activas. No se puede añadir ningún servicio"
+#: field:som.gurb,quota_product_id:0
+msgid "Produce quota mensual"
+msgstr "Producto cuota mensual"
#. module: som_gurb
#: code:addons/som_gurb/wizard/wizard_gurb_create_new_beta.py:53
msgid "El total de la beta i la beta extra ha de ser més gran a zero."
msgstr "El total de la beta y beta extra debe ser mayor a cero."
+#. module: som_gurb
+#: model:ir.actions.report.xml,name:som_gurb.action_report_som_gurb_conditions
+msgid "Generar condicions GURB"
+msgstr "Generar condiciones GURB"
+
#. module: som_gurb
#: code:addons/som_gurb/models/giscedata_switching.py:85
msgid "Cas importat correctament."
msgstr "Caso importado correctamente."
+#. module: som_gurb
+#: code:addons/som_gurb/models/som_gurb_cups.py:180
+msgid "No hi ha pòlisses actives o en esborrany per aquest CUPS"
+msgstr "No hay pólizas activas o en borrador para este CUPS"
+
#. module: som_gurb
#: view:wizard.gurb.create.initial.invoice:0
msgid "Creació factures inscripció"
@@ -318,11 +375,21 @@ msgstr "Betas asignadas"
msgid "Invalid XML for View Architecture!"
msgstr "Invalid XML for View Architecture!"
+#. module: som_gurb
+#: view:wizard.create.gurb.cups.signature:0
+msgid "Firmar els documents d'aquest GURB CUPS"
+msgstr "Firmar los documentos de este GURB CUPS"
+
#. module: som_gurb
#: constraint:product.template:0
msgid "Error: UOS must be in a different category than the UOM"
msgstr "Error: UOS must be in a different category than the UOM"
+#. module: som_gurb
+#: field:som.gurb.cups,polissa_id:0
+msgid "Pòlissa"
+msgstr "Póliza"
+
#. module: som_gurb
#: field:som.gurb.cups.beta,start_date:0
#: field:wizard.gurb.create.new.beta,start_date:0
@@ -350,6 +417,11 @@ msgstr "No se puede realizar un cambio de beta a futuro."
msgid "Beta incorrecte!"
msgstr "Beta incorrecta!"
+#. module: som_gurb
+#: field:som.gurb.cups,signed:0
+msgid "Signed"
+msgstr "Signed"
+
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_wizard_gurb_create_initial_invoice
msgid "wizard.gurb.create.initial.invoice"
@@ -387,7 +459,7 @@ msgstr "Activo no completo crítico"
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_som_gurb_cups_beta
-#: code:addons/som_gurb/models/som_gurb_cups.py:371
+#: code:addons/som_gurb/models/som_gurb_cups.py:481
msgid "Log of betas and changes for som.gurb.cups"
msgstr "Log of betas and changes for som.gurb.cups"
@@ -423,9 +495,9 @@ msgid "No s'han seleccionat IDs"
msgstr "No se han seleccionado IDs"
#. module: som_gurb
-#: field:som.gurb.cups,owner_cups:0
-msgid "Cups de la persona propietària"
-msgstr "Cups de la persona propietaria"
+#: view:som.gurb.cups:0
+msgid "Relacions"
+msgstr "Relaciones"
#. module: som_gurb
#: constraint:product.template:0
@@ -455,9 +527,9 @@ msgid "Betes assignades (kW)"
msgstr "Betas asignadas (kW)"
#. module: som_gurb
-#: code:addons/som_gurb/models/som_gurb_cups.py:150
-msgid "No hi ha pòlisses actives per aquest CUPS"
-msgstr "No hay pólizas activas para este CUPS"
+#: view:som.gurb:0
+msgid "Vols tornar a la primera obertura?"
+msgstr "¿Quieres volver a la primera apertura?"
#. module: som_gurb
#: field:som.gurb.cups,beta_percentage:0
@@ -490,6 +562,11 @@ msgstr "Potencia generación"
msgid "Reobrir"
msgstr "Reabrir"
+#. module: som_gurb
+#: field:som.gurb.cups,polissa_state:0
+msgid "Estat pòlissa"
+msgstr "Estado póliza"
+
#. module: som_gurb
#: model:giscedata.polissa.category,name:som_gurb.categ_gurb_pilot
msgid "GURB Pilot"
@@ -510,6 +587,12 @@ msgstr "Cerrar primera apertura"
msgid "Crear factures"
msgstr "Crear facturas"
+#. module: som_gurb
+#: code:addons/som_gurb/models/som_gurb_cups.py:523
+msgid ""
+"The combination of name and gurb_cups_id must be unique for this register!"
+msgstr "The combination of name and gurb_cups_id must be unique for this register!"
+
#. module: som_gurb
#: model:ir.actions.act_window,name:som_gurb.action_som_gurb_cups_tree
msgid "Tots els CUPS del GURB"
@@ -541,9 +624,9 @@ msgid "Actiu no complet"
msgstr "Activo no completo"
#. module: som_gurb
-#: model:product.template,name:som_gurb.product_gurb_product_template
-msgid "Producte GURB"
-msgstr "Producto GURB"
+#: field:som.gurb.cups,partner_id:0
+msgid "Client"
+msgstr "Cliente"
#. module: som_gurb
#: view:som.gurb:0
@@ -573,11 +656,6 @@ msgstr "Con compensación"
msgid "Veure factures"
msgstr "Ver facturas"
-#. module: som_gurb
-#: field:giscedata.switching,_attachments_field:0
-msgid "Attachments"
-msgstr "Attachments"
-
#. module: som_gurb
#: code:addons/som_gurb/models/som_gurb.py:195
msgid "Error al canviar d'estat"
@@ -657,10 +735,9 @@ msgid "Mòdul per gestionar els grups de generació urbana"
msgstr "Módulo para gestionar los grupos de generación urbana"
#. module: som_gurb
-#: code:addons/som_gurb/models/som_gurb_cups.py:413
-msgid ""
-"The combination of name and gurb_cups_id must be unique for this register!"
-msgstr "The combination of name and gurb_cups_id must be unique for this register!"
+#: field:som.gurb,initial_product_id:0
+msgid "Producte quota inicial"
+msgstr "Producto cuota inicial"
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_som_gurb_general_conditions
@@ -720,6 +797,11 @@ msgstr "Se está creando una beta con los mismos valores que la anterior."
msgid "Vols tancar la primera obertura del GURB?"
msgstr "¿Quieres cerrar la primera apertura del GURB?"
+#. module: som_gurb
+#: model:product.template,name:som_gurb.product_gurb_product_template
+msgid "Producte GURB"
+msgstr "Producto GURB"
+
#. module: som_gurb
#: view:som.gurb:0
msgid "Canvis realitzats al GURB"
@@ -770,6 +852,11 @@ msgstr "Cerrar reapertura"
msgid "Vols reobrir el GURB?"
msgstr "¿Quieres reabrir el GURB?"
+#. module: som_gurb
+#: view:wizard.create.gurb.cups.signature:0
+msgid "Enviar documents a signar!"
+msgstr "Enviar documentos a firmar!"
+
#. module: som_gurb
#: view:som.gurb:0
msgid "Tornar a primera obertura"
@@ -817,10 +904,15 @@ msgstr "Provincia"
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_som_gurb_cups
-#: code:addons/som_gurb/models/som_gurb_cups.py:26
+#: code:addons/som_gurb/models/som_gurb_cups.py:27
msgid "CUPS en grup de generació urbana"
msgstr "CUPS en grupo de generación urbana"
+#. module: som_gurb
+#: code:addons/som_gurb/models/som_gurb_cups.py:182
+msgid "El CUPS id {} no té pòlisses actives o en esborrany. No es pot afegir."
+msgstr "El CUPS id {} no tiene pólizas activas o en borrador. No se puede añadir."
+
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_wizard_create_distribution_agreement
msgid "wizard.create.distribution.agreement"
diff --git a/som_gurb/i18n/som_gurb.pot b/som_gurb/i18n/som_gurb.pot
index 3b07e2505..df4100251 100644
--- a/som_gurb/i18n/som_gurb.pot
+++ b/som_gurb/i18n/som_gurb.pot
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.14\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2024-06-18 11:30+0000\n"
-"PO-Revision-Date: 2024-06-18 11:30+0000\n"
+"POT-Creation-Date: 2024-07-24 15:51+0000\n"
+"PO-Revision-Date: 2024-07-24 15:51+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -42,6 +42,25 @@ msgstr ""
msgid "Data fi"
msgstr ""
+#. module: som_gurb
+#: model:poweremail.templates,def_body_text:som_gurb.email_gurb_activation
+#: model:poweremail.templates,def_body_text:som_gurb.email_gurb_in_progress
+#: model:poweremail.templates,def_body_text:som_gurb.email_gurb_welcome
+#: model:poweremail.templates,def_body_text:som_gurb.email_signature_process_gurb
+#: model:poweremail.templates,def_body_text:som_gurb.email_signature_process_gurb_lead
+msgid ""
+"\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Email text\n"
+" \n"
+" \n"
+" \n"
+" "
+msgstr ""
+
#. module: som_gurb
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
@@ -67,6 +86,11 @@ msgstr ""
msgid "Nom"
msgstr ""
+#. module: som_gurb
+#: field:som.gurb.cups,owner_cups:0
+msgid "Persona propietària"
+msgstr ""
+
#. module: som_gurb
#: view:som.gurb:0
msgid "Activar"
@@ -114,6 +138,11 @@ msgstr ""
msgid "Betes assignades + extres"
msgstr ""
+#. module: som_gurb
+#: model:ir.model,name:som_gurb.model_wizard_create_gurb_cups_signature
+msgid "Wizard per crear la Signatura d'un Gurb Cups"
+msgstr ""
+
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_report_backend_som_gurb_documents
msgid "report.backend.som.gurb.documents"
@@ -144,6 +173,13 @@ msgstr ""
msgid "Es crearan {} factures d'inscripció."
msgstr ""
+#. module: som_gurb
+#: model:poweremail.templates,def_subject:som_gurb.email_gurb_activation
+#: model:poweremail.templates,def_subject:som_gurb.email_gurb_in_progress
+#: model:poweremail.templates,def_subject:som_gurb.email_gurb_welcome
+msgid "TODO"
+msgstr ""
+
#. module: som_gurb
#: selection:som.gurb,state:0
msgid "Grup registrat"
@@ -181,6 +217,12 @@ msgstr ""
msgid "Cas cancel·lat per GURB"
msgstr ""
+#. module: som_gurb
+#: model:poweremail.templates,def_subject:som_gurb.email_signature_process_gurb
+#: model:poweremail.templates,def_subject:som_gurb.email_signature_process_gurb_lead
+msgid "CORREU DEMANANT LA SIGNATURA I PAGAMENT COST ADHESIÓ GURB"
+msgstr ""
+
#. module: som_gurb
#: field:som.gurb.cups,initial_invoice_id:0
msgid "Factura"
@@ -208,11 +250,6 @@ msgstr ""
msgid "Per poder obrir el GURB s'ha d'omplir el camp: {}"
msgstr ""
-#. module: som_gurb
-#: view:som.gurb:0
-msgid "Vols tornar a la primera obertura?"
-msgstr ""
-
#. module: som_gurb
#: selection:wizard.gurb.create.initial.invoice,state:0
msgid "End"
@@ -228,6 +265,11 @@ msgstr ""
msgid "Betes extres (kW)"
msgstr ""
+#. module: som_gurb
+#: model:ir.actions.act_window,name:som_gurb.action_wizard_sign_gurb_cups_documents_form
+msgid "Signar GURB documents"
+msgstr ""
+
#. module: som_gurb
#: model:product.template,name:som_gurb.initial_quota_gurb_product_template
msgid "Quota inicial del GURB"
@@ -254,14 +296,19 @@ msgstr ""
msgid "CUPS GURB"
msgstr ""
+#. module: som_gurb
+#: field:wizard.create.gurb.cups.signature,email:0
+msgid "Email"
+msgstr ""
+
#. module: som_gurb
#: selection:som.gurb,state:0
msgid "Complet"
msgstr ""
#. module: som_gurb
-#: code:addons/som_gurb/models/som_gurb_cups.py:152
-msgid "El CUPS id {} no té pòlisses actives. No es pot afegir cap servei"
+#: field:som.gurb,quota_product_id:0
+msgid "Produce quota mensual"
msgstr ""
#. module: som_gurb
@@ -269,11 +316,21 @@ msgstr ""
msgid "El total de la beta i la beta extra ha de ser més gran a zero."
msgstr ""
+#. module: som_gurb
+#: model:ir.actions.report.xml,name:som_gurb.action_report_som_gurb_conditions
+msgid "Generar condicions GURB"
+msgstr ""
+
#. module: som_gurb
#: code:addons/som_gurb/models/giscedata_switching.py:85
msgid "Cas importat correctament."
msgstr ""
+#. module: som_gurb
+#: code:addons/som_gurb/models/som_gurb_cups.py:180
+msgid "No hi ha pòlisses actives o en esborrany per aquest CUPS"
+msgstr ""
+
#. module: som_gurb
#: view:wizard.gurb.create.initial.invoice:0
msgid "Creació factures inscripció"
@@ -319,11 +376,21 @@ msgstr ""
msgid "Invalid XML for View Architecture!"
msgstr ""
+#. module: som_gurb
+#: view:wizard.create.gurb.cups.signature:0
+msgid "Firmar els documents d'aquest GURB CUPS"
+msgstr ""
+
#. module: som_gurb
#: constraint:product.template:0
msgid "Error: UOS must be in a different category than the UOM"
msgstr ""
+#. module: som_gurb
+#: field:som.gurb.cups,polissa_id:0
+msgid "Pòlissa"
+msgstr ""
+
#. module: som_gurb
#: field:som.gurb.cups.beta,start_date:0
#: field:wizard.gurb.create.new.beta,start_date:0
@@ -351,6 +418,11 @@ msgstr ""
msgid "Beta incorrecte!"
msgstr ""
+#. module: som_gurb
+#: field:som.gurb.cups,signed:0
+msgid "Signed"
+msgstr ""
+
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_wizard_gurb_create_initial_invoice
msgid "wizard.gurb.create.initial.invoice"
@@ -388,7 +460,7 @@ msgstr ""
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_som_gurb_cups_beta
-#: code:addons/som_gurb/models/som_gurb_cups.py:371
+#: code:addons/som_gurb/models/som_gurb_cups.py:481
msgid "Log of betas and changes for som.gurb.cups"
msgstr ""
@@ -424,8 +496,8 @@ msgid "No s'han seleccionat IDs"
msgstr ""
#. module: som_gurb
-#: field:som.gurb.cups,owner_cups:0
-msgid "Cups de la persona propietària"
+#: view:som.gurb.cups:0
+msgid "Relacions"
msgstr ""
#. module: som_gurb
@@ -457,8 +529,8 @@ msgid "Betes assignades (kW)"
msgstr ""
#. module: som_gurb
-#: code:addons/som_gurb/models/som_gurb_cups.py:150
-msgid "No hi ha pòlisses actives per aquest CUPS"
+#: view:som.gurb:0
+msgid "Vols tornar a la primera obertura?"
msgstr ""
#. module: som_gurb
@@ -492,6 +564,11 @@ msgstr ""
msgid "Reobrir"
msgstr ""
+#. module: som_gurb
+#: field:som.gurb.cups,polissa_state:0
+msgid "Estat pòlissa"
+msgstr ""
+
#. module: som_gurb
#: model:giscedata.polissa.category,name:som_gurb.categ_gurb_pilot
msgid "GURB Pilot"
@@ -512,6 +589,11 @@ msgstr ""
msgid "Crear factures"
msgstr ""
+#. module: som_gurb
+#: code:addons/som_gurb/models/som_gurb_cups.py:523
+msgid "The combination of name and gurb_cups_id must be unique for this register!"
+msgstr ""
+
#. module: som_gurb
#: model:ir.actions.act_window,name:som_gurb.action_som_gurb_cups_tree
msgid "Tots els CUPS del GURB"
@@ -543,8 +625,8 @@ msgid "Actiu no complet"
msgstr ""
#. module: som_gurb
-#: model:product.template,name:som_gurb.product_gurb_product_template
-msgid "Producte GURB"
+#: field:som.gurb.cups,partner_id:0
+msgid "Client"
msgstr ""
#. module: som_gurb
@@ -574,11 +656,6 @@ msgstr ""
msgid "Veure factures"
msgstr ""
-#. module: som_gurb
-#: field:giscedata.switching,_attachments_field:0
-msgid "Attachments"
-msgstr ""
-
#. module: som_gurb
#: code:addons/som_gurb/models/som_gurb.py:195
msgid "Error al canviar d'estat"
@@ -659,8 +736,8 @@ msgid "Mòdul per gestionar els grups de generació urbana"
msgstr ""
#. module: som_gurb
-#: code:addons/som_gurb/models/som_gurb_cups.py:413
-msgid "The combination of name and gurb_cups_id must be unique for this register!"
+#: field:som.gurb,initial_product_id:0
+msgid "Producte quota inicial"
msgstr ""
#. module: som_gurb
@@ -721,6 +798,11 @@ msgstr ""
msgid "Vols tancar la primera obertura del GURB?"
msgstr ""
+#. module: som_gurb
+#: model:product.template,name:som_gurb.product_gurb_product_template
+msgid "Producte GURB"
+msgstr ""
+
#. module: som_gurb
#: view:som.gurb:0
msgid "Canvis realitzats al GURB"
@@ -771,6 +853,11 @@ msgstr ""
msgid "Vols reobrir el GURB?"
msgstr ""
+#. module: som_gurb
+#: view:wizard.create.gurb.cups.signature:0
+msgid "Enviar documents a signar!"
+msgstr ""
+
#. module: som_gurb
#: view:som.gurb:0
msgid "Tornar a primera obertura"
@@ -818,10 +905,15 @@ msgstr ""
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_som_gurb_cups
-#: code:addons/som_gurb/models/som_gurb_cups.py:26
+#: code:addons/som_gurb/models/som_gurb_cups.py:27
msgid "CUPS en grup de generació urbana"
msgstr ""
+#. module: som_gurb
+#: code:addons/som_gurb/models/som_gurb_cups.py:182
+msgid "El CUPS id {} no té pòlisses actives o en esborrany. No es pot afegir."
+msgstr ""
+
#. module: som_gurb
#: model:ir.model,name:som_gurb.model_wizard_create_distribution_agreement
msgid "wizard.create.distribution.agreement"
diff --git a/som_gurb/models/som_gurb_cups.py b/som_gurb/models/som_gurb_cups.py
index eca5ae037..05c989b85 100644
--- a/som_gurb/models/som_gurb_cups.py
+++ b/som_gurb/models/som_gurb_cups.py
@@ -72,7 +72,7 @@ def _ff_is_owner(self, cursor, uid, ids, field_name, arg, context=None):
continue
search_params = [
- ("state", "=", "activa"),
+ ("state", "not in", ["baixa", "cancelada"]),
("cups", "=", cups_id),
("titular", "=", gurb_vals["roof_owner_id"][0])
]
@@ -177,9 +177,9 @@ def add_service_to_contract(self, cursor, uid, ids, data_inici, context=None):
pol_id = self.get_polissa_gurb_cups(cursor, uid, gurb_cups_id, context=context)
if not pol_id:
- error_title = _("No hi ha pòlisses actives per aquest CUPS"),
+ error_title = _("No hi ha pòlisses actives o en esborrany per aquest CUPS"),
error_info = _(
- "El CUPS id {} no té pòlisses actives. No es pot afegir cap servei".format(
+ "El CUPS id {} no té pòlisses actives o en esborrany. No es pot afegir.".format(
gurb_vals["cups_id"][0]
)
)
@@ -399,7 +399,7 @@ def onchange_cups_id(self, cursor, uid, ids, cups_id):
"end_date": fields.date("Data sortida GURB",),
"gurb_id": fields.many2one("som.gurb", "GURB", required=True, ondelete="cascade"),
"cups_id": fields.many2one("giscedata.cups.ps", "CUPS", required=True),
- "polissa_id": fields.many2one("giscedata.polissa", "Pòlissa", readonly=True),
+ "polissa_id": fields.many2one("giscedata.polissa", "Pòlissa", readonly=False),
"partner_id": fields.related(
"polissa_id",
"titular",
diff --git a/som_gurb/tests/tests_gurb_base.py b/som_gurb/tests/tests_gurb_base.py
index 83fb5cd64..c94bb4267 100644
--- a/som_gurb/tests/tests_gurb_base.py
+++ b/som_gurb/tests/tests_gurb_base.py
@@ -49,6 +49,9 @@ def get_references(self):
vals['gurb_cups_id'] = imd_o.get_object_reference(
self.cursor, self.uid, "som_gurb", "gurb_cups_0002"
)[1]
+ vals['cups_id'] = imd_o.get_object_reference(
+ self.cursor, self.uid, "giscedata_cups", "cups_tarifa_018"
+ )[1]
vals['pricelist_id'] = imd_o.get_object_reference(
self.cursor, self.uid, "som_gurb", "pricelist_gurb_demo"
)[1]
diff --git a/som_gurb/tests/tests_gurb_cups.py b/som_gurb/tests/tests_gurb_cups.py
index 0b975f941..9519cc005 100644
--- a/som_gurb/tests/tests_gurb_cups.py
+++ b/som_gurb/tests/tests_gurb_cups.py
@@ -26,7 +26,7 @@ def test_gurb_cups_percentage(self):
self.assertEqual(percentatge_2, 30.0)
def test_gurb_is_owner(self):
- context = {}
+
imd_o = self.openerp.pool.get("ir.model.data")
gurb_cups_o = self.openerp.pool.get("som.gurb.cups")
@@ -43,20 +43,8 @@ def test_gurb_is_owner(self):
self.cursor, self.uid, gurb_cups_id_2, ["owner_cups"]
)["owner_cups"]
- self.assertEqual(owner_cups_1, False)
- context["polissa_xml_id"] = "polissa_0001"
- self.activar_polissa_CUPS(context=context)
- owner_cups_1 = gurb_cups_o.read(
- self.cursor, self.uid, gurb_cups_id_1, ["owner_cups"]
- )["owner_cups"]
self.assertEqual(owner_cups_1, True)
self.assertEqual(owner_cups_2, False)
- context["polissa_xml_id"] = "polissa_0002"
- self.activar_polissa_CUPS(context=context)
- owner_cups_2 = gurb_cups_o.read(
- self.cursor, self.uid, gurb_cups_id_2, ["owner_cups"]
- )["owner_cups"]
- self.assertEqual(owner_cups_2, False)
def test_wizard_gurb_create_new_beta(self):
context = {}
diff --git a/som_gurb/tests/tests_gurb_services.py b/som_gurb/tests/tests_gurb_services.py
index 18d0c2d50..1c04bbbf5 100644
--- a/som_gurb/tests/tests_gurb_services.py
+++ b/som_gurb/tests/tests_gurb_services.py
@@ -94,7 +94,7 @@ def test_fail_add_service_to_draft_contract(self):
pol_br = pol_o.browse(self.cursor, self.uid, polissa_id)
self.assertEqual(pol_br.serveis[0].llista_preus.id, vals['pricelist_id'])
- self.assertEqual(pol_br.serveis[0].producte.id, vals['product_id'])
+ self.assertEqual(pol_br.serveis[0].producte.id, vals['owner_product_id'])
self.assertEqual(pol_br.serveis[0].polissa_id.state, "esborrany")
self.assertEqual(pol_br.serveis[0].polissa_id.id, polissa_id)
@@ -104,8 +104,11 @@ def test_fail_add_service_to_baixa_contract(self):
vals = self.get_references()
gurb_cups_id = vals["gurb_cups_id"]
- polissa_id = vals["pol_id"]
- pol_o.write(self.cursor, self.uid, polissa_id, {"state": "baixa"})
+ cups_id = vals["cups_id"]
+
+ pol_ids = pol_o.search(self.cursor, self.uid, [('cups', '=', cups_id)])
+
+ pol_o.write(self.cursor, self.uid, pol_ids, {"state": "baixa"})
with self.assertRaises(osv.except_osv):
gurb_cups_o.add_service_to_contract(
diff --git a/som_gurb/wizard/wizard_create_gurb_cups_signature.py b/som_gurb/wizard/wizard_create_gurb_cups_signature.py
index 8e5efe7f5..cd5cfab18 100644
--- a/som_gurb/wizard/wizard_create_gurb_cups_signature.py
+++ b/som_gurb/wizard/wizard_create_gurb_cups_signature.py
@@ -130,8 +130,8 @@ def start_signature_process(self, cursor, uid, ids, context=None):
cursor, uid, [gurb_cups_id], "gurb", context=context
)
- partner_address = ""
- name = ""
+ partner_address = titular.address[0].id
+ name = titular.address[0].name
values = {
"template_id": tmpl_id,