diff --git a/models/res_partner.py b/models/res_partner.py index cef4e3260b00ebda56901fadf4a421f7fef29604..6f289fcb303b7d4789ff4140aca33881a5899a49 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -497,6 +497,7 @@ class ScopPartner(models.Model): errors += ( "<hr/><strong>Documents manquants :</strong><ul>" + errors_str + "</ul>" ) + # Si des erreurs remplir les logs avec la liste des documents manquants if errors: local_tz = timezone("Europe/Paris") utc_tz = timezone("UTC") @@ -505,9 +506,11 @@ class ScopPartner(models.Model): + utc_tz.localize(fields.Datetime.now()) .astimezone(local_tz) .strftime("%d/%m/%Y - %-H:%M") - + "</strong> - Impossible de soumettre le dossier à la CG Scop" + + "</strong> - Impossible de passer en statut Suivi" + errors ) + else: + self.list_logs = False def scop_suivi_non_adhesion(self): """ diff --git a/views/scop_adhesion_file.xml b/views/scop_adhesion_file.xml index e68eaf44dc182f0a07a67260bc4dc4f5fcdf071f..1035b609011d1d68d8d8f8c73cc8409995154733 100644 --- a/views/scop_adhesion_file.xml +++ b/views/scop_adhesion_file.xml @@ -3,7 +3,28 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> <data> - <!-- Questionnaire Type --> + + <record id="scop_adhesion_file_search" model="ir.ui.view"> + <field name="name">scop.adhesion.file.search</field> + <field name="model">scop.adhesion.file</field> + <field name="arch" type="xml"> + <search string="Recherche Documents"> + <field name="name"/> + <filter + string="Projets de création" + name="project" + domain="[('type_process','=', 'project')]" + /> + <filter + string="Adhésion" + name="adh" + domain="[('type_process','=', 'adhesion')]" + /> + </search> + </field> + </record> + + <!-- Documents --> <record id="scop_adhesion_file_tree" model="ir.ui.view"> <field name="name">scop.adhesion.file.tree</field> <field name="model">scop.adhesion.file</field> @@ -21,6 +42,7 @@ <field name="name">Documents</field> <field name="res_model">scop.adhesion.file</field> <field name="view_mode">tree</field> + <field name="search_view_id" ref="scop_adhesion_file_search" /> <field name="help" >Liste des documents pour l'adhésion et les projets de création</field> diff --git a/wizard/scop_compulsory_fields_suivi_wizard.py b/wizard/scop_compulsory_fields_suivi_wizard.py index 63db6181012bb9db436d5122bc6f2de2915f5188..d5cf46cac773905516c41a53bb1ec90480d1b223 100644 --- a/wizard/scop_compulsory_fields_suivi_wizard.py +++ b/wizard/scop_compulsory_fields_suivi_wizard.py @@ -37,3 +37,9 @@ class ScopCompulsoryFieldsSuiviWizard(models.TransientModel): if self.with_adhesion: self.partner_id.write({"membership_status": "adhesion"}) return {"type": "ir.actions.act_window_close"} + + def save_data(self): + """ + Sauvegarder les données même avec erreurs + """ + return {"type": "ir.actions.act_window_close"} diff --git a/wizard/scop_compulsory_fields_suivi_wizard.xml b/wizard/scop_compulsory_fields_suivi_wizard.xml index 881ceff782e5f692d1510e780bbb2ff430afc195..74335e2bf076351ed9bd4eca1e229d8c31ba5b82 100644 --- a/wizard/scop_compulsory_fields_suivi_wizard.xml +++ b/wizard/scop_compulsory_fields_suivi_wizard.xml @@ -48,14 +48,21 @@ type="object" string="Valider sans adhésion" class="oe_highlight" - attrs="{'invisible':['|', ('with_adhesion','=',True),('list_logs', '=', False)]}" + attrs="{'invisible':['|', ('with_adhesion','=',True),('list_logs', '!=', False)]}" /> <button name="confirm" type="object" string="Valider avec adhésion" class="oe_highlight" - attrs="{'invisible':['|', ('with_adhesion','=',False), ('list_logs', '=', False)]}" + attrs="{'invisible':['|', ('with_adhesion','=',False), ('list_logs', '!=', False)]}" + /> + <button + name="save_data" + type="object" + string="Sauvegarder" + class="oe_highlight" + attrs="{'invisible':[('list_logs', '=', False)]}" /> <button special="cancel" string="Annuler" /> </footer>