diff --git a/crm_job_position/README.rst b/crm_job_position/README.rst new file mode 100644 index 000000000..31fbf7ba6 --- /dev/null +++ b/crm_job_position/README.rst @@ -0,0 +1,13 @@ +Job positions in CRM +==================== + +This module adds the concept of job position to the CRM main objects (lead, +opportunity, partner), and propagate them through the workflow. + +Credits +======= + +Contributors +------------ +* Pedro M. Baeza +* Antonio Espinosa diff --git a/crm_job_position/__init__.py b/crm_job_position/__init__.py new file mode 100644 index 000000000..054c8853d --- /dev/null +++ b/crm_job_position/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import models diff --git a/crm_job_position/__openerp__.py b/crm_job_position/__openerp__.py new file mode 100644 index 000000000..311e1d6c4 --- /dev/null +++ b/crm_job_position/__openerp__.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Odoo Source Management Solution +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# +# 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': 'Job positions in CRM', + 'version': '1.0', + 'category': 'Customer Relationship Management', + 'author': 'Serv. Tecnolog. Avanzados - Pedro M. Baeza, ' + 'Antiun Ingeniería S.L.', + 'website': 'http://www.serviciosbaeza.com, http://www.antiun.com', + 'depends': [ + 'crm', + ], + 'data': [ + 'views/crm_job_position_view.xml', + 'views/crm_lead_view.xml', + 'views/res_partner_view.xml', + ], + "installable": True, +} diff --git a/crm_job_position/i18n/crm_job_position.pot b/crm_job_position/i18n/crm_job_position.pot new file mode 100644 index 000000000..620e822d0 --- /dev/null +++ b/crm_job_position/i18n/crm_job_position.pot @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_job_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-24 13:47+0000\n" +"PO-Revision-Date: 2015-01-24 13:47+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: crm_job_position +#: field:crm.job_position,children:0 +msgid "Children" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,create_date:0 +msgid "Created on" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,id:0 +msgid "ID" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,name:0 +msgid "Name" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,parent_left:0 +msgid "Parent Left" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,parent_right:0 +msgid "Parent Right" +msgstr "" + +#. module: crm_job_position +#: field:crm.job_position,parent_id:0 +msgid "Parent id" +msgstr "" + +#. module: crm_job_position +#: view:crm.lead:crm_job_position.view_crm_case_leads_filter_job_position +#: view:crm.lead:crm_job_position.view_crm_case_opportunities_filter_job_position +#: field:crm.lead,job_position:0 +#: model:ir.model,name:crm_job_position.model_crm_job_position +#: view:res.partner:crm_job_position.view_res_partner_filter_job_position +#: field:res.partner,job_position:0 +msgid "Job position" +msgstr "" + +#. module: crm_job_position +#: field:crm.lead,function:0 +#: field:res.partner,function:0 +msgid "Detailed job position" +msgstr "" + +#. module: crm_job_position +#: view:crm.job_position:crm_job_position.crm_job_position_tree_view +#: model:ir.actions.act_window,name:crm_job_position.crm_job_position_action +#: model:ir.ui.menu,name:crm_job_position.menu_crm_job_position +msgid "Job positions" +msgstr "" + diff --git a/crm_job_position/i18n/es.po b/crm_job_position/i18n/es.po new file mode 100644 index 000000000..9568802e5 --- /dev/null +++ b/crm_job_position/i18n/es.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_job_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-24 13:47+0000\n" +"PO-Revision-Date: 2015-01-24 13:47+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: crm_job_position +#: field:crm.job_position,children:0 +msgid "Children" +msgstr "Hijos" + +#. module: crm_job_position +#: field:crm.job_position,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: crm_job_position +#: field:crm.job_position,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: crm_job_position +#: field:crm.job_position,id:0 +msgid "ID" +msgstr "ID" + +#. module: crm_job_position +#: field:crm.job_position,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: crm_job_position +#: field:crm.job_position,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: crm_job_position +#: field:crm.job_position,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: crm_job_position +#: field:crm.job_position,parent_left:0 +msgid "Parent Left" +msgstr "Padre izquierdo" + +#. module: crm_job_position +#: field:crm.job_position,parent_right:0 +msgid "Parent Right" +msgstr "Padre derecho" + +#. module: crm_job_position +#: field:crm.job_position,parent_id:0 +msgid "Parent id" +msgstr "ID del padre" + +#. module: crm_job_position +#: view:crm.lead:crm_job_position.view_crm_case_leads_filter_job_position +#: view:crm.lead:crm_job_position.view_crm_case_opportunities_filter_job_position +#: field:crm.lead,job_position:0 +#: model:ir.model,name:crm_job_position.model_crm_job_position +#: view:res.partner:crm_job_position.view_res_partner_filter_job_position +#: field:res.partner,job_position:0 +msgid "Job position" +msgstr "Puesto de trabajo" + +#. module: crm_job_position +#: field:crm.lead,function:0 +#: field:res.partner,function:0 +msgid "Detailed job position" +msgstr "Puesto de trabajo detallado" + +#. module: crm_job_position +#: view:crm.job_position:crm_job_position.crm_job_position_tree_view +#: model:ir.actions.act_window,name:crm_job_position.crm_job_position_action +#: model:ir.ui.menu,name:crm_job_position.menu_crm_job_position +msgid "Job positions" +msgstr "Puestos de trabajo" + diff --git a/crm_job_position/models/__init__.py b/crm_job_position/models/__init__.py new file mode 100644 index 000000000..0ab7c4ce5 --- /dev/null +++ b/crm_job_position/models/__init__.py @@ -0,0 +1,8 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import crm_job_position +from . import crm_lead +from . import res_partner diff --git a/crm_job_position/models/crm_job_position.py b/crm_job_position/models/crm_job_position.py new file mode 100644 index 000000000..665425d51 --- /dev/null +++ b/crm_job_position/models/crm_job_position.py @@ -0,0 +1,20 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class CrmJobPosition(models.Model): + _name = 'crm.job_position' + _order = "parent_left" + _parent_order = "name" + _parent_store = True + _description = "Job position" + + name = fields.Char(required=True) + parent_id = fields.Many2one(comodel_name='crm.job_position') + children = fields.One2many(comodel_name='crm.job_position', + inverse_name='parent_id') + parent_left = fields.Integer('Parent Left', select=True) + parent_right = fields.Integer('Parent Right', select=True) diff --git a/crm_job_position/models/crm_lead.py b/crm_job_position/models/crm_lead.py new file mode 100644 index 000000000..1fecc91ed --- /dev/null +++ b/crm_job_position/models/crm_lead.py @@ -0,0 +1,26 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class CrmLead(models.Model): + _inherit = 'crm.lead' + + function = fields.Char(string="Detailed job position") + job_position = fields.Many2one(comodel_name='crm.job_position', + string="Job position") + + def _lead_create_contact(self, cr, uid, lead, name, is_company, + parent_id=False, context=None): + """ + Propagate job_position to created partner. + """ + partner_id = super(CrmLead, self)._lead_create_contact( + cr, uid, lead, name, is_company, parent_id=parent_id, + context=context) + self.pool['res.partner'].write( + cr, uid, partner_id, {'job_position': lead.job_position.id}, + context=context) + return partner_id diff --git a/crm_job_position/models/res_partner.py b/crm_job_position/models/res_partner.py new file mode 100644 index 000000000..5a76412d1 --- /dev/null +++ b/crm_job_position/models/res_partner.py @@ -0,0 +1,13 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + function = fields.Char(string="Detailed job position") + job_position = fields.Many2one(comodel_name='crm.job_position', + string="Job position") diff --git a/crm_job_position/static/description/icon.png b/crm_job_position/static/description/icon.png new file mode 100644 index 000000000..add81b17a Binary files /dev/null and b/crm_job_position/static/description/icon.png differ diff --git a/crm_job_position/views/crm_job_position_view.xml b/crm_job_position/views/crm_job_position_view.xml new file mode 100644 index 000000000..f5dfce5be --- /dev/null +++ b/crm_job_position/views/crm_job_position_view.xml @@ -0,0 +1,30 @@ + + + + + + Job positions + crm.job_position + form + tree + + + + CRM job_position tree + crm.job_position + + + + + + + + + + + + \ No newline at end of file diff --git a/crm_job_position/views/crm_lead_view.xml b/crm_job_position/views/crm_lead_view.xml new file mode 100644 index 000000000..169fdd48c --- /dev/null +++ b/crm_job_position/views/crm_lead_view.xml @@ -0,0 +1,86 @@ + + + + + + CRM - Leads Form with job positions + crm.lead + + + + + + + + + + + + CRM - Leads Search with job positions + crm.lead + + + + + + + + + + + + + CRM - Leads Form with job position + crm.lead + + + + + + + + + + + + CRM - Leads Search with job positions + crm.lead + + + + + + + + + + + + + \ No newline at end of file diff --git a/crm_job_position/views/res_partner_view.xml b/crm_job_position/views/res_partner_view.xml new file mode 100644 index 000000000..871411116 --- /dev/null +++ b/crm_job_position/views/res_partner_view.xml @@ -0,0 +1,48 @@ + + + + + + Partner form with job position + res.partner + + + + + + + + + + + + Partner search with job position + res.partner + + + + + + + + + + + + + \ No newline at end of file