[ADD]Grant followup addon

This commit is contained in:
Fabien BOURGEOIS 2018-09-26 14:54:03 +02:00
parent 64e992c3fd
commit c010ead212
15 changed files with 1964 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
from . import models, wizard

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
{
'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']
}

571
grant_followup/i18n/fr.po Normal file
View File

@ -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 "<span style=\"color: grey;\">Reply deadline :</span>"
msgstr "<span style=\"color: grey;\">Date de réponse :</span>"
#. module: grant_followup
#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban
msgid "<span style=\"font-style: italic;\">document(s) attached</span>"
msgstr "<span style=\"font-style: italic;\">pièce(s) jointe(s)</span>"
#. 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"

View File

@ -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 "<span style=\"color: grey;\">Reply deadline :</span>"
msgstr ""
#. module: grant_followup
#: model:ir.ui.view,arch_db:grant_followup.grant_file_kanban
msgid "<span style=\"font-style: italic;\">document(s) attached</span>"
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 ""

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
from . import grant_file, grant_file_amount

View File

@ -0,0 +1,238 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
""" 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)

View File

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
""" 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

View File

@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_grant_file_manager Access Grant Manager grant_followup.model_grant_file grant_followup.group_grant_manager 1 1 1 1
3 access_grant_file_user Access Grant User grant_followup.model_grant_file grant_followup.group_grant_user 1 1 1 0
4 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

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<record id="group_grant_manager" model="res.groups">
<field name="name">Grant Manager</field>
</record>
<record id="group_grant_user" model="res.groups">
<field name="name">Grant User</field>
</record>
</data>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,295 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Trees -->
<record id="grant_file_tree" model="ir.ui.view">
<field name="name">Grant File Tree</field>
<field name="model">grant.file</field>
<field name="arch" type="xml">
<tree colors="grey: state=='1_draft'; black: state in ('2_sent', '3_edited'); blue: state == '4_grant_notification'; red: state=='0_refused'; green: state in ('6_first_paiement_received','7_finished')">
<field name="title"/>
<field name="partner_id"/>
<field name="partner_ids" widget="many2many_tags" />
<field name="reply_deadline"/>
<field name="significance" />
<field name="currency_id" invisible="1" />
<field name="requested_amount"/>
<field name="notified_amount"/>
<field name="received_amount"/>
<field name="responsible_id"/>
<field name="assessment_sent"/>
<field name="doc_count"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Forms -->
<record id="grant_file_form" model="ir.ui.view">
<field name="name">Grant File Form</field>
<field name="model">grant.file</field>
<field name="arch" type="xml">
<form string="Grant">
<header>
<button name="state_refused" type="object" string="Mark as refused"
confirm="Are you sure you want to mark this file as refused ?"
states="2_sent,3_edited" />
<button name="state_draft" type="object" string="Go back to draft"
states="2_sent,0_refused" />
<button name="state_sent" type="object" string="Mark as sent"
class="oe_highlight" states="1_draft" />
<button name="state_edit" type="object" string="Edit file"
class="oe_highlight" states="2_sent,3_edited" />
<button name="state_grant_notification" type="object"
string="Grant notified" class="oe_highlight" states="2_sent,3_edited" />
<button name="sent_assessment" type="object"
string="Mark Assessment as Sent" class="oe_highlight"
confirm="Are you sure you want to mark assessment as sent ?"
attrs="{'invisible': ['|', ('assessment_sent', '!=', False),
('state', 'not in', ('4_grant_notification', '6_first_paiement_received', '7_finished'))]}" />
<button name="unsent_assessment" type="object"
string="Mark Assessment as Not Sent"
confirm="Are you sure you want to mark assessment as not sent ?"
attrs="{'invisible': ['|', ('assessment_sent', '=', False),
('state', 'not in', ('4_grant_notification', '6_first_paiement_received', '7_finished'))]}" />
<field name="state" widget="statusbar" />
</header>
<sheet>
<group>
<group>
<field name="id" invisible="1" />
<field name="title" />
<field name="partner_id" />
<field name="partner_ids" widget="many2many_tags" />
<field name="reply_deadline" />
<field name="assessment_deadline" />
<field name="significance" widget="priority"/>
</group>
<group>
<field name="currency_id" invisible="1" />
<field name="requested_amount" />
<field name="notified_amount" />
<field name="received_amount" />
<field name="responsible_id" />
<field name="assessment_sent" />
</group>
</group>
<group>
<field name="description" />
</group>
<notebook>
<page name="amount_lines" string="Amount details">
<p style="color: red;" attrs="{'invisible': [('id', '!=', False)]}">
You must save your grant file before being able to enter amount lines.
</p>
<group>
<field name="amount_line_ids" nolabel="1"
context="{'default_file_id': active_id}"
attrs="{'readonly': [('id', '=', False)]}">
<tree editable="bottom"
colors="gray: notified_amount == 0.0; blue: received_amount != 0.0 and received_amount &lt; notified_amount; green: received_amount != 0.0 and received_amount == notified_amount;">
<field name="file_id" invisible="1" />
<field name="file_requested_amount" invisible="1" />
<field name="file_notified_amount" invisible="1" />
<field name="file_received_amount" invisible="1" />
<field name="currency_id" invisible="1" />
<field name="name" />
<field name="requested_amount" sum="Total requested" />
<field name="notified_amount" sum="Total notified" />
<field name="received_amount" sum="Total received" />
<field name="remaining_amount" sum="Total remaining" />
</tree>
</field>
</group>
</page>
<page name="notes" string="Notes">
<group>
<field name="note" nolabel="1" />
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<!-- Search -->
<record id="grant_file_search" model="ir.ui.view">
<field name="name">Grant File Search</field>
<field name="model">grant.file</field>
<field name="arch" type="xml">
<search>
<field name="title"/>
<field name="partner_id"/>
<field name="partner_ids" string="All partners"
filter_domain="['|', ('partner_id', 'ilike', self), ('partner_ids', 'ilike', self)]"/>
<field name="responsible_id"/>
<field name="reply_deadline"/>
<field name="assessment_deadline"/>
<filter name="state_draft" string="Draft"
domain="[('state', '=', '1_draft')]" />
<filter name="state_sent" string="Sent"
domain="[('state', '=', '2_sent')]" />
<filter name="state_edited" string="Edited"
domain="[('state', '=', '3_edited')]" />
<filter name="state_grant_notification" string="Grant Notification"
domain="[('state', '=', '4_grant_notification')]"/>
<filter name="state_assessment_sent" string="Assessment Sent"
domain="[('state', '=', '5_assessment_sent')]" />
<filter name="state_first_paiement_received" string="First Paiement Received"
domain="[('state', '=', '6_first_paiement_received')]"/>
<filter name="state_finished" string="Finished"
domain="[('state', '=', '7_finished')]"/>
<filter name="state_refused" string="Refused"
domain="[('state', '=', '0_refused')]"/>
<separator />
<filter name="assessment_sent_1" string="Assessment sent"
domain="[('assessment_sent', '=', True)]"/>
<filter name="assessment_sent_0" string="Assessment not sent"
domain="[('assessment_sent', '=', False)]"/>
<filter name="group_state" string="State"
context="{'group_by': 'state'}"/>
<filter name="group_significance" string="Significance"
context="{'group_by': 'significance'}"/>
<filter name="group_partner" string="Main partner"
context="{'group_by': 'partner_id'}"/>
<filter name="group_responsible" string="Responsible"
context="{'group_by': 'responsible_id'}"/>
<filter name="group_reply_deadline_month" string="Reply deadline (month)"
context="{'group_by': 'reply_deadline'}"/>
<filter name="group_reply_deadline_week" string="Reply deadline (week)"
context="{'group_by': 'reply_deadline:week'}"/>
<filter name="group_assessment_deadline_month"
string="Assessment deadline (month)"
context="{'group_by': 'assessment_deadline'}"/>
<filter name="group_assessment_deadline_week"
string="Assessment deadline (week)"
context="{'group_by': 'assessment_deadline:week'}"/>
</search>
</field>
</record>
<!-- Kanban -->
<record id="grant_file_kanban" model="ir.ui.view">
<field name="name">Grant File Kanban</field>
<field name="model">grant.file</field>
<field name="arch" type="xml">
<kanban default_group_by="state"
class="o_kanban_small_column">
<field name="title"/>
<field name="partner_id"/>
<field name="partner_ids"/>
<field name="display_partner_ids"/>
<field name="responsible_id"/>
<field name="reply_deadline"/>
<field name="significance"/>
<field name="received_amount"/>
<field name="requested_amount"/>
<field name="notified_amount"/>
<field name="currency_id"/>
<field name="color"/>
<field name="doc_count"/>
<templates>
<t t-name="kanban-box">
<!-- Set the Kanban Card color: -->
<div t-attf-class="#{kanban_color(record.color.raw_value)}
oe_kanban_global_click">
<div class="o_dropdown_kanban dropdown">
<!-- Top-right drop down menu here... -->
<a class="dropdown-toggle btn" data-toggle="dropdown" href="#">
<span class="fa fa-bars fa-lg"/>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<!-- Edit and Delete actions, if available: -->
<t t-if="widget.editable">
<li><a type="edit">Edit</a></li>
</t>
<t t-if="widget.deletable">
<li><a type="delete">Delete</a></li>
</t>
<li>
<ul class="oe_kanban_colorpicker" data-field="color"/>
</li>
</ul>
</div>
<div class="oe_kanban_content">
<div>
<strong>
<a type="open"><field name="title" /></a>
</strong>
</div>
<ul>
<li t-if="record.partner_id.raw_value">
<field name="partner_id" />
<span t-if="record.partner_ids.raw_value.length &gt; 1"
style="text-size: smaller; opacity: 0.7;">
(<t t-esc="record.display_partner_ids.raw_value" />)
</span>
</li>
<li t-if="record.reply_deadline.raw_value">
<span style="color: grey;">Reply deadline :</span>
<field name="reply_deadline" />
</li>
<li>Requested : <field name="requested_amount" /></li>
<li t-if="record.notified_amount.raw_value"
t-attf-style="{{record.notified_amount.raw_value &lt; record.requested_amount.raw_value ? 'color: orange;' : 'color: green;'}}">
Notified : <field name="notified_amount" />
</li>
<li t-if="record.received_amount.raw_value"
t-attf-style="{{record.received_amount.raw_value &lt; record.notified_amount.raw_value ? 'color: blue;' : 'color: green;'}}">
Received : <field name="received_amount" />
</li>
<li t-if="record.doc_count.raw_value">
<field name="doc_count" />
<span style="font-style: italic;">document(s) attached</span>
</li>
</ul>
<div class="oe_kanban_footer">
<div class="oe_kanban_footer_left">
<!-- Left hand footer... -->
<field name="significance" widget="priority" />
</div>
<div>
<!-- Right hand footer... -->
<img t-att-title="record.responsible_id.value"
t-att-src="kanban_image('res.users', 'image_small', record.responsible_id.raw_value)"
width="24" height="24"
class="oe_kanban_avatar pull-right" />
</div>
</div>
</div> <!-- oe_kanban_content -->
<div class="oe_clear"/>
</div> <!-- kanban color -->
</t>
</templates>
</kanban>
</field>
</record>
</data>
</odoo>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Actions -->
<act_window id="grant_action" name="Grants"
res_model="grant.file" view_mode="kanban,tree,form,search"/>
<!-- Menus -->
<menuitem id="grant_menu" name="Grants"
action="grant_action" sequence="20"
web_icon="grant,static/description/icon.png" />
</data>
</odoo>

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
from . import grant_file_edit

View File

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
""" 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))

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Forms -->
<record model="ir.ui.view" id="grant_file_edit_wizard_form">
<field name="name">Grant File Edit Wizard Form</field>
<field name="model">grant.file.edit.wizard</field>
<field name="arch" type="xml">
<form string="Update reason">
<group>
<field name="grant_file_id" readonly="1" />
<field name="reason" />
</group>
<footer>
<button name="edit" string="Confirm" type="object"
class="oe_highlight" />
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
</data>
</odoo>