From 507473b99dcdf36467832cefb3e9164214c35589 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Wed, 9 Aug 2017 14:55:17 +0200 Subject: [PATCH] [ADD][WIP]Yaltik CRM Action, inspired from OCA CRM Action and work for Yaltik customers --- yaltik_crm_action/__init__.py | 18 + yaltik_crm_action/__manifest__.py | 36 ++ yaltik_crm_action/fr.po | 536 ++++++++++++++++++ yaltik_crm_action/models/calendar_event.py | 28 + yaltik_crm_action/models/crm_action.py | 129 +++++ yaltik_crm_action/models/crm_lead.py | 55 ++ yaltik_crm_action/models/res_partner.py | 31 + .../security/ir.model.access.csv | 5 + yaltik_crm_action/security/ir_rule_data.xml | 38 ++ .../security/res_groups_data.xml | 42 ++ yaltik_crm_action/views/calendar_views.xml | 39 ++ yaltik_crm_action/views/crm_action_views.xml | 188 ++++++ yaltik_crm_action/views/crm_lead_views.xml | 135 +++++ yaltik_crm_action/views/res_partner_views.xml | 33 ++ 14 files changed, 1313 insertions(+) create mode 100644 yaltik_crm_action/__init__.py create mode 100644 yaltik_crm_action/__manifest__.py create mode 100644 yaltik_crm_action/fr.po create mode 100644 yaltik_crm_action/models/calendar_event.py create mode 100644 yaltik_crm_action/models/crm_action.py create mode 100644 yaltik_crm_action/models/crm_lead.py create mode 100644 yaltik_crm_action/models/res_partner.py create mode 100644 yaltik_crm_action/security/ir.model.access.csv create mode 100644 yaltik_crm_action/security/ir_rule_data.xml create mode 100644 yaltik_crm_action/security/res_groups_data.xml create mode 100644 yaltik_crm_action/views/calendar_views.xml create mode 100644 yaltik_crm_action/views/crm_action_views.xml create mode 100644 yaltik_crm_action/views/crm_lead_views.xml create mode 100644 yaltik_crm_action/views/res_partner_views.xml diff --git a/yaltik_crm_action/__init__.py b/yaltik_crm_action/__init__.py new file mode 100644 index 0000000..82314be --- /dev/null +++ b/yaltik_crm_action/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from . import models diff --git a/yaltik_crm_action/__manifest__.py b/yaltik_crm_action/__manifest__.py new file mode 100644 index 0000000..201ec7a --- /dev/null +++ b/yaltik_crm_action/__manifest__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +{ + 'name': 'CRM Actions', + 'summary': 'Action management, instead of new activity, in CRM', + 'version': '10.0.1.0.0', + 'category': 'Sales', + 'author': 'Fabien BOURGEOIS - Yaltik', + 'license': 'AGPL-3', + 'installable': True, + 'application': True, + 'depends': ['crm', 'calendar'], + 'data': ['views/crm_action_views.xml', + 'views/crm_lead_views.xml', + 'views/res_partner_views.xml', + 'views/calendar_views.xml', + 'security/ir.model.access.csv', + 'security/ir_rule_data.xml', + 'security/res_groups_data.xml', + 'security/ir.model.access.csv'], +} diff --git a/yaltik_crm_action/fr.po b/yaltik_crm_action/fr.po new file mode 100644 index 0000000..f88c969 --- /dev/null +++ b/yaltik_crm_action/fr.po @@ -0,0 +1,536 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * yaltik_crm_action +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-23 17:16+0000\n" +"PO-Revision-Date: 2017-06-23 17:16+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" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Action Type" +msgstr "Type d'action" + +#. module: yaltik_crm_action +#: model:ir.actions.act_window,name:yaltik_crm_action.action_crm_action_type_view +#: model:ir.ui.menu,name:yaltik_crm_action.menu_crm_action_type_act +msgid "Action Types" +msgstr "Types d'action" + +#. module: yaltik_crm_action +#: model:ir.actions.act_window,name:yaltik_crm_action.action_crm_action_view +#: model:ir.actions.act_window,name:yaltik_crm_action.crm_action_simple_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_lead_action_ids +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_action_button_form_view +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_form_view_oppor +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_action_form +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_calendar +msgid "Actions" +msgstr "Actions" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_lead_actions_count +msgid "Actions count" +msgstr "Nombre d'actions" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Actions done by me" +msgstr "Actions faites par moi" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_active +msgid "Active" +msgstr "Actif" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_action_form +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_action_tree +msgid "Back to Todo" +msgstr "Retour vers \"à faire\"" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_crm_action +msgid "CRM Action" +msgstr "CRM Action" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_crm_action_type +msgid "CRM Action Type" +msgstr "CRM Type d'action" + +#. module: yaltik_crm_action +#: selection:crm.action,state:0 +msgid "Canceled" +msgstr "Annulé" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_company_id +msgid "Company" +msgstr "Société" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_create_uid +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_create_date +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_partner_id +msgid "Customer" +msgstr "Client" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_date +msgid "Date" +msgstr "Date " + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_details +msgid "Details" +msgstr "Détails" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_display_name +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: yaltik_crm_action +#: selection:crm.action,state:0 +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Done" +msgstr "Terminé" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Group By" +msgstr "Grouper par" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_id +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_id +msgid "ID" +msgstr "ID" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action___last_update +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_write_uid +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_write_date +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_lead_id +msgid "Lead" +msgstr "Piste/Opportunité" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Piste/opportunité" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_crm_lead +msgid "Lead adaptations for marketresearch" +msgstr "Lead adaptations for marketresearch" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_opp_search +msgid "Lost" +msgstr "Perdu" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_action_form +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_action_tree +msgid "Mark as Done" +msgstr "Marquer comme terminé" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_action_button_form_view +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_form_view_oppor +msgid "Mark next action as done" +msgstr "Marquer la prochaine action comme terminée" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "My Actions" +msgstr "Mes Actions" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_name +msgid "Name" +msgstr "Nom" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_lead_next_action_id +msgid "Next Action" +msgstr "Action suivante" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_res_partner +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Partner" +msgstr "Compte" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_type_priority +msgid "Priority" +msgstr "Priorité" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_type_filter +msgid "Search Action Types" +msgstr "Chercher des types d'action" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Search Actions" +msgstr "Chercher des actions" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_state +msgid "Status" +msgstr "Statut" + +#. module: yaltik_crm_action +#: selection:crm.action,state:0 +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Todo" +msgstr "À faire" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Todo Today" +msgstr "À faire aujourd'hui" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_action_type_id +msgid "Type" +msgstr "Type" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_user_id +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "User" +msgstr "Utilisateur" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.view_crm_action_filter +msgid "Week" +msgstr "Semaine" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_opp_search +msgid "Won" +msgstr "Gagné" + +#. module: crm +#: model:ir.actions.act_window,name:crm.crm_lead_action_activities +#: model:ir.ui.menu,name:crm.crm_lead_menu_activities +msgid "Next Activities" +msgstr "Actions" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_action_id +msgid "Action" +msgstr "Action" + +#. module: yaltik_crm_action +#: model:ir.ui.menu,name:yaltik_crm_action.action_config_menu +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_form +msgid "Actions" +msgstr "Actions" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_yaltik_crm_action_cancel_reason +msgid "Ask a reason for action cancelling" +msgstr "Demande une raison pour l'annulation de l'action" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_form +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_tree +msgid "Back to Todo" +msgstr "Retour vers \"à faire\"" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_crm_action +msgid "CRM Action" +msgstr "CRM Action" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_event_id +msgid "Calendar event" +msgstr "Événement du calendrier" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.cancel_reason_wizard_form +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_form +msgid "Cancel" +msgstr "Annuler" + +#. module: yaltik_crm_action +#: code:addons/yaltik_crm_action/models/crm_action.py:44 +#, python-format +msgid "Cancel action" +msgstr "Annuler l'action" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_cancel_reason +msgid "Cancel reason" +msgstr "Motif d'annulation" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.cancel_reason_wizard_form +msgid "Cancel reason for action" +msgstr "Raison pour l'annulation de l'action" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.cancel_reason_wizard_form +msgid "Confirm" +msgstr "Confirmer" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_form +msgid "Create linked event" +msgstr "Inclure au calendrier" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_form_view_leads_next_actions +#: model:ir.ui.view,arch_db:yaltik_crm_action.crm_case_form_view_oppor_next_action +msgid "Create next action" +msgstr "Créer la prochaine action" + +#. module: yaltik_crm_action +#: code:addons/yaltik_crm_action/models/crm_action.py:100 +#, python-format +msgid "Create the next Action" +msgstr "Créer la prochaine action" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_calendar_event +msgid "Event" +msgstr "Évènement" + +#. module: yaltik_crm_action +#: selection:crm.action,priority:0 +msgid "High" +msgstr "Haut" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_id +msgid "ID" +msgstr "ID" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: yaltik_crm_action +#: model:ir.model,name:yaltik_crm_action.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Piste/Opportunité" + +#. module: yaltik_crm_action +#: code:addons/yaltik_crm_action/models/crm_action.py:72 +#, python-format +msgid "Linked event" +msgstr "Événement du calendrier" + +#. module: yaltik_crm_action +#: selection:crm.action,priority:0 +msgid "Low" +msgstr "Bas" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_form +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_tree +msgid "Mark as Done" +msgstr "Marquer comme terminé" + +#. module: yaltik_crm_action +#: selection:crm.action,priority:0 +msgid "Medium" +msgstr "Moyen" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_action_type_name +msgid "Name" +msgstr "Nom" + +#. module: yaltik_crm_action +#: selection:crm.action,priority:0 +msgid "Not evaluated" +msgstr "Non évalué" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_open_reason +msgid "Open reason" +msgstr "Motif de l'action" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_calendar_event_partner_location_id +msgid "Partner location" +msgstr "Chez le compte" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_priority +#: model:ir.ui.view,arch_db:yaltik_crm_action.action_search +msgid "Priority" +msgstr "Priorité" + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_yaltik_crm_action_cancel_reason_reason +msgid "Reason" +msgstr "Motif" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.new_action_form +msgid "Remove linked event" +msgstr "Supprimer du calendrier" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.action_search +msgid "State" +msgstr "État" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.action_search +msgid "Todo within 30 days" +msgstr "À faire les 30 jours" + +#. module: yaltik_crm_action +#: model:ir.ui.view,arch_db:yaltik_crm_action.action_search +msgid "Todo within 7 days" +msgstr "À faire dans les 7 jours" + +#. module: yaltik_crm_action +#: selection:crm.action,priority:0 +#: model:ir.ui.view,arch_db:yaltik_crm_action.action_search +msgid "Urgent" +msgstr "Urgent" + +#. module: yaltik_crm_action +#: code:addons/yaltik_crm_action/models/crm_action.py:36 +#, python-format +msgid "When cancelling, you must provide a reason." +msgstr "Quand vous annulez, vous devez fournir une raison." + + +#. module: yaltik_crm_action +#: model:ir.model.fields,field_description:yaltik_crm_action.field_crm_action_details +msgid "Details" +msgstr "Pourquoi ?" + +#. module: crm +#: model:ir.model.fields,field_description:crm.field_crm_opportunity_report_nbr_activities +msgid "# of Activities" +msgstr "Nb. d'actions" + +#. module: crm +#: model:ir.ui.view,arch_db:crm.crm_activity_log_view_form_schedule +msgid "Recommended activities:" +msgstr "Actions recommandées:" + +#. module: crm +#: model:ir.actions.act_window,name:crm.crm_activity_action +#: model:ir.model.fields,field_description:crm.field_res_partner_activities_count +#: model:ir.model.fields,field_description:crm.field_res_users_activities_count +#: model:ir.ui.menu,name:crm.crm_activity_menu +#: model:ir.ui.menu,name:crm.crm_activity_report_menu +#: model:ir.ui.view,arch_db:crm.crm_activity_view_form +#: model:ir.ui.view,arch_db:crm.crm_activity_view_tree +#: model:ir.ui.view,arch_db:crm.view_partners_form_crm1 +msgid "Activities" +msgstr "Actions" + +#. module: crm +#: model:ir.actions.act_window,name:crm.crm_activity_report_action +#: model:ir.actions.act_window,name:crm.crm_activity_report_action_team +#: model:ir.ui.view,arch_db:crm.crm_activity_report_view_graph +#: model:ir.ui.view,arch_db:crm.crm_activity_report_view_pivot +#: model:ir.ui.view,arch_db:crm.crm_activity_report_view_search +#: model:ir.ui.view,arch_db:crm.crm_team_salesteams_view_kanban +msgid "Activities Analysis" +msgstr "Analyse des actions" + +#. module: crm +#: model:ir.model.fields,field_description:crm.field_crm_activity_log_next_activity_id +#: model:ir.model.fields,field_description:crm.field_crm_activity_report_subtype_id +msgid "Activity" +msgstr "Action" + +#. module: crm +#: code:addons/crm/wizard/crm_activity_log.py:80 +#, python-format +msgid "Activity Done" +msgstr "Action faite" + +#. module: crm +#: model:ir.model.fields,field_description:crm.field_crm_lead_kanban_state +msgid "Activity State" +msgstr "État de l'action" + +#. module: crm +#: model:ir.actions.act_window,name:crm.crm_lead_action_activities +msgid "Next Activities" +msgstr "Actions suivantes" + +#. module: crm +#: model:ir.model.fields,field_description:crm.field_crm_lead_next_activity_id +#: model:ir.ui.view,arch_db:crm.crm_lead_view_tree_activity +msgid "Next Activity" +msgstr "Action suivante" diff --git a/yaltik_crm_action/models/calendar_event.py b/yaltik_crm_action/models/calendar_event.py new file mode 100644 index 0000000..ffa4162 --- /dev/null +++ b/yaltik_crm_action/models/calendar_event.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +""" Calendar Event adaptations """ + +from odoo import models, fields + + +class CalendarEvent(models.Model): + """ Calendar Event adaptations """ + _inherit = 'calendar.event' + + partner_location_id = fields.Many2one('res.partner', 'Partner location') diff --git a/yaltik_crm_action/models/crm_action.py b/yaltik_crm_action/models/crm_action.py new file mode 100644 index 0000000..5805f1d --- /dev/null +++ b/yaltik_crm_action/models/crm_action.py @@ -0,0 +1,129 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +""" CRM Action """ + +from odoo import models, fields, api, _ + + +class CrmAction(models.Model): + """ CRM Action """ + _name = 'crm.action' + _description = 'CRM Action' + _rec_name = 'display_name' + + display_name = fields.Char(compute='_compute_display_name', store=True) + + state = fields.Selection(selection_add=[('cancel', 'Canceled')]) + priority = fields.Selection([('0', 'Not evaluated'), ('1', 'Low'), + ('2', 'Medium'), ('3', 'High'), + ('4', 'Urgent')], + string='Priority', default='0', index=True) + + partner_id = fields.Many2one('res.partner', string='Customer', index=True) + date = fields.Date('Date', required=True, default=fields.Date.context_today) + user_id = fields.Many2one('res.users', string='User', required=True, + default=lambda self: self.env.user) + lead_id = fields.Many2one('crm.lead', string='Lead', ondelete='cascade') + event_id = fields.Many2one('calendar.event', 'Calendar event', ondelete='cascade') + action_type_id = fields.Many2one('crm.action.type', string='Type', required=True) + action_type_name = fields.Char(related='action_type_id.name') + + @api.onchange('lead_id') + def onchange_lead(self): + """ If lead change, adapts partner """ + for action in self: + if action.lead_id and action.lead_id.partner_id: + action.partner_id = action.lead_id.partner_id + + @api.depends('action_type_id.name', 'details') + def _compute_display_name(self): + for action in self: + action.display_name = u'[{}]{}'.format(action.action_type_name, + action.details or u'') + + @api.multi + def confirm(self): + """ Changes state to done """ + self.state = 'done' + + @api.multi + def set_to_draft(self): + """ Changes state to draft """ + self.state = 'draft' + + @api.multi + def cancel(self): + """ Cancel action """ + self.ensure_one() + action = self[0] + return {'type': 'ir.actions.act_window', + 'name': _('Cancel action'), + 'res_model': 'dalby.crm.action.cancel.reason', + 'view_mode': 'form', + 'view_type': 'form', + 'target': 'new', + 'context': {'default_action_id': action.id}} + + @api.multi + def create_linked_event(self): + """ Creates a linked event """ + for action in self: + if not action.event_id: + attendees = [action.user_id.partner_id.id] + if action.partner_id: + attendees.append(action.partner_id.id) + title = u'{} : {}'.format(action.action_type_name, + action.open_reason) + data = {'start': action.date, + 'stop': action.date, + 'duration': 1.0, + 'allday': False, + 'name': title, + 'description': action.details, + 'privacy': 'confidential', + 'partner_ids': [(6, False, attendees)], + 'partner_location_id': action.partner_id.id or False} + action.event_id = self.env['calendar.event'].create(data) + return {'type': 'ir.actions.act_window', + 'name': _('Linked event'), + 'res_model': 'calendar.event', + 'res_id': action.event_id.id, + 'view_mode': 'form', + 'view_type': 'form', + 'flags': {'initial_mode': 'edit'}} + + @api.multi + def remove_linked_event(self): + """ Removes linked event and deletes it """ + for action in self: + if action.event_id: + event = action.event_id + action.event_id = False + event.unlink() + + +class CrmActionType(models.Model): + """ CRM Action Type """ + _name = 'crm.action.type' + _description = 'CRM Action Type' + _order = 'priority' + + name = fields.Char('Name', required=True) + priority = fields.Integer('Priority', required=True, default=0) + active = fields.Boolean('Active', default=True) diff --git a/yaltik_crm_action/models/crm_lead.py b/yaltik_crm_action/models/crm_lead.py new file mode 100644 index 0000000..e0b272c --- /dev/null +++ b/yaltik_crm_action/models/crm_lead.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +""" CRM Lead adaptations """ + +from odoo import models, fields, api + + +class CrmLead(models.Model): + """ CRM Lead adaptations """ + _inherit = 'crm.lead' + + action_count = fields.Integer(compute='_compute_action_count') + action_ids = fields.One2many('crm.action', 'lead_id', string='Actions') + next_action_id = fields.Many2one('crm.action', string='Next Action', + compute='compute_next_action', store=True) + next_action_date = fields.Date(related='next_action_id.date', store=True) + next_action_title = fields.Char(related='next_action_id.display_name', store=True) + + @api.multi + def _compute_action_count(self): + """ Count actions """ + for lead in self: + lead.actions_count = len(lead.action_ids) + + @api.depends('action_ids.date', 'action_ids.display_name', 'action_ids.state') + def compute_next_action(self): + """ Computes next action """ + for lead in self: + domain = ['&', ('lead_id', '=', lead.id), ('state', '=', 'draft')] + action = self.env['crm.action'].search(domain, order='date', limit=1) + lead.next_action_id = action or False + + @api.multi + def next_action_done(self): + """ Mark next action as done """ + self.ensure_one() + lead = self[0] + if lead.next_action_id: + lead.next_action_id.confirm() diff --git a/yaltik_crm_action/models/res_partner.py b/yaltik_crm_action/models/res_partner.py new file mode 100644 index 0000000..73004d3 --- /dev/null +++ b/yaltik_crm_action/models/res_partner.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Fabien Bourgeois +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +""" Partner adaptations """ + +from odoo import models, api + +class ResPartner(models.Model): + """ Partner adaptations """ + _inherit = 'res.partner' + + @api.multi + def _compute_activities_count(self): + for partner in self: + domain = [('partner_id', '=', partner.id)] + partner.activities_count = self.env['crm.action'].search_count(domain) diff --git a/yaltik_crm_action/security/ir.model.access.csv b/yaltik_crm_action/security/ir.model.access.csv new file mode 100644 index 0000000..108e9f8 --- /dev/null +++ b/yaltik_crm_action/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_crm_action_user,CRM Action User,model_crm_action,sales_team.group_sale_salesman,1,1,1,0 +access_crm_action_manager,CRM Action Manager,model_crm_action,sales_team.group_sale_manager,1,1,1,1 +access_crm_action_type_user,CRM Action Type User,model_crm_action_type,base.group_user,1,0,0,0 +access_crm_action_type_manager,CRM Action Type Manager,model_crm_action_type,sales_team.group_sale_manager,1,1,1,1 diff --git a/yaltik_crm_action/security/ir_rule_data.xml b/yaltik_crm_action/security/ir_rule_data.xml new file mode 100644 index 0000000..6713ea8 --- /dev/null +++ b/yaltik_crm_action/security/ir_rule_data.xml @@ -0,0 +1,38 @@ + + + + + + + + + + Personal CRM Actions + + ['|', ('lead_id.user_id', '=', user.id), ('user_id', '=', user.id)] + + + + All CRM Actions + + [(1, '=', 1)] + + + + + diff --git a/yaltik_crm_action/security/res_groups_data.xml b/yaltik_crm_action/security/res_groups_data.xml new file mode 100644 index 0000000..1b70032 --- /dev/null +++ b/yaltik_crm_action/security/res_groups_data.xml @@ -0,0 +1,42 @@ + + + + + + + + + CRM Action User + + + + + CRM Action Manager + + + + + + + + + + + diff --git a/yaltik_crm_action/views/calendar_views.xml b/yaltik_crm_action/views/calendar_views.xml new file mode 100644 index 0000000..0080bb1 --- /dev/null +++ b/yaltik_crm_action/views/calendar_views.xml @@ -0,0 +1,39 @@ + + + + + + + + + + CRM Action calendar adaptations + calendar.event + + + + + + + {'readonly': [('partner_location_id', '!=', False)]} + + + + + + diff --git a/yaltik_crm_action/views/crm_action_views.xml b/yaltik_crm_action/views/crm_action_views.xml new file mode 100644 index 0000000..65ee6ae --- /dev/null +++ b/yaltik_crm_action/views/crm_action_views.xml @@ -0,0 +1,188 @@ + + + + + + + + + + CRM Action Form + crm.action + +
+
+
+ + + + + + + + + + + + +
+
+
+ + CRM Action Type Form + crm.action.type + +
+ + + + + + + +
+
+
+ + + + CRM Action Tree + crm.action + + + + + + + + + + + + + + + + Opportunity form adaptations + crm.lead + + + +
+ +
+ + + + + + + +
+
+ + + + CRM Lead Kanban adaptations + crm.lead + + + + %(crm_action_simple_action)d" + + + %(crm_action_simple_action)d" + + + + + + + CRM Lead Tree Activity adaptations + crm.lead + + + + + + + + + + + + CRM Opportunity Search adaptations + crm.lead + + + + + + + + + + + + + + +
+
diff --git a/yaltik_crm_action/views/res_partner_views.xml b/yaltik_crm_action/views/res_partner_views.xml new file mode 100644 index 0000000..f98bd1c --- /dev/null +++ b/yaltik_crm_action/views/res_partner_views.xml @@ -0,0 +1,33 @@ + + + + + + + + + + Actions + crm.action + tree,form,calendar + {'search_default_partner_id': active_id} + + + +