diff --git a/grant_followup/__init__.py b/grant_followup/__init__.py new file mode 100644 index 0000000..1ab72e9 --- /dev/null +++ b/grant_followup/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# Copyright 2018 Youssef El Ouahby +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from . import models, wizard diff --git a/grant_followup/__manifest__.py b/grant_followup/__manifest__.py new file mode 100644 index 0000000..be16057 --- /dev/null +++ b/grant_followup/__manifest__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# Copyright 2018 Youssef El Ouahby +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +{ + 'name': 'Grants follow-ups', + 'summary': 'Grants follow-ups ', + 'description': 'Grants follow-ups ', + 'version': '10.0.1.0.0', + 'category': 'Membership', + 'author': 'Fabien Bourgeois, Youssef ELOUAHBY', + 'license': 'AGPL-3', + 'application': True, + 'installable': True, + 'depends': ['mail', 'document'], + 'data': ['security/security.xml', + 'security/ir.model.access.csv', + 'views/grant_menu.xml', + 'views/grant_file_views.xml', + 'wizard/grant_file_edit_views.xml'] +} diff --git a/grant_followup/i18n/fr.po b/grant_followup/i18n/fr.po new file mode 100644 index 0000000..84f801b --- /dev/null +++ b/grant_followup/i18n/fr.po @@ -0,0 +1,571 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * grant_followup +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-09-26 12:47+0000\n" +"PO-Revision-Date: 2018-09-26 14:53+0200\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Reply deadline :" +msgstr "Date de réponse :" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "document(s) attached" +msgstr "pièce(s) jointe(s)" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "All partners" +msgstr "Tous les partneraires" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Amount details" +msgstr "Détails des sommes" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_ids +msgid "Amount lines" +msgstr "Lignes des sommes" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file_amount.py:29 +#: sql_constraint:grant.file.amount.line:0 +#, python-format +msgid "An amount line had already been named like that for this grant file" +msgstr "Ce nom a déjà été donné à l'une des lignes concernant le budget de ce dossier de subvention" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Are you sure you want to mark assessment as not sent ?" +msgstr "Êtes-vous sûr de vouloir marquer le bilan comme non envoyé ?" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Are you sure you want to mark assessment as sent ?" +msgstr "Êtes-vous sûr de vouloir marquer le bilan comme envoyé ?" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Are you sure you want to mark this file as refused ?" +msgstr "Êtes-vous sûr de vouloir marquer ce dossier comme refusé ?" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment Sent" +msgstr "Bilan Envoyé" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_assessment_deadline +msgid "Assessment deadline" +msgstr "Date d'envoi du bilan" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment deadline (month)" +msgstr "Date d'envoi du bilan (mois)" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment deadline (week)" +msgstr "Date d'envoi du bilan (semaine)" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment not sent" +msgstr "Bilan pas encore envoyé" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment sent" +msgstr "Bilan envoyé" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_attachment_ids +msgid "Attachments" +msgstr "Pièces jointes" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_edit_wizard_form +msgid "Cancel" +msgstr "Annuler" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_color +msgid "Color Index" +msgstr "Couleur" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Common" +msgstr "Commune" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_edit_wizard_form +msgid "Confirm" +msgstr "Confirmer" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_create_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_create_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_create_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_create_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Critical" +msgstr "Critique" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_currency_id +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_currency_id +msgid "Currency" +msgstr "Devise" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Delete" +msgstr "Supprimer" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_description +msgid "Description" +msgstr "Description" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_display_name +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_display_name +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_display_partner_ids +msgid "Display partner ids" +msgstr "Display partner ids" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_doc_count +msgid "Doc count" +msgstr "Nombre de pièces jointes" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Draft" +msgstr "Brouillon" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Edit" +msgstr "Modifier" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Edit file" +msgstr "Modifier le dossier" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Edited" +msgstr "Modifié" + +#. module: grant_followup +#: code:addons/grant_followup/wizard/grant_file_edit.py:37 +#, python-format +msgid "File update reason : {}" +msgstr "Motif de mise à jour du dossier : {}" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Finished" +msgstr "Terminé" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "First Paiement Received" +msgstr "Premiers paiements reçus" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Go back to draft" +msgstr "Remettre en brouillon" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Grant" +msgstr "Subvention" + +#. module: grant_followup +#: model:res.groups,name:grant_followup.group_grant_manager +msgid "Grant Manager" +msgstr "Responsable subventions" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Grant Notification" +msgstr "Notification de subvention" + +#. module: grant_followup +#: model:res.groups,name:grant_followup.group_grant_user +msgid "Grant User" +msgstr "Utilisateur subventions" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_id +msgid "Grant file" +msgstr "Dossier de subvention" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_grant_file_id +msgid "Grant file id" +msgstr "Dossier de subvention" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Grant notified" +msgstr "Subvention notifiée" + +#. module: grant_followup +#: model:ir.actions.act_window,name:grant_followup.grant_action +#: model:ir.ui.menu,name:grant_followup.grant_menu +msgid "Grants" +msgstr "Subventions" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_assessment_sent +msgid "Has assessment been sent ?" +msgstr "Bilan envoyé ?" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "High" +msgstr "Haute" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_id +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_id +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_id +msgid "ID" +msgstr "ID" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file___last_update +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line___last_update +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_write_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_write_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_write_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_write_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_partner_id +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Main partner" +msgstr "Partenaire principal" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark Assessment as Not Sent" +msgstr "Marquer le bilan comme non envoyé" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark Assessment as Sent" +msgstr "Marquer le bilan comme envoyé" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark as refused" +msgstr "Marquer comme refusé" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark as sent" +msgstr "Marquer comme envoyé" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Medium" +msgstr "Moyenne" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_name +msgid "Name" +msgstr "Nom" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Not evaluated" +msgstr "Non évaluée" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_note +msgid "Note" +msgstr "Note" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Notes" +msgstr "Notes" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Notified :" +msgstr "Notifié :" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_notified_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_notified_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_notified_amount +msgid "Notified amount" +msgstr "Somme notifiée" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:185 +#, python-format +msgid "Operation not allowed, received amount should be a value between 0 and notified amount" +msgstr "L'opération n'est pas autorisée, la somme reçue doit être inférieure au montant notifié" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_partner_ids +msgid "Other partners" +msgstr "Autres partenaires" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:156 +#, python-format +msgid "Please enter the update reason" +msgstr "Merci de saisir le motif de mise à jour" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_reason +msgid "Reason" +msgstr "Motif" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Received :" +msgstr "Reçu :" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_received_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_received_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_received_amount +msgid "Received amount" +msgstr "Somme reçue" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Refused" +msgstr "Refusé" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_remaining_amount +msgid "Remaining amount" +msgstr "Somme restante" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_reply_deadline +msgid "Reply deadline" +msgstr "Date de réponse" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Reply deadline (month)" +msgstr "Date de réponse (mois)" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Reply deadline (week)" +msgstr "Date de réponse (semaine)" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Requested :" +msgstr "Demandé :" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_requested_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_requested_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_requested_amount +msgid "Requested amount" +msgstr "Requested amount" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_responsible_id +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Responsible" +msgstr "Responsable" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Sent" +msgstr "Envoyé" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_significance +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Significance" +msgstr "Significance" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_state +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "State" +msgstr "État" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:195 +#, python-format +msgid "Sum of notified amounts on amount details is not the same as global notified amount. Please check your fills." +msgstr "La somme des montants notifiés sur les détails ne correspond pas au montant global notifié. Merci de vérifier vos saisies." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:200 +#, python-format +msgid "Sum of received amounts on amount details is not the same as global received amount. Please check your fills." +msgstr "La somme des montants reçues sur les détails ne correspond pas au montant global reçu. Merci de vérifier vos saisies." + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_title +msgid "Title" +msgstr "Titre" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total notified" +msgstr "Total notifié" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total received" +msgstr "Total reçu" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total remaining" +msgstr "Total restant" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total requested" +msgstr "Total demandé" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_edit_wizard_form +msgid "Update reason" +msgstr "Motif de mise à jour" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:219 +#, python-format +msgid "You are only allowed to update to draft from sent or refused states." +msgstr "Vous n'êtes autorisé à mettre à jour vers brouillon que depuis les états envoyé et refusé." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:226 +#, python-format +msgid "You are only allowed to update to edit from sent or edit states." +msgstr "Vous n'êtes autorisé à mettre à jour vers modifié que depuis les états envoyé et déjà modifié." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:231 +#, python-format +msgid "You are only allowed to update to notidied from sent or edit states." +msgstr "Vous n'êtes autorisé à mettre à jour vers notifié que depuis les états envoyé et modifié." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:215 +#, python-format +msgid "You are only allowed to update to refused from sent or edited states." +msgstr "Vous n'êtes autorisé à mettre à jour vers refusé que depuis les états envoyé et modifié." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:223 +#, python-format +msgid "You are only allowed to update to sent state from draft." +msgstr "Vous n'êtes autorisé à mettre à jour vers envoyé que depuis l'état brouillon." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:235 +#, python-format +msgid "You can not change manually to paid or finished state : fill received amount to achieve this." +msgstr "Vous ne pouvez pas modifier manuellement vers les états payé ou terminé : utiliser le champ de la somme reçue pour cela." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:141 +#, python-format +msgid "You can only mark assessment as sent when grant had been notified." +msgstr "Vous pouvez seulement marquer le bilan comme envoyé quand la subvention a été notifiée." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:171 +#, python-format +msgid "You must enter a signed notified amount." +msgstr "Vous devez saisir un montant notifié positif." + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:168 +#, python-format +msgid "You must enter a signed requested amount." +msgstr "Vous devez saisir un montant demandé positif." + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "You must save your grant file before being able to enter amount lines." +msgstr "Vous devez sauvegarder votre dossier de subvention avant de pouvoir entrer les détails." + +#. module: grant_followup +#: model:ir.model,name:grant_followup.model_grant_file +msgid "grant.file" +msgstr "grant.file" + +#. module: grant_followup +#: model:ir.model,name:grant_followup.model_grant_file_amount_line +msgid "grant.file.amount.line" +msgstr "grant.file.amount.line" + +#. module: grant_followup +#: model:ir.model,name:grant_followup.model_grant_file_edit_wizard +msgid "grant.file.edit.wizard" +msgstr "grant.file.edit.wizard" + diff --git a/grant_followup/i18n/grant_followup.pot b/grant_followup/i18n/grant_followup.pot new file mode 100644 index 0000000..068adfd --- /dev/null +++ b/grant_followup/i18n/grant_followup.pot @@ -0,0 +1,571 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * grant_followup +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-09-26 12:47+0000\n" +"PO-Revision-Date: 2018-09-26 12:47+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Reply deadline :" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "document(s) attached" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "All partners" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Amount details" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_ids +msgid "Amount lines" +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file_amount.py:29 +#: sql_constraint:grant.file.amount.line:0 +#, python-format +msgid "An amount line had already been named like that for this grant file" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Are you sure you want to mark assessment as not sent ?" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Are you sure you want to mark assessment as sent ?" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Are you sure you want to mark this file as refused ?" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment Sent" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_assessment_deadline +msgid "Assessment deadline" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment deadline (month)" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment deadline (week)" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment not sent" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Assessment sent" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_attachment_ids +msgid "Attachments" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_edit_wizard_form +msgid "Cancel" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_color +msgid "Color Index" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Common" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_edit_wizard_form +msgid "Confirm" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_create_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_create_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_create_uid +msgid "Created by" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_create_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_create_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_create_date +msgid "Created on" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Critical" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_currency_id +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_currency_id +msgid "Currency" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Delete" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_description +msgid "Description" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_display_name +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_display_name +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_display_name +msgid "Display Name" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_display_partner_ids +msgid "Display partner ids" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_doc_count +msgid "Doc count" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Draft" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Edit" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Edit file" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Edited" +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/wizard/grant_file_edit.py:37 +#, python-format +msgid "File update reason : {}" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Finished" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "First Paiement Received" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Go back to draft" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Grant" +msgstr "" + +#. module: grant_followup +#: model:res.groups,name:grant_followup.group_grant_manager +msgid "Grant Manager" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Grant Notification" +msgstr "" + +#. module: grant_followup +#: model:res.groups,name:grant_followup.group_grant_user +msgid "Grant User" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_id +msgid "Grant file" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_grant_file_id +msgid "Grant file id" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Grant notified" +msgstr "" + +#. module: grant_followup +#: model:ir.actions.act_window,name:grant_followup.grant_action +#: model:ir.ui.menu,name:grant_followup.grant_menu +msgid "Grants" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_assessment_sent +msgid "Has assessment been sent ?" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "High" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_id +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_id +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_id +msgid "ID" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file___last_update +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line___last_update +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard___last_update +msgid "Last Modified on" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_write_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_write_uid +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_write_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_write_date +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_write_date +msgid "Last Updated on" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_partner_id +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Main partner" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark Assessment as Not Sent" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark Assessment as Sent" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark as refused" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Mark as sent" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Medium" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_name +msgid "Name" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,significance:0 +msgid "Not evaluated" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_note +msgid "Note" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Notes" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Notified :" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_notified_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_notified_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_notified_amount +msgid "Notified amount" +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:185 +#, python-format +msgid "Operation not allowed, received amount should be a value between 0 and notified amount" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_partner_ids +msgid "Other partners" +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:156 +#, python-format +msgid "Please enter the update reason" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_edit_wizard_reason +msgid "Reason" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Received :" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_received_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_received_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_received_amount +msgid "Received amount" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Refused" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_remaining_amount +msgid "Remaining amount" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_reply_deadline +msgid "Reply deadline" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Reply deadline (month)" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Reply deadline (week)" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban +msgid "Requested :" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_file_requested_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_amount_line_requested_amount +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_requested_amount +msgid "Requested amount" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_responsible_id +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Responsible" +msgstr "" + +#. module: grant_followup +#: selection:grant.file,state:0 +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Sent" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_significance +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "Significance" +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_state +#: model:ir.ui.view,arch_db:grant_followup.grant_file_search +msgid "State" +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:195 +#, python-format +msgid "Sum of notified amounts on amount details is not the same as global notified amount. Please check your fills." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:200 +#, python-format +msgid "Sum of received amounts on amount details is not the same as global received amount. Please check your fills." +msgstr "" + +#. module: grant_followup +#: model:ir.model.fields,field_description:grant_followup.field_grant_file_title +msgid "Title" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total notified" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total received" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total remaining" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "Total requested" +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_edit_wizard_form +msgid "Update reason" +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:219 +#, python-format +msgid "You are only allowed to update to draft from sent or refused states." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:226 +#, python-format +msgid "You are only allowed to update to edit from sent or edit states." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:231 +#, python-format +msgid "You are only allowed to update to notidied from sent or edit states." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:215 +#, python-format +msgid "You are only allowed to update to refused from sent or edited states." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:223 +#, python-format +msgid "You are only allowed to update to sent state from draft." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:235 +#, python-format +msgid "You can not change manually to paid or finished state : fill received amount to achieve this." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:141 +#, python-format +msgid "You can only mark assessment as sent when grant had been notified." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:171 +#, python-format +msgid "You must enter a signed notified amount." +msgstr "" + +#. module: grant_followup +#: code:addons/grant_followup/models/grant_file.py:168 +#, python-format +msgid "You must enter a signed requested amount." +msgstr "" + +#. module: grant_followup +#: model:ir.ui.view,arch_db:grant_followup.grant_file_form +msgid "You must save your grant file before being able to enter amount lines." +msgstr "" + +#. module: grant_followup +#: model:ir.model,name:grant_followup.model_grant_file +msgid "grant.file" +msgstr "" + +#. module: grant_followup +#: model:ir.model,name:grant_followup.model_grant_file_amount_line +msgid "grant.file.amount.line" +msgstr "" + +#. module: grant_followup +#: model:ir.model,name:grant_followup.model_grant_file_edit_wizard +msgid "grant.file.edit.wizard" +msgstr "" + diff --git a/grant_followup/models/__init__.py b/grant_followup/models/__init__.py new file mode 100644 index 0000000..0870783 --- /dev/null +++ b/grant_followup/models/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# Copyright 2018 Youssef El Ouahby +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from . import grant_file, grant_file_amount diff --git a/grant_followup/models/grant_file.py b/grant_followup/models/grant_file.py new file mode 100644 index 0000000..82a8b6d --- /dev/null +++ b/grant_followup/models/grant_file.py @@ -0,0 +1,238 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +""" Grant File Management""" + +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError + + +class GrantFile(models.Model): + """ Grant File Management """ + _name = 'grant.file' + _inherit = 'mail.thread' + _order = 'significance desc, reply_deadline asc, state asc' + _rec_name = 'title' + + title = fields.Char(required=True, index=True, readonly=True, + states={'1_draft': [('readonly', False)], + '3_edited': [('readonly', False)]}) + description = fields.Text() + note = fields.Text() + partner_id = fields.Many2one('res.partner', index=True, readonly=True, + auto_join=True, string='Main partner', + states={'1_draft': [('readonly', False)], + '3_edited': [('readonly', False)]}) + partner_ids = fields.Many2many( + 'res.partner', index=True, auto_join=True, + readonly=True, string='Other partners', + states={'1_draft': [('readonly', False)], + '3_edited': [('readonly', False)], + '4_grant_notification': [('readonly', False)]}) + display_partner_ids = fields.Char(compute='_compute_display_partner_ids') + responsible_id = fields.Many2one('res.users', string='Responsible', + auto_join=True, index=True, + default=lambda self: self.env.user) + reply_deadline = fields.Date(index=True, readonly=True, + states={'1_draft': [('readonly', False)], + '3_edited': [('readonly', False)]}) + assessment_deadline = fields.Date(index=True, readonly=True, + states={'1_draft': [('readonly', False)], + '3_edited': [('readonly', False)], + '4_grant_notification': [('readonly', False)]}) + significance = fields.Selection([('0', 'Not evaluated'), + ('1', 'Common'), + ('2', 'Medium'), + ('3', 'High'), + ('4', 'Critical')], + default='0', copy=False) + + state = fields.Selection([('0_refused', 'Refused'), + ('1_draft', 'Draft'), + ('2_sent', 'Sent'), + ('3_edited', 'Edited'), + ('4_grant_notification', 'Grant Notification'), + ('6_first_paiement_received', 'First Paiement Received'), + ('7_finished', 'Finished')], + default='1_draft', copy=False, track_visibility='onchange') + + requested_amount = fields.Monetary(readonly=True, required=True, + states={'1_draft': [('readonly', False)], + '3_edited': [('readonly', False)]}) + notified_amount = fields.Monetary(readonly=True, copy=False, + states={'4_grant_notification': [('readonly', False), + ('required', True)]}) + received_amount = fields.Monetary(readonly=False, copy=False, + track_visibility='onchange', + states={'0_refused': [('readonly', True)], + '1_draft': [('readonly', True)], + '7_finished': [('readonly', True)]}) + currency_id = fields.Many2one('res.currency', string='Currency', + required=True, auto_join=True, + default=lambda self: self.env.user.company_id.currency_id) + amount_line_ids = fields.One2many('grant.file.amount.line', 'file_id', + string='Amount lines') + + assessment_sent = fields.Boolean('Has assessment been sent ?', readonly=True, + copy=False, track_visibility='onchange') + + color = fields.Integer('Color Index') + attachment_ids = fields.One2many( + 'ir.attachment', 'res_id', string='Attachments', auto_join=True, + domain=[('res_model', '=', 'grant.file')]) + doc_count = fields.Integer(compute='_compute_doc_count') + + @api.depends('partner_ids') + def _compute_display_partner_ids(self): + """ Computes display partners """ + for gfile in self: + if gfile.partner_ids: + gfile.display_partner_ids = u', '.join(gfile.partner_ids.mapped('name')) + else: + gfile.display_partner_ids = u'' + + @api.depends('attachment_ids') + def _compute_doc_count(self): + """ Computes doc count """ + for gfile in self: + gfile.doc_count = len(gfile.attachment_ids) + + @api.multi + def state_refused(self): + """ Updates state to refused """ + self.write({'state': '0_refused'}) + + @api.multi + def state_draft(self): + """ Updates state to draft """ + self.write({'state': '1_draft'}) + + @api.multi + def state_sent(self): + """ Updates state to sent """ + self.write({'state': '2_sent'}) + + @api.multi + def state_grant_notification(self): + """ Updates state to notidication granted """ + self.write({'state': '4_grant_notification'}) + + @api.multi + def sent_assessment(self): + """ Updates state to Assessment sent to True """ + for gfile in self: + if gfile.state not in ('4_grant_notification', + '6_first_paiement_received', '7_finished'): + verr = _('You can only mark assessment as sent when grant had ' + 'been notified.') + raise ValidationError(verr) + self.write({'assessment_sent': True}) + + @api.multi + def unsent_assessment(self): + """ Updates state to Assessment sent to False """ + self.write({'assessment_sent': False}) + + @api.multi + def state_edit(self): + """ Wizard to enter update reason """ + self.ensure_one() + grant_file_id = self[0] + return {'name': _('Please enter the update reason'), + 'type': 'ir.actions.act_window', + 'res_model': 'grant.file.edit.wizard', + 'context': {'default_grant_file_id': grant_file_id.id}, + 'view_mode': 'form', + 'target': 'new'} + + @api.constrains('requested_amount', 'notified_amount') + def check_notified_amount(self): + """ Checks notified amount is filled, according to file state """ + for gfile in self: + if not gfile.requested_amount or gfile.requested_amount <= 0.0: + verr = _('You must enter a signed requested amount.') + raise ValidationError(verr) + if gfile.state == '4_grant_notification' and gfile.notified_amount <= 0.0: + verr = _('You must enter a signed notified amount.') + raise ValidationError(verr) + + @api.constrains('received_amount') + def check_received_amount(self): + """ Check received amount to finish application """ + for grant in self: + if grant.received_amount: + if 0 < grant.received_amount < grant.notified_amount: + grant.write({'state': '6_first_paiement_received'}, bypass=True) + elif grant.received_amount and \ + (grant.received_amount == grant.notified_amount): + grant.write({'state': '7_finished'}, bypass=True) + else: + verr = _('Operation not allowed, received amount should be a ' + 'value between 0 and notified amount') + raise ValidationError(verr) + + @api.constrains('amount_line_ids') + def check_amount_details(self): + """ Checks coherence between declared amounts and details """ + for gfile in self: + if gfile.amount_line_ids: + if gfile.notified_amount != sum(gfile.amount_line_ids.mapped('notified_amount')): + verr = _('Sum of notified amounts on amount details is not ' + 'the same as global notified amount. Please check ' + 'your fills.') + raise ValidationError(verr) + if gfile.received_amount != sum(gfile.amount_line_ids.mapped('received_amount')): + verr = _('Sum of received amounts on amount details is not ' + 'the same as global received amount. Please check ' + 'your fills.') + raise ValidationError(verr) + + @api.multi + def write(self, vals, bypass=False): + """ Check state update coherence """ + notified_val = vals.get('notified_amount', 0.0) + if notified_val <= 0.0: + self.check_notified_amount() + if 'state' in vals: + vstate = vals.get('state') + for gfile in self: + if vstate == '0_refused' and gfile.state not in ('2_sent', '3_edited'): + verr = _('You are only allowed to update to refused from ' + 'sent or edited states.') + raise ValidationError(verr) + elif vstate == '1_draft' and gfile.state not in ('2_sent', '0_refused'): + verr = _('You are only allowed to update to draft from sent ' + 'or refused states.') + raise ValidationError(verr) + elif vstate == '2_sent' and gfile.state != '1_draft': + verr = _('You are only allowed to update to sent state from draft.') + raise ValidationError(verr) + elif vstate == '3_edited' and gfile.state not in ('2_sent', '3_edited'): + verr = _('You are only allowed to update to edit from sent ' + 'or edit states.') + raise ValidationError(verr) + elif vstate == '4_grant_notification' and \ + gfile.state not in ('2_sent', '3_edited'): + verr = _('You are only allowed to update to notidied from ' + 'sent or edit states.') + raise ValidationError(verr) + elif vstate in ('6_first_paiement_received', '7_finished') and not bypass: + verr = _('You can not change manually to paid or finished ' + 'state : fill received amount to achieve this.') + raise ValidationError(verr) + return super(GrantFile, self).write(vals) diff --git a/grant_followup/models/grant_file_amount.py b/grant_followup/models/grant_file_amount.py new file mode 100644 index 0000000..42c84d7 --- /dev/null +++ b/grant_followup/models/grant_file_amount.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +""" Grant File Amount Management""" + +from odoo import models, fields, api, _ + + +class GrantFileAmountLine(models.Model): + """ Grant File Amount Line Management """ + _name = 'grant.file.amount.line' + _sql_constraints = [('grant_file_amount_line_uniq', + 'UNIQUE (file_id, name)', + _('An amount line had already been named like that for ' + 'this grant file'))] + + file_id = fields.Many2one('grant.file', required=True, index=True, + auto_join=True, string='Grant file', + ondelete='cascade') + currency_id = fields.Many2one(related='file_id.currency_id') + file_requested_amount = fields.Monetary(related='file_id.requested_amount') + file_notified_amount = fields.Monetary(related='file_id.notified_amount') + file_received_amount = fields.Monetary(related='file_id.received_amount') + name = fields.Char(required=True) + requested_amount = fields.Monetary() + notified_amount = fields.Monetary() + received_amount = fields.Monetary() + remaining_amount = fields.Monetary(compute='_compute_remaining_amount') + + @api.depends('notified_amount', 'received_amount') + def _compute_remaining_amount(self): + """ Computes remaining amount """ + for line in self: + line.remaining_amount = line.notified_amount - line.received_amount diff --git a/grant_followup/security/ir.model.access.csv b/grant_followup/security/ir.model.access.csv new file mode 100644 index 0000000..414cf10 --- /dev/null +++ b/grant_followup/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_grant_file_manager,Access Grant Manager,grant_followup.model_grant_file,grant_followup.group_grant_manager,1,1,1,1 +access_grant_file_user,Access Grant User,grant_followup.model_grant_file,grant_followup.group_grant_user,1,1,1,0 +access_grant_file_amount_line_base_user,Access Grant File Amount Line Grant User,grant_followup.model_grant_file_amount_line,grant_followup.group_grant_user,1,1,1,1 diff --git a/grant_followup/security/security.xml b/grant_followup/security/security.xml new file mode 100644 index 0000000..39be5a7 --- /dev/null +++ b/grant_followup/security/security.xml @@ -0,0 +1,31 @@ + + + + + + + + + Grant Manager + + + Grant User + + + + diff --git a/grant_followup/static/description/icon.png b/grant_followup/static/description/icon.png new file mode 100644 index 0000000..c201fe7 Binary files /dev/null and b/grant_followup/static/description/icon.png differ diff --git a/grant_followup/views/grant_file_views.xml b/grant_followup/views/grant_file_views.xml new file mode 100644 index 0000000..852001f --- /dev/null +++ b/grant_followup/views/grant_file_views.xml @@ -0,0 +1,295 @@ + + + + + + + + + + Grant File Tree + grant.file + + + + + + + + + + + + + + + + + + + + + + Grant File Form + grant.file + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+ You must save your grant file before being able to enter amount lines. +

+ + + + + + + + + + + + + + + + +
+ + + + + +
+
+
+ + +
+
+
+
+ + + + Grant File Search + grant.file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Grant File Kanban + grant.file + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+
    +
  • + + + () + +
  • +
  • + Reply deadline : + +
  • +
  • Requested :
  • +
  • + Notified : +
  • +
  • + Received : +
  • +
  • + + document(s) attached +
  • +
+ + +
+
+
+ + + + + + + + diff --git a/grant_followup/views/grant_menu.xml b/grant_followup/views/grant_menu.xml new file mode 100644 index 0000000..afca2d6 --- /dev/null +++ b/grant_followup/views/grant_menu.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/grant_followup/wizard/__init__.py b/grant_followup/wizard/__init__.py new file mode 100644 index 0000000..762fb34 --- /dev/null +++ b/grant_followup/wizard/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# Copyright 2018 Youssef El Ouahby +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from . import grant_file_edit diff --git a/grant_followup/wizard/grant_file_edit.py b/grant_followup/wizard/grant_file_edit.py new file mode 100644 index 0000000..0038432 --- /dev/null +++ b/grant_followup/wizard/grant_file_edit.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +""" Grant File Edit Wizard""" + +from odoo import models, fields, api, _ + +class FileEditWizard(models.TransientModel): + """ Grant File Edit Wizard """ + _name = "grant.file.edit.wizard" + + grant_file_id = fields.Many2one('grant.file', required=True, ondelete='cascade') + reason = fields.Text(required=True) + + @api.multi + def edit(self): + """ Sets grant status to edited """ + self.ensure_one() + record = self[0] + record.grant_file_id.state = '3_edited' + record.grant_file_id.message_post( + body=_(u'File update reason : {}').format(record.reason)) diff --git a/grant_followup/wizard/grant_file_edit_views.xml b/grant_followup/wizard/grant_file_edit_views.xml new file mode 100644 index 0000000..a002f80 --- /dev/null +++ b/grant_followup/wizard/grant_file_edit_views.xml @@ -0,0 +1,42 @@ + + + + + + + + Grant File Edit Wizard Form + grant.file.edit.wizard + +
+ + + + + +
+
+
+ +
+