[ADD][WIP]Yaltik CRM Action, inspired from OCA CRM Action and work for Yaltik customers

This commit is contained in:
Fabien BOURGEOIS 2017-08-09 14:55:17 +02:00
parent b93a4e7343
commit 507473b99d
14 changed files with 1313 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2017 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/>.
from . import models

View File

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# Copyright 2017 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/>.
{
'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'],
}

536
yaltik_crm_action/fr.po Normal file
View File

@ -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 "<strong>Recommended activities:</strong>"
msgstr "<strong>Actions recommandées:</strong>"
#. 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"

View File

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# Copyright 2017 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/>.
""" 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')

View File

@ -0,0 +1,129 @@
# -*- coding: utf-8 -*-
# Copyright 2017 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/>.
""" 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)

View File

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
# Copyright 2017 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/>.
""" 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()

View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Copyright 2017 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/>.
""" 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)

View File

@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_crm_action_user CRM Action User model_crm_action sales_team.group_sale_salesman 1 1 1 0
3 access_crm_action_manager CRM Action Manager model_crm_action sales_team.group_sale_manager 1 1 1 1
4 access_crm_action_type_user CRM Action Type User model_crm_action_type base.group_user 1 0 0 0
5 access_crm_action_type_manager CRM Action Type Manager model_crm_action_type sales_team.group_sale_manager 1 1 1 1

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 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 noupdate="1">
<record id="crm_rule_personal_action" model="ir.rule">
<field name="name">Personal CRM Actions</field>
<field ref="model_crm_action" name="model_id" />
<field name="domain_force">['|', ('lead_id.user_id', '=', user.id), ('user_id', '=', user.id)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>
<record id="crm_rule_all_action" model="ir.rule">
<field name="name">All CRM Actions</field>
<field ref="model_crm_action" name="model_id" />
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"/>
</record>
</data>
</odoo>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 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 noupdate="1">
<record id="group_crm_action_user" model="res.groups">
<field name="name">CRM Action User</field>
<field name="category_id"
ref="base.module_category_customer_relationship_management" />
</record>
<record id="group_crm_action_manager" model="res.groups">
<field name="name">CRM Action Manager</field>
<field name="category_id"
ref="base.module_category_customer_relationship_management" />
<field name="users" eval="[(4, ref('base.user_root'))]"/>
<field name="implied_ids" eval="[(4, ref('group_crm_action_user'))]" />
</record>
<record id="sales_team.group_sale_salesman" model="res.groups">
<field name="implied_ids" eval="[(4, ref('group_crm_action_user'))]" />
</record>
</data>
</odoo>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 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 id="calendar_form" model="ir.ui.view">
<field name="name">CRM Action calendar adaptations</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_form" />
<field name="arch" type="xml">
<field name="location" position="before">
<field name="partner_location_id" options="{'no_create': True}" />
</field>
<field name="location" position="attributes">
<attribute name="attrs">{'readonly': [('partner_location_id', '!=', False)]}</attribute>
</field>
</field>
</record>
</data>
</odoo>

View File

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 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 id="crm_action_form" model="ir.ui.view">
<field name="name">CRM Action Form</field>
<field name="model">crm.action</field>
<field name="arch" type="xml">
<form string="Actions">
<header>
<button string="Mark as Done" name="button_confirm" type="object"
states="draft" class="oe_highlight"/>
<button string="Back to Todo" name="button_set_to_draft"
type="object" states="done"/>
<button name="cancel" string="Cancel" type="object"
attrs="{'invisible': [('state', '=', 'cancel')]}" />
<button name="create_linked_event" string="Create linked event"
type="object" class="oe_highlight"
attrs="{'invisible': ['|', (['event_id', '!=', False]),
('state', '=', 'cancel')]}" />
<button name="remove_linked_event" string="Remove linked event"
type="object" class="oe_highlight"
attrs="{'invisible': [(['event_id', '=', False])]}" />
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<field name="action_type_id" />
<field name="date" />
<field name="event_id" readonly="1"
attrs="{'invisible': [('event_id', '=', False)]}" />
<field name="priority" widget="priority" />
<field name="details" width="200" />
<field name="lead_id" />
<field name="partner_id" />
<field name="user_id" />
</group>
</sheet>
</form>
</field>
</record>
<record id="crm_action_type_form" model="ir.ui.view">
<field name="name">CRM Action Type Form</field>
<field name="model">crm.action.type</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name" />
<field name="priority" />
<field name="active "/>
</group>
</sheet>
</form>
</field>
</record>
<!-- Trees -->
<record id="crm_action_tree" model="ir.ui.view">
<field name="name">CRM Action Tree</field>
<field name="model">crm.action</field>
<field name="arch" type="xml">
<tree colors="red:date &lt; current_date and state=='draft';blue:date &gt;= current_date and state=='draft';gray: state == 'cancel'">
<field name="action_type_id" />
<field name="priority" />
<field name="date" />
<field name="lead_id" />
<field name="partner_id" />
<field name="user_id" />
<button icon="fa-check" name="button_confirm" type="object"
string="Mark as Done" states="draft" />
<button icon="fa-undo" name="button_set_to_draft" type="object"
string="Back to Todo" states="done" />
<field name="state" />
</tree>
</field>
</record>
<record id="crm_action_type_tree" model="ir.ui.view">
<field name="name">CRM Action Type Tree</field>
<field name="model">crm.action.type</field>
<field name="arch" type="xml">
<tree editable="top">
<field name="name"/>
<field name="priority"/>
<field name="active"/>
</tree>
</field>
</record>
<!-- Searches -->
<record model="ir.ui.view" id="crm_action_search">
<field name="name">Search adaptations</field>
<field name="model">crm.action</field>
<field name="arch" type="xml">
<search string="Search Actions">
<field name="lead_id" />
<field name="partner_id" />
<field name="date" />
<field name="user_id" />
<separator/>
<filter string="Todo" name="draft_only"
domain="[('state', '=', 'draft')]"/>
<filter string="Done" name="done_only"
domain="[('state', '=', 'done')]"/>
<separator />
<filter name="urgent" string="Urgent"
domain="[('priority', '=', '4')]" />
<separator/>
<filter string="Todo Today" name="todo_today"
domain="[('state', '=', 'draft'), ('date', '&lt;=', context_today().strftime('%Y-%m-%d'))]" />
<filter name="todo_week" string="Todo within 7 days"
domain="[('state', '=', 'draft'), ('date', '&lt;=', (context_today() + datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]" />
<filter name="todo_month" string="Todo within 30 days"
domain="[('state', '=', 'draft'), ('date', '&lt;=', (context_today() + datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]" />
<separator/>
<filter string="My Actions" name="user_me"
domain="[('user_id', '=', uid)]" help="Actions done by me" />
<group string="Group By" name="groupby">
<filter name="state_groupby" string="State"
context="{'group_by': 'state'}" />
<filter name="priority_groupby" string="Priority"
context="{'group_by': 'priority'}" />
<filter name="partner_groupby" string="Partner"
context="{'group_by': 'partner_id'}" />
<filter name="user_groupby" string="User"
context="{'group_by': 'user_id'}" />
<filter name="action_type_id_groupby" string="Action Type"
context="{'group_by': 'action_type_id'}" />
<filter name="date_groupby" string="Week"
context="{'group_by': 'date:week'}"/>
</group>
</search>
</field>
</record>
<record id="crm_action_type_search" model="ir.ui.view">
<field name="name">CRM Action Type Search</field>
<field name="model">crm.action.type</field>
<field name="arch" type="xml">
<search string="Search Action Types">
<field name="name" />
</search>
</field>
</record>
<!-- Actions -->
<record model="ir.actions.act_window" id="crm_action_action">
<field name="name">Actions</field>
<field name="res_model">crm.action</field>
<field name="view_mode">tree,form,calendar</field>
<field name="context">{'search_default_draft_only': 1, 'search_default_user_me': 1}</field>
</record>
<record id="crm_action_type_action" model="ir.actions.act_window">
<field name="name">Action Types</field>
<field name="res_model">crm.action.type</field>
<field name="view_mode">tree</field>
</record>
<!-- Menus -->
<record id="crm.crm_lead_menu_activities" model="ir.ui.menu">
<field name="active">0</field>
</record>
<menuitem id="crm_action_menu" name="Actions"
parent="sales_team.menu_sales" sequence="5" action="crm_action_action" />
<menuitem id="crm_action_type_menu" name="Action Types"
action="crm_action_type_action" sequence="0"
parent="crm.menu_crm_config_lead" />
</data>
</odoo>

View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 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>
<!-- Form -->
<!-- Lead and opp only : next action creation... -->
<record model="ir.ui.view" id="crm_case_form_view_leads_inherit_crm_action">
<field name="name">CRM Lead Form adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
<field name="arch" type="xml">
<!-- Actions in button box -->
<div class="oe_button_box" position="inside">
<button class="oe_inline oe_stat_button" type="action" icon="fa-list"
name="%(yaltik_crm_action.crm_action_simple_action)d"
context="{'search_default_lead_id': active_id, 'search_default_user_me': 0}">
<field string="Actions" name="actions_count" widget="statinfo" />
</button>
</div>
<!-- Next action -->
<label for="contact_name" position="before">
<label for="next_action_id" />
<div class="oe_row">
<field name="next_action_id"
attrs="{'invisible': [('next_action_id', '=', False)]}" />
<button name="next_action_done" type="object"
icon="fa-check" class="oe_inline" help="Mark next action as done"
attrs="{'invisible': [('next_action_id', '=', False)]}"/>
</div>
</label>
</field>
</record>
<record model="ir.ui.view" id="crm_case_form_view_oppor_inherit_crm_action">
<field name="name">Opportunity form adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor" />
<field name="arch" type="xml">
<!-- Actions in button box -->
<div class="oe_button_box" position="inside">
<button class="oe_inline oe_stat_button" icon="fa-list" type="action"
name="%(crm_action_simple_action)d"
context="{'search_default_lead_id': active_id, 'search_default_user_me': 0}">
<field string="Actions" name="actions_count" widget="statinfo" />
</button>
</div>
<!-- Replace group of native activities -->
<xpath expr="//sheet/group[1]/group[2]" position="replace">
<group>
<label for="next_action_id" />
<div class="oe_row">
<field name="next_action_id"
attrs="{'invisible': [('next_action_id', '=', False)]}" />
<button name="next_action_done" type="object" class="oe_inline"
help="Mark next action as done" icon="fa-check"
attrs="{'invisible': [('next_action_id', '=', False)]}" />
</div>
</group>
</xpath>
<!-- Hide activity logging -->
<button name="%(crm.crm_activity_log_action)d" position="attributes">
<attribute name="invisible">True</attribute>
</button>
</field>
</record>
<!-- Kanbans -->
<record id="crm_case_kanban_view_leads_inherit_crm_action" model="ir.ui.view">
<field name="name">CRM Lead Kanban adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_kanban_view_leads" />
<field name="arch" type="xml">
<xpath expr="//a[@name='%(crm.crm_activity_log_action)d']"
position="attributes">
<attribute name="name">%(crm_action_simple_action)d"</attribute>
</xpath>
<xpath expr="//a[@name='%(crm.crm_activity_schedule_action)d']"
position="attributes">
<attribute name="name">%(crm_action_simple_action)d"</attribute>
</xpath>
</field>
</record>
<!-- Trees -->
<record id="crm_case_form_view_lead_inherit_crm_action" model="ir.ui.view" >
<field name="name">CRM Lead Tree Activity adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_tree_activity" />
<field name="arch" type="xml">
<field name="next_activity_id" position="replace">
<field name="next_action_id" />
</field>
</field>
</record>
<!-- Searches -->
<record id="crm_case_opp_search_inherit_cmr_action" model="ir.ui.view" >
<field name="name">CRM Opportunity Search adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter" />
<field name="arch" type="xml">
<field name="next_activity_id" position="replace">
<field name="next_action_id" />
</field>
<filter name="today" position="replace"></filter>
<filter name="this_week" position="replace"></filter>
<filter name="overdue" position="replace"></filter>
</field>
</record>
<!-- Actions -->
<act_window id="crm_action_simple_action" name="Actions"
res_model="crm.action" view_mode="tree,form,calendar" />
</data>
</odoo>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 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>
<!-- Overwrite actity opening -->
<record id="crm.crm_activity_report_action_tree"
model="ir.actions.act_window">
<field name="name">Actions</field>
<field name="res_model">crm.action</field>
<field name="view_mode">tree,form,calendar</field>
<field name="context">{'search_default_partner_id': active_id}</field>
</record>
</data>
</odoo>