diff --git a/__init__.py b/__init__.py index 93aa2c1f84b46bf5c841c4b4526a02d30c6fe128..31660d6a9650857f10c9dbdcd139145e0897ef6e 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,3 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import models -from . import wizard diff --git a/__manifest__.py b/__manifest__.py index b7c8be0ca54c1a64d7e0fd5e32f7afd35b074b8c..2bbe4d1ea3eb14c72764c1875ace86a741184f57 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -19,12 +19,12 @@ "security/security_rules.xml", "views/assets.xml", "views/cgscop_timesheet_code.xml", + "views/cgscop_timesheet_sheet.xml", "views/hr_timesheet.xml", "views/hr_timesheet_cgscop.xml", "views/res_partner.xml", "views/ur_financial_system.xml", - "wizard/print_timesheet.xml", - "wizard/report_hr_timesheet.xml", + "report/report_hr_timesheet.xml", "datas/cgscop_timesheet_code_data.xml", ] } diff --git a/i18n/fr.po b/i18n/fr.po index ef0958a7daca23cb3ba41a4191f963f3865af7a1..2eb3d89270350204b1cb1a06f84a1fd452a0832e 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -1,13 +1,14 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * cgscop_timesheet +# * hr_timesheet # msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-09 16:01+0000\n" -"PO-Revision-Date: 2019-12-09 16:01+0000\n" +"POT-Creation-Date: 2020-02-18 18:07+0000\n" +"PO-Revision-Date: 2020-02-18 18:07+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,6 +16,651 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "(Un)archiving a project automatically (un)archives its tasks. Do you want to proceed?" +msgstr "(Dés)archiver un projet (dés)archivera automatiquement ses tâches. Voulez-vous continuer? " + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "- Brouillon" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<span>Code activité UR</span>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<span>Contact</span>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<span>Date</span>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<span>Dispositif</span>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<span>Durée</span>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<strong>Employé</strong>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<strong>Soumis le</strong>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<strong>Total</strong>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "<strong>Validé le</strong>" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.cgscop_hr_timesheet_line_search +msgid "A soumettre" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_needaction +msgid "Action Needed" +msgstr "Nécessite une action" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__activity_ids +msgid "Activities" +msgstr "Activités" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__activity_state +msgid "Activity State" +msgstr "Status de l'Activité" + +#. module: cgscop_timesheet +#: model_terms:ir.actions.act_window,help:cgscop_timesheet.action_cgscop_timesheet_code_tree +msgid "Affiche et gère les Codes activité Nationaux" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model,name:cgscop_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Ligne analytique" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_filter +msgid "Archived" +msgstr "Archivé" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_attachment_count +msgid "Attachment Count" +msgstr "Nombre de pièces jointes" + +#. module: cgscop_timesheet +#: selection:account.analytic.line,state:0 +#: selection:cgscop.timesheet.sheet,state:0 +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Brouillon" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__can_edit +msgid "Can Reset" +msgstr "Peut éditer" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "Cette feuille de temps a été éditée en brouillon." +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_account_analytic_line__cgscop_timesheet_code_id +#: model:ir.model.fields,field_description:cgscop_timesheet.field_project_project__cgscop_timesheet_code_id +msgid "Code Activité National" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_kanban +msgid "Code activité CG" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model,name:cgscop_timesheet.model_cgscop_timesheet_code +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_filter +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Code activité National" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.cgscop_hr_timesheet_line_search +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_hr_timesheet_line_form +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_hr_timesheet_line_pivot +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_hr_timesheet_line_tree +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_filter +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_kanban +msgid "Code activité UR" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.actions.act_window,name:cgscop_timesheet.action_cgscop_timesheet_code_tree +#: model:ir.ui.menu,name:cgscop_timesheet.menu_cgscop_timesheet_code +msgid "Codes Activité National" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.ui.menu,name:cgscop_timesheet.menu_action_project_lines_tree +msgid "Codes Activité UR" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.actions.act_window,name:cgscop_timesheet.act_cgscop_project_timesheet +msgid "Codes activités UR" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__company_id +msgid "Company" +msgstr "Société" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Configuration" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.cgscop_hr_timesheet_line_search +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_hr_timesheet_line_form +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_hr_timesheet_line_pivot +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_hr_timesheet_line_tree +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_kanban +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_tree +msgid "Contact" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_filter +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Contact par défaut" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Contact par défaut auquel est rattaché cette activité. Ce contact sera sélectionné automatiquement dans les feuilles de temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code__create_uid +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__create_uid +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code__create_date +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__create_date +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__validation_date +msgid "Date de validation" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_account_analytic_line__name +msgid "Description" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code__display_name +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__display_name +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_account_analytic_line__ur_financial_system_id +msgid "Dispositif Financier" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model,name:cgscop_timesheet.model_ur_financial_system +msgid "Dispositif financier UR" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.actions.act_window,name:cgscop_timesheet.action_ur_financial_system +#: model:ir.ui.menu,name:cgscop_timesheet.menu_ur_financial_system +msgid "Dispositifs financiers" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__employee_id +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Employé" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Expenses of Your Team Member" +msgstr "Dépense des membres de votre équipe" + +#. module: cgscop_timesheet +#: model:ir.actions.report,name:cgscop_timesheet.cgscop_timesheet_sheet_report +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.report_timesheet_document +msgid "Feuille de Temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_account_analytic_line__sheet_id +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Feuille de temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.ui.menu,name:cgscop_timesheet.timesheet_sheet_menu +msgid "Feuilles de temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.actions.act_window,name:cgscop_timesheet.action_cgscop_timesheet_sheet_to_approve +msgid "Feuilles de temps à valider" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Follow this project to automatically track the events associated to tasks and issues of this project." +msgstr "Permet de suivre automatiquement les événements associés aux tâches et aux problèmes de ce projet." + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_follower_ids +msgid "Followers" +msgstr "Abonnés" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_channel_ids +msgid "Followers (Channels)" +msgstr "Abonnés (Canaux)" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_partner_ids +msgid "Followers (Partners)" +msgstr "Abonnés (Partenaires)" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_filter +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Group By" +msgstr "Regrouper par" + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_project_project__privacy_visibility +msgid "Holds visibility of the tasks or issues that belong to the current project:\n" +"- On invitation only: Employees may only see the followed project, tasks or issues\n" +"- Visible by all employees: Employees may see all project, tasks or issues\n" +"- Visible by following customers: employees see everything;\n" +" if website is activated, portal users may see project, tasks or issues followed by\n" +" them or by someone of their company\n" +"" +msgstr "Détermine la visibilité des tâches ou anomalies qui dépendent du projet courant.\n" +"- Sur invitation uniquement : les employés ne voient que les projets, tâches et anomalies qu'ils suivent ;\n" +"- Visible par tous les salariés : les employés peuvent voir tous les projets, tâches et anomalies ;\n" +"- Visible par les clients suivants : les employés voient tout ; si le site web est activé, les utilisateur du portail peuvent voir les projets, tâches et anomalies qu'eux ou un utilisateur appartenant à leur société, suivent.\n" +"" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code__id +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__id +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__id +msgid "ID" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__message_unread +msgid "If checked new messages require your attention." +msgstr "Si coché, de nouveaux messages demandent votre attention." + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__message_needaction +msgid "If checked, new messages require your attention." +msgstr "Si coché, de nouveaux messages demandent votre attention." + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__message_has_error +msgid "If checked, some messages have a delivery error." +msgstr "Si actif, certains messages ont une erreur de livraison." + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_form +msgid "Imprimer" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.actions.server,name:cgscop_timesheet.hr_timesheet_submit_action_server +msgid "Insérer dans une feuille de temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_is_follower +msgid "Is Follower" +msgstr "Est un abonné" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code____last_update +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet____last_update +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code__write_uid +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__write_uid +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code__write_date +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__write_date +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__timesheet_line_ids +msgid "Lignes de temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_main_attachment_id +msgid "Main Attachment" +msgstr "Pièce jointe principale" + +#. module: cgscop_timesheet +#: model:ir.actions.act_window,name:cgscop_timesheet.action_cgscop_timesheet_sheet_my_all +#: model:ir.ui.menu,name:cgscop_timesheet.menu_hr_timesheet_my_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Mes feuilles de temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_has_error +msgid "Message Delivery error" +msgstr "Erreur d'envoi du message" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_ids +msgid "Messages" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Mon équipe" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "Date limite de l'Activité à Venir" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__activity_summary +msgid "Next Activity Summary" +msgstr "Résumé d'activité suivant" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__activity_type_id +msgid "Next Activity Type" +msgstr "Type d'Activités à Venir" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_code__name +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__name +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__name +msgid "Nom" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_needaction_counter +msgid "Number of Actions" +msgstr "Nombre d'actions" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_has_error_counter +msgid "Number of error" +msgstr "Nombre d'erreurs" + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "Nombre de messages exigeant une action" + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "Nombre de messages avec des erreurs d'envoi" + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__message_unread_counter +msgid "Number of unread messages" +msgstr "Nombre de messages non lus" + +#. module: cgscop_timesheet +#: selection:project.project,privacy_visibility:0 +msgid "On invitation only" +msgstr "Sur invitation uniquement" + +#. module: cgscop_timesheet +#: selection:cgscop.timesheet.sheet,activity_state:0 +msgid "Overdue" +msgstr "Passé" + +#. module: cgscop_timesheet +#: model:ir.actions.act_window,name:cgscop_timesheet.timesheet_action_report_by_contact +#: model:ir.ui.menu,name:cgscop_timesheet.timesheet_menu_report_timesheet_by_contact +msgid "Par Contact" +msgstr "" + +#. module: cgscop_timesheet +#: selection:cgscop.timesheet.sheet,activity_state:0 +msgid "Planned" +msgstr "Planifié" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_project_project__privacy_visibility +msgid "Privacy" +msgstr "Confidentialité" + +#. module: cgscop_timesheet +#: model:ir.model,name:cgscop_timesheet.model_project_project +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Project" +msgstr "Code activité UR" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_kanban +msgid "Project Manager" +msgstr "Responsable" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_tree +msgid "Projects" +msgstr "Projets" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_hr_timesheet_line_pivot +msgid "Rapport" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_form +msgid "Remettre en brouillon" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__activity_user_id +msgid "Responsible User" +msgstr "Responsable" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_filter +msgid "Search Project" +msgstr "Chercher un projet" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__company_id +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Société" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_form +msgid "Soumettre" +msgstr "" + +#. module: cgscop_timesheet +#: selection:account.analytic.line,state:0 +#: selection:cgscop.timesheet.sheet,state:0 +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.cgscop_hr_timesheet_line_search +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Soumis" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__submit_date +msgid "Soumis le" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__activity_state +msgid "Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "Statut basé sur les activités\n" +"En retard : la date d'échéance est déjà dépassée\n" +"Aujourd'hui : la date d'activité est aujourd'hui\n" +"Planifiée : activités futures" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_account_analytic_line__state +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__state +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Statut" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model,name:cgscop_timesheet.model_cgscop_timesheet_sheet +#: model:ir.model,name:cgscop_timesheet.model_hr_timesheet_sheet +msgid "Timesheet Report" +msgstr "" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_tree +msgid "Timesheet Reports" +msgstr "Rapport de lignes de temps" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Timesheets" +msgstr "Lignes de temps" + +#. module: cgscop_timesheet +#: selection:cgscop.timesheet.sheet,activity_state:0 +msgid "Today" +msgstr "Ajourd'hui" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__total_hour +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_tree +msgid "Total" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.actions.act_window,name:cgscop_timesheet.action_cgscop_timesheet_sheet_all +#: model:ir.ui.menu,name:cgscop_timesheet.menu_hr_timesheet_all +msgid "Toutes les feuilles de temps" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_account_analytic_line__ur_id +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__ur_id +#: model:ir.model.fields,field_description:cgscop_timesheet.field_project_project__ur_id +#: model:ir.model.fields,field_description:cgscop_timesheet.field_ur_financial_system__ur_id +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_project_timesheet_form +msgid "Union Régionale" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_unread +msgid "Unread Messages" +msgstr "Messages non lus" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__message_unread_counter +msgid "Unread Messages Counter" +msgstr "Compteur de messages non lus" + +#. module: cgscop_timesheet +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_form +msgid "Valider" +msgstr "" + +#. module: cgscop_timesheet +#: selection:account.analytic.line,state:0 +#: selection:cgscop.timesheet.sheet,state:0 +#: model_terms:ir.ui.view,arch_db:cgscop_timesheet.view_cgscop_timesheet_sheet_filter +msgid "Validé" +msgstr "" + +#. module: cgscop_timesheet +#: selection:project.project,privacy_visibility:0 +msgid "Visible by all employees" +msgstr "Visible par tous les employés" + +#. module: cgscop_timesheet +#: selection:project.project,privacy_visibility:0 +msgid "Visible by following customers" +msgstr "Visible par les clients suiveurs" + +#. module: cgscop_timesheet +#: model:ir.model.fields,field_description:cgscop_timesheet.field_cgscop_timesheet_sheet__website_message_ids +msgid "Website Messages" +msgstr "Messages du site web" + +#. module: cgscop_timesheet +#: model:ir.model.fields,help:cgscop_timesheet.field_cgscop_timesheet_sheet__website_message_ids +msgid "Website communication history" +msgstr "Historique de communication du site web" + +#. module: cgscop_timesheet +#: model:ir.model,name:cgscop_timesheet.model_cgscop_timesheet_print +msgid "Wizard Timesheet Impression" +msgstr "" + +#. module: cgscop_timesheet +#: model:ir.ui.menu,name:cgscop_timesheet.menu_hr_timesheet_to_approve +msgid "À valider" +msgstr "" + #. module: hr_timesheet #: model:ir.actions.act_window,name:hr_timesheet.timesheet_action_all #: model:ir.ui.menu,name:hr_timesheet.timesheet_menu_activity_all @@ -51,16 +697,16 @@ msgstr "Lignes de temps par date" msgid "Timesheets" msgstr "Lignes de temps" - -#. module: hr_timesheet -#: model:ir.model,name:hr_timesheet.model_project_project -#: model:ir.model.fields,field_description:hr_timesheet.field_account_analytic_line__project_id -#: model_terms:ir.ui.view,arch_db:hr_timesheet.hr_timesheet_line_search -msgid "Project" -msgstr "Code activité UR" - #. module: hr_timesheet #: model:ir.actions.act_window,name:hr_timesheet.timesheet_action_report_by_project #: model:ir.ui.menu,name:hr_timesheet.timesheet_menu_report_timesheet_by_project msgid "By Project" msgstr "Par Code activité UR" + +#. module: hr_timesheet +#: model:ir.ui.menu,name:hr_timesheet.menu_hr_time_tracking +#: model:ir.ui.menu,name:hr_timesheet.menu_timesheets_reports_timesheet +#: model_terms:ir.ui.view,arch_db:hr_timesheet.hr_timesheet_line_search +#: model_terms:ir.ui.view,arch_db:hr_timesheet.view_hr_timesheet_line_pivot +msgid "Timesheet" +msgstr "Lignes de Temps" diff --git a/models/__init__.py b/models/__init__.py index c0bd54ffc38aa4f69a1c6eea46fbeb1e2527ec0c..e64d2750133cecaee569cc49e24fbe8fdd231306 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -2,6 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import cgscop_timesheet_code +from . import cgscop_timesheet_sheet from . import hr_timesheet from . import project from . import ur_financial_system diff --git a/models/cgscop_timesheet_sheet.py b/models/cgscop_timesheet_sheet.py new file mode 100644 index 0000000000000000000000000000000000000000..bec543cbdf9e3ee5dde0e615f12c02d00593519e --- /dev/null +++ b/models/cgscop_timesheet_sheet.py @@ -0,0 +1,131 @@ +# © 2020 Le Filament (<http://www.le-filament.com>) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields, api +from odoo.exceptions import UserError, ValidationError + + +class ScopHrTimesheetSheet(models.Model): + _name = "cgscop.timesheet.sheet" + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Timesheet Report" + _order = "create_date desc, validation_date desc, id desc" + + def _default_ur(self): + return self.env['res.company']._ur_default_get() + + name = fields.Char('Nom', required=True) + timesheet_line_ids = fields.One2many( + comodel_name='account.analytic.line', + inverse_name='sheet_id', + string='Lignes de temps', + states={'valid': [('readonly', True)]}, + copy=False) + state = fields.Selection([ + ('draft', 'Brouillon'), + ('submit', 'Soumis'), + ('valid', 'Validé')], + string='Statut', + index=True, + track_visibility='onchange', + copy=False, + default='draft', + required=True) + employee_id = fields.Many2one( + comodel_name='hr.employee', + string="Employé", + required=True, + readonly=True, + states={'draft': [('readonly', False)]}, + default=lambda self: self.env['hr.employee'].search( + [('user_id', '=', self.env.uid)], limit=1)) + total_hour = fields.Float( + string='Total', + compute='_compute_hour', + store=True) + company_id = fields.Many2one( + comodel_name='res.company', + string='Company', + readonly=True, + states={'draft': [('readonly', False)]}, + default=lambda self: self.env.user.company_id) + validation_date = fields.Date("Date de validation") + submit_date = fields.Date("Soumis le") + ur_id = fields.Many2one( + 'union.regionale', + string='Union Régionale', + index=True, + on_delete='restrict', + default=_default_ur) + can_edit = fields.Boolean('Can Reset', compute='_compute_can_reset') + + # ------------------------------------------------------ + # Compute Functions + # ------------------------------------------------------ + @api.depends( + 'timesheet_line_ids', + 'timesheet_line_ids.unit_amount') + def _compute_hour(self): + for sheet in self: + sheet.total_hour = sum( + sheet.timesheet_line_ids.mapped('unit_amount')) + + @api.multi + def _compute_can_reset(self): + is_timesheet_user = self.user_has_groups( + 'hr_timesheet.group_timesheet_manager') + for sheet in self: + if sheet.state == 'draft' or is_timesheet_user: + sheet.can_edit = True + else: + sheet.can_edit = False + + # ------------------------------------------------------ + # Constain Functions + # ------------------------------------------------------ + @api.constrains('timesheet_line_ids', 'employee_id') + def _check_employee(self): + for sheet in self: + employee_ids = sheet.timesheet_line_ids.mapped('employee_id') + if len(employee_ids) > 1 or (len(employee_ids) == 1 and employee_ids != sheet.employee_id): + raise ValidationError( + 'Vous ne pouvez pas ajouter les lignes' + ' de temps de plusieurs employés.') + + # ------------------------------------------------------ + # Override ORM + # ------------------------------------------------------ + @api.multi + def unlink(self): + for timesheet in self: + if timesheet.state in ['submit', 'valid']: + raise UserError('Vous ne pouvez pas supprimer une ' + 'feuille de temps soumise ou validée') + super(ScopHrTimesheetSheet, self).unlink() + + # ------------------------------------------------------ + # Action button + # ------------------------------------------------------ + @api.multi + def action_submit_timesheet(self): + self.write({ + 'state': 'submit', + 'submit_date': fields.Date.today()}) + + @api.multi + def approve_timesheet_sheets(self): + self.write({ + 'state': 'valid', + 'validation_date': fields.Date.today()}) + + @api.multi + def reset_timesheet_sheets(self): + self.write({ + 'state': 'draft', + 'submit_date': False, + 'validation_date': False}) + + @api.multi + def print_timesheet(self): + return self.env.ref( + 'cgscop_timesheet.cgscop_timesheet_sheet_report').report_action(self) diff --git a/models/hr_timesheet.py b/models/hr_timesheet.py index fa8ee0d64399d5aef2698cebc97a6ea84f6e1578..42ec16454e0e8ffb048e9119f2d0cd3e52fbda28 100644 --- a/models/hr_timesheet.py +++ b/models/hr_timesheet.py @@ -2,6 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api +from odoo.exceptions import UserError, ValidationError class ScopHrTimesheet(models.Model): @@ -24,6 +25,32 @@ class ScopHrTimesheet(models.Model): index=True, on_delete='restrict', default=_default_ur) + sheet_id = fields.Many2one( + comodel_name='cgscop.timesheet.sheet', + string="Feuille de temps", + readonly=True, + copy=False) + state = fields.Selection([ + ('draft', 'Brouillon'), + ('submit', 'Soumis'), + ('valid', 'Validé')], + compute='_compute_state', + string='Statut', + copy=False, + index=True, + readonly=True, + store=True,) + + # ------------------------------------------------------ + # Compute Functions + # ------------------------------------------------------ + @api.depends('sheet_id', 'sheet_id.state') + def _compute_state(self): + for timesheet in self: + if not timesheet.sheet_id or timesheet.sheet_id.state == 'draft': + timesheet.state = "draft" + else: + timesheet.state = timesheet.sheet_id.state # ------------------------------------------------------ # OnChange Functions @@ -31,3 +58,29 @@ class ScopHrTimesheet(models.Model): @api.onchange('project_id') def onchange_project_id(self): self.partner_id = self.project_id.partner_id + + # ------------------------------------------------------ + # Actions + # ------------------------------------------------------ + @api.multi + def action_submit_timesheet_lines(self): + if any(time.state != 'draft' or time.sheet_id for time in self): + raise UserError( + "Vous ne pouvez pas insérer 2 fois la même ligne !") + if len(self.mapped('employee_id')) != 1: + raise UserError( + "Il ne peut y avoir plusieurs employés dans une " + "même feuille de temps.") + + return { + 'name': 'New Expense Report', + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'cgscop.timesheet.sheet', + 'target': 'current', + 'context': { + 'default_timesheet_line_ids': self.ids, + 'default_employee_id': self[0].employee_id.id, + 'default_name': self[0].name if len(self) == 1 else '' + } + } diff --git a/wizard/report_hr_timesheet.xml b/report/report_hr_timesheet.xml similarity index 66% rename from wizard/report_hr_timesheet.xml rename to report/report_hr_timesheet.xml index 4e90bfc69b703c70983323f17b4f8878d0b5d9dd..bf9070f928b903ff9715805576bbfd4ec6a648d2 100644 --- a/wizard/report_hr_timesheet.xml +++ b/report/report_hr_timesheet.xml @@ -3,24 +3,30 @@ <data> <template id="report_timesheet_document"> <t t-call="web.external_layout"> - <t t-set="o" t-value="o.with_context(lang=lang)" /> <div class="page"> <h2> - Feuille de Temps + Feuille de Temps <t t-if="o.state == 'draft'"> - Brouillon</t> </h2> + <h3> + <t t-esc="o.name"/> + </h3> <div id="informations" class="row mt32 mb32"> <div class="col-auto mw-100 mb-2" name="employee"> <strong>Employé</strong> - <p class="m-0" t-field="o.user_id.name"/> + <p class="m-0" t-field="o.employee_id.name"/> </div> <div class="col-auto mw-100 mb-2" > - <strong>Date de début</strong> - <p class="m-0" t-field="o.date_start"/> + <strong>Soumis le</strong> + <p class="m-0" t-field="o.submit_date"/> </div> <div class="col-auto mw-100 mb-2" name="date_end"> - <strong>Date de fin</strong> - <p class="m-0" t-field="o.date_end"/> + <strong>Validé le</strong> + <p class="m-0" t-field="o.validation_date"/> + </div> + <div class="col-auto mw-100 mb-2" name="date_end"> + <strong>Total</strong> + <p class="m-0" t-field="o.total_hour" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/> </div> </div> @@ -35,7 +41,7 @@ </tr> </thead> <tbody class="invoice_tbody"> - <t t-foreach="o.timesheet_ids" t-as="line"> + <t t-foreach="o.timesheet_line_ids" t-as="line"> <tr> <td><span t-field="line.date"/></td> <td><span t-field="line.project_id"/></td> @@ -49,31 +55,31 @@ <td /> <td /> <td class="text-right"><strong>Total</strong></td> - <td class="text-right"><strong t-esc="sum(o.timesheet_ids.mapped('unit_amount'))" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/></td> + <td class="text-right"><strong t-esc="o.total_hour" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/></td> </tr> </tbody> </table> + <div t-if="o.state == 'draft'">Cette feuille de temps a été éditée en brouillon.</div> </div> </t> </template> - <template id="report_timesheet"> + <template id="report_timesheet_sheet"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="o"> - <t t-set="lang" t-value="o.user_id.lang"/> - <t t-call="cgscop_timesheet.report_timesheet_document" t-lang="lang"/> + <t t-call="cgscop_timesheet.report_timesheet_document"/> </t> </t> </template> <!-- QWeb Reports --> <report - id="cgscop_timesheet_report" - model="cgscop.timesheet.print" - string="Feuilles de Temps" + id="cgscop_timesheet_sheet_report" + model="cgscop.timesheet.sheet" + string="Feuille de Temps" report_type="qweb-pdf" - name="cgscop_timesheet.report_timesheet" - file="cgscop_timesheet.report_timesheet" + name="cgscop_timesheet.report_timesheet_sheet" + file="cgscop_timesheet.report_timesheet_sheet" menu="False" /> diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index d18c7c4eb8912e34467154451568d76ca087ec56..4e85c8934fae93d8ce127bf5f9b4c3b51b92c077 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -8,3 +8,5 @@ access_project_project_ur_manager,access_project_project_ur,model_project_projec access_project_project_cg_manager,access_project_project_cg,model_project_project,cgscop_partner.group_cg_administrator,1,1,1,1 access_account_analytic_account_ur_manager,access_account_analytic_account_ur,analytic.model_account_analytic_account,cgscop_partner.group_ur_list_modif,1,1,1,1 access_account_analytic_account_cg_manager,access_account_analytic_account_cg,analytic.model_account_analytic_account,cgscop_partner.group_cg_administrator,1,1,1,1 +access_cgscop_timesheet_sheet_user,access_cgscop_timesheet_sheet_user,model_cgscop_timesheet_sheet,hr_timesheet.group_hr_timesheet_user,1,1,1,1 +access_cgscop_timesheet_sheet_manager,access_cgscop_timesheet_sheet_user,model_cgscop_timesheet_sheet,hr_timesheet.group_timesheet_manager,1,1,1,1 diff --git a/views/cgscop_timesheet_sheet.xml b/views/cgscop_timesheet_sheet.xml new file mode 100644 index 0000000000000000000000000000000000000000..91dbf12bcf14823c121582da23a2e26095541f4a --- /dev/null +++ b/views/cgscop_timesheet_sheet.xml @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <!-- + Vues + --> + + <!-- Tree view --> + <record id="view_cgscop_timesheet_sheet_tree" model="ir.ui.view"> + <field name="name">cgscop.timesheet.sheet.tree</field> + <field name="model">cgscop.timesheet.sheet</field> + <field name="arch" type="xml"> + <tree string="Timesheet Reports" decoration-warning="state=='draft'"> + <field name="name" /> + <field name="employee_id"/> + <field name="create_date"/> + <field name="validation_date" /> + <field name="total_hour" sum="Total"/> + <field name="state"/> + </tree> + </field> + </record> + + <!-- Form view --> + <record id="view_cgscop_timesheet_sheet_form" model="ir.ui.view"> + <field name="name">cgscop.timesheet.sheet.form</field> + <field name="model">cgscop.timesheet.sheet</field> + <field eval="25" name="priority"/> + <field name="arch" type="xml"> + <form> + <header> + <button name="action_submit_timesheet" states="draft" string="Soumettre" type="object" class="oe_highlight"/> + <button name="approve_timesheet_sheets" states="submit" string="Valider" type="object" groups="hr_timesheet.group_timesheet_manager" class="oe_highlight"/> + <button name="print_timesheet" string="Imprimer" type="objet" /> + <button name="reset_timesheet_sheets" string="Remettre en brouillon" type="object" attrs="{'invisible': [('state', '=', 'draft')]}" groups="hr_timesheet.group_timesheet_manager"/> + <field name="state" widget="statusbar" statusbar_visible="draft,submit,valid"/> + </header> + <sheet> + <div class="oe_title"> + <label for="name" class="oe_edit_only"/> + <h1> + <field name="name"/> + </h1> + </div> + <group> + <group> + <field name="employee_id" groups="hr_timesheet.group_timesheet_manager"/> + <field name="company_id" groups="base.group_multi_company"/> + </group> + <group> + <field name="create_date" readonly="1"/> + <field name="submit_date" readonly="1"/> + <field name="validation_date" readonly="1"/> + <field name="total_hour" widget="float_time"/> + </group> + </group> + <field name="can_edit" invisible="1"/> + <field name="timesheet_line_ids" widget="many2many" domain="[('sheet_id', '=', False), ('employee_id', '=', employee_id)]" options="{'reload_on_button': True}" attrs="{'readonly': [('can_edit','=', False)]}" context="{'form_view_ref' : 'hr_timesheet.timesheet_view_form_user'}"> + <tree editable="top"> + <field name="date"/> + <field name="employee_id" readonly="1"/> + <field name="state" invisible="1"/> + <field name="sheet_id" invisible="1"/> + <field name="project_id"/> + <field name="partner_id" /> + <field name="name"/> + <field name="unit_amount" widget="float_time" /> + <field name="ur_financial_system_id"/> + </tree> + </field> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers"/> + <field name="activity_ids" widget="mail_activity"/> + <field name="message_ids" widget="mail_thread"/> + </div> + </form> + </field> + </record> + + <!-- Search view --> + <record id="view_cgscop_timesheet_sheet_filter" model="ir.ui.view"> + <field name="name">cgscop.timesheet.sheet.filter</field> + <field name="model">cgscop.timesheet.sheet</field> + <field name="arch" type="xml"> + <search string="Feuille de temps"> + <field name="name"/> + <field name="state"/> + <separator /> + <field name="employee_id"/> + <filter string="Mes feuilles de temps" name="my_reports" domain="[('employee_id.user_id', '=', uid)]"/> + <filter string="Mon équipe" name="my_team_reports" domain="[('employee_id.parent_id.user_id', '=', uid)]" groups="hr_timesheet.group_timesheet_manager" help="Expenses of Your Team Member"/> + <separator /> + <filter domain="[('state', '=', 'draft')]" string="Brouillon" name="draft" /> + <filter domain="[('state', '=', 'submit')]" string="Soumis" name="submitted"/> + <filter domain="[('state', '=', 'valid')]" string="Validé" name="valid"/> + <group expand="0" string="Group By"> + <filter string="Employé" name="employee" domain="[]" context="{'group_by': 'employee_id'}"/> + <filter string="Statut" domain="[]" context="{'group_by': 'state'}" name="state"/> + </group> + </search> + </field> + </record> + + + <!-- + Actions + --> + + <record id="action_cgscop_timesheet_sheet_my_all" model="ir.actions.act_window"> + <field name="name">Mes feuilles de temps</field> + <field name="res_model">cgscop.timesheet.sheet</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="view_cgscop_timesheet_sheet_filter"/> + <field name="domain">[('employee_id.user_id', '=', uid)]</field> + <field name="context">{'search_default_my_reports': 1}</field> + </record> + + <record id="action_cgscop_timesheet_sheet_to_approve" model="ir.actions.act_window"> + <field name="name">Feuilles de temps à valider</field> + <field name="res_model">cgscop.timesheet.sheet</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="view_cgscop_timesheet_sheet_filter"/> + <field name="domain">[]</field> + <field name="context">{'search_default_submitted': 1}</field> + </record> + + <record id="action_cgscop_timesheet_sheet_all" model="ir.actions.act_window"> + <field name="name">Toutes les feuilles de temps</field> + <field name="res_model">cgscop.timesheet.sheet</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="view_cgscop_timesheet_sheet_filter"/> + <field name="domain">[]</field> + <field name="context">{}</field> + </record> + + + + <!-- + Menus + --> + + <menuitem id="timesheet_sheet_menu" + parent="hr_timesheet.timesheet_menu_root" + name="Feuilles de temps" + sequence="25"/> + + <menuitem id="menu_hr_timesheet_my_timesheet" + name="Mes feuilles de temps" + sequence="1" + action="cgscop_timesheet.action_cgscop_timesheet_sheet_my_all" + parent="cgscop_timesheet.timesheet_sheet_menu"/> + + <menuitem id="menu_hr_timesheet_to_approve" + name="À valider" + sequence="1" + action="cgscop_timesheet.action_cgscop_timesheet_sheet_to_approve" + parent="cgscop_timesheet.timesheet_sheet_menu" + groups="hr_timesheet.group_timesheet_manager"/> + + <menuitem id="menu_hr_timesheet_all" + name="Toutes les feuilles de temps" + sequence="1" + action="cgscop_timesheet.action_cgscop_timesheet_sheet_all" + parent="cgscop_timesheet.timesheet_sheet_menu" + groups="hr_timesheet.group_timesheet_manager"/> + +</odoo> diff --git a/views/hr_timesheet.xml b/views/hr_timesheet.xml index 6d08fe03db40e6882d341603048021181fa55495..b46261fe5a5b0872856bfe795eb7539ccdd143c3 100644 --- a/views/hr_timesheet.xml +++ b/views/hr_timesheet.xml @@ -5,12 +5,20 @@ <odoo> <data noupdate="0"> + <!-- + Vues + --> <record id="cgscop_hr_timesheet_line_search" model="ir.ui.view"> <field name="name">cgscop.hr.timesheet.line.search</field> <field name="model">account.analytic.line</field> <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/> <field name="arch" type="xml"> <field name="task_id" position="replace"/> + <xpath expr="//filter[@name='mine']" position="after"> + <separator></separator> + <filter domain="[('sheet_id', '=', False)]" string="A soumettre" name="no_report"/> + <filter domain="[('sheet_id', '!=', False)]" string="Soumis" name="submitted"/> + </xpath> <xpath expr="//filter[@name='groupby_task']" position="replace"> <filter string="Contact" name="groupby_partner" domain="[]" context="{'group_by':'partner_id'}"/> </xpath> @@ -38,6 +46,9 @@ <field name="task_id" position="attributes"> <attribute name="invisible">True</attribute> </field> + <field name="amount" position="attributes"> + <attribute name="invisible">True</attribute> + </field> </field> </record> @@ -53,7 +64,7 @@ <attribute name="string">Code activité UR</attribute> </field> <field name="project_id" position="after" > - <field name="partner_id" domain="[('is_company', '=', True)]" required="True" class="td-ellipsis" options="{'no_open': True, 'no_create': True}" string="Contact"/> + <field name="partner_id" domain="[('is_company', '=', True)]" required="True" class="td-ellipsis" options="{'no_open': True, 'no_create': True}" context="{'search_default_my_ur': True,}" string="Contact"/> <field name="name" class="td-minwidth" /> </field> <field name="task_id" position="attributes"> @@ -64,6 +75,7 @@ </field> <field name="unit_amount" position="after"> <field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}"/> + <field name="state" /> </field> </field> </record> @@ -82,26 +94,19 @@ </field> </record> + + <!-- + Actions + --> + <!-- Hérite l'action de la fenetre --> + <record id="hr_timesheet.menu_hr_time_tracking" model="ir.actions.act_window"> + <field name="name">Lignes de temps</field> + </record> <record id="hr_timesheet.act_hr_timesheet_line" model="ir.actions.act_window"> <field name="name">Mes lignes de temps</field> <field name="view_mode">tree,form,pivot,graph</field> - </record> - <record id="hr_timesheet.timesheet_action_all" model="ir.actions.act_window"> - <field name="name">Toutes les lignes de temps</field> - </record> - - - <!-- ajoute des droits sur le menu Configuration --> - <record model="ir.ui.menu" id="hr_timesheet.hr_timesheet_menu_configuration"> - <field name="groups_id" eval="[(6,0, [ref('hr_timesheet.group_timesheet_manager'), ref('cgscop_partner.group_cg_administrator'), ref('cgscop_partner.group_ur_list_modif')])]"/> - </record> - <!-- ajoute des droits pour gestionnaire uniquement sur le menu Toutes les feuilles de temps --> - <record model="ir.ui.menu" id="hr_timesheet.timesheet_menu_activity_all"> - <field name="groups_id" eval="[(6,0, [ref('hr_timesheet.group_timesheet_manager'), ref('cgscop_partner.group_cg_administrator')])]"/> - </record> - <record model="ir.ui.menu" id="hr_timesheet.timesheet_menu_report_timesheet_by_project"> - <field name="name">Par code activité UR</field> + <field name="context">{'search_default_no_report': 1}</field> </record> <!-- Report View per Contact --> @@ -117,11 +122,39 @@ (0, 0, {'view_mode': 'form', 'sequence': 15, 'view_id': ref('cgscop_timesheet.view_cgscop_hr_timesheet_line_form')})]"/> </record> + <record id="hr_timesheet_submit_action_server" model="ir.actions.server"> + <field name="name">Insérer dans une feuille de temps</field> + <field name="type">ir.actions.server</field> + <field name="model_id" ref="model_account_analytic_line"/> + <field name="binding_model_id" ref="model_account_analytic_line"/> + <field name="state">code</field> + <field name="code"> +if records: + action = records.action_submit_timesheet_lines() + </field> + </record> + + + <!-- + Menus + --> + <!-- ajoute des droits sur le menu Configuration --> + <record model="ir.ui.menu" id="hr_timesheet.hr_timesheet_menu_configuration"> + <field name="groups_id" eval="[(6,0, [ref('hr_timesheet.group_timesheet_manager'), ref('cgscop_partner.group_cg_administrator'), ref('cgscop_partner.group_ur_list_modif')])]"/> + </record> + <!-- ajoute des droits pour gestionnaire uniquement sur le menu Toutes les feuilles de temps --> + <record model="ir.ui.menu" id="hr_timesheet.timesheet_menu_activity_all"> + <field name="groups_id" eval="[(6,0, [ref('hr_timesheet.group_timesheet_manager'), ref('cgscop_partner.group_cg_administrator')])]"/> + </record> + <menuitem id="timesheet_menu_report_timesheet_by_contact" parent="hr_timesheet.menu_timesheets_reports_timesheet" action="timesheet_action_report_by_contact" name="Par Contact" sequence="25"/> + + + </data> <data noupdate="1"> <delete id="hr_timesheet.timesheet_menu_report_timesheet_by_task" model="ir.ui.menu"/>/> diff --git a/wizard/__init__.py b/wizard/__init__.py deleted file mode 100644 index c23811f435b5e1f64fa475979e5177fbb95f5db0..0000000000000000000000000000000000000000 --- a/wizard/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from . import print_timesheet diff --git a/wizard/print_timesheet.py b/wizard/print_timesheet.py deleted file mode 100644 index afccb1f4f013de215fec3d74ce2db93cbdea2636..0000000000000000000000000000000000000000 --- a/wizard/print_timesheet.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2019 Le Filament (<http://www.le-filament.com>) -# License AGPL-3 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import models, fields, api - - -class CGscopTimesheetPrintWizard(models.TransientModel): - _name = "cgscop.timesheet.print" - _description = "Wizard Timesheet Impression" - - date_start = fields.Date('Date de début', required=True) - date_end = fields.Date('Date de fin', required=True) - user_id = fields.Many2one( - comodel_name="res.users", - string="Employé", - default=lambda self: self.env.user, - required=True) - timesheet_ids = fields.Many2many( - comodel_name="account.analytic.line") - - @api.multi - def print_timesheet(self): - self.timesheet_ids = self.env['account.analytic.line'].sudo().search([ - ['user_id', '=', self.user_id.id], - ['date', '>=', self.date_start], - ['date', '<=', self.date_end]]) - - return self.env.ref( - 'cgscop_timesheet.cgscop_timesheet_report').report_action(self) diff --git a/wizard/print_timesheet.xml b/wizard/print_timesheet.xml deleted file mode 100644 index f8673d0fec86f180390a5e465d74141cd420611d..0000000000000000000000000000000000000000 --- a/wizard/print_timesheet.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<odoo> - <record id="cgscop_timesheet_print_view_form" model="ir.ui.view"> - <field name="name">cgscop.timesheet.print.form</field> - <field name="model">cgscop.timesheet.print</field> - <field name="arch" type="xml"> - <form string="Impression feuille de temps"> - <group> - <group> - <field name="date_start"/> - </group> - <group> - <field name="date_end"/> - </group> - </group> - <group> - <group> - <field name="user_id" /> - </group> - </group> - <footer> - <button class="btn btn-sm btn-primary" name="print_timesheet" string="Imprimer" type="object"/> - <button class="btn btn-sm btn-default" special="cancel" string="Fermer"/> - </footer> - </form> - </field> - </record> - - <record id="cgscop_timesheet_print_action" model="ir.actions.act_window"> - <field name="name">Imprimer Feuille de Temps</field> - <field name="type">ir.actions.act_window</field> - <field name="res_model">cgscop.timesheet.print</field> - <field name="view_mode">form</field> - <field name="view_id" ref="cgscop_timesheet_print_view_form"/> - <field name="target">new</field> - </record> - - <menuitem action="cgscop_timesheet_print_action" id="menu_cgscop_timesheet_print" name="Imprimer Feuille de Temps" parent="hr_timesheet.menu_hr_time_tracking" sequence="50" /> -</odoo>