瀏覽代碼

bi_crm_mensaje

Sebas 7 年之前
當前提交
225d80fbf6
共有 10 個文件被更改,包括 185 次插入0 次删除
  1. 1 0
      __init__.py
  2. 二進制
      __init__.pyc
  3. 44 0
      __openerp__.py
  4. 42 0
      __openerp__.py~
  5. 1 0
      models/__init__.py
  6. 二進制
      models/__init__.pyc
  7. 40 0
      models/crm_mensaje.py
  8. 二進制
      models/crm_mensaje.pyc
  9. 二進制
      static/description/icon.png
  10. 57 0
      views/crm_lead_view.xml

+ 1 - 0
__init__.py

@@ -0,0 +1 @@
+import models

二進制
__init__.pyc


+ 44 - 0
__openerp__.py

@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    This module uses OpenERP, Open Source Management Solution Framework.
+#    Copyright (C) 2018-Eiru Software.
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU 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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>
+#
+##############################################################################
+{
+    'name': 'Create Message from Lead',
+    'category': 'CRM',
+    'description': """
+Mensaje desde Iniciativas y Oportunidades
+====================================================
+Este módulo crea un smarticon en iniciativas y oportunidades con mensajes recibidos para cada uno de ellos.
+""",
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com.py',
+
+
+    'images': [],
+    'depends': ['base', 'crm', 'crm_mensaje'],
+
+    'data': [
+             'views/crm_lead_view.xml'
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': True,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 42 - 0
__openerp__.py~

@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    This module uses OpenERP, Open Source Management Solution Framework.
+#    Copyright (C) 2014-Today BrowseInfo (<http://www.browseinfo.in>)
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU 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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>
+#
+##############################################################################
+{
+    'name': 'Create Task from Lead',
+    'category': 'Project',
+    'description': """
+""",
+    'author': 'BrowseInfo',
+    'website': 'http://www.browseinfo.in',
+    "price": 20,
+    "currency": 'EUR',
+
+    'images': [],
+    'depends': ['base', 'crm', 'sale',  'project_issue','project'],
+    
+    'data': [ 
+             'views/crm_lead_view.xml'
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': True,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 1 - 0
models/__init__.py

@@ -0,0 +1 @@
+import crm_mensaje

二進制
models/__init__.pyc


+ 40 - 0
models/crm_mensaje.py

@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU 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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>
+#
+##############################################################################
+from openerp.tools.translate import _
+from datetime import datetime, timedelta, date
+from dateutil.relativedelta import relativedelta
+from openerp import tools, api
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
+from openerp import api, fields, models, _
+import logging
+from openerp.osv import  osv
+from openerp import SUPERUSER_ID
+
+
+
+class crm_lead(models.Model):
+    """ CRM Lead Case """
+    _inherit = "crm.lead"
+
+    @api.multi
+    def mensaje_count(self):
+        mensaje_obj = self.env['crm.mensaje']
+        self.mensaje_number = mensaje_obj.search_count([('opportunity_id', 'in', [a.id for a in self])])
+
+    mensaje_number = fields.Integer(compute='mensaje_count', string='Mensaje')

二進制
models/crm_mensaje.pyc


二進制
static/description/icon.png


+ 57 - 0
views/crm_lead_view.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+	<data>
+
+
+        <record id="action_view_crm_mensaje_form" model="ir.actions.act_window">
+            <field name="name">Crear Mensaje</field>
+            <field name="res_model">crm.mensaje</field>
+			<field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+			<field name="domain">[('opportunity_id', '=', active_id)]</field>
+		   <field name="context">{'search_default_opportunity_id': active_id, 'default_opportunity_id': active_id}</field>
+		   <field name="help" type="html">
+			   <p>
+				   Esta aplicación se utiliza para registrar los datos más importantes de una conversación por medio de mensajes con el cliente.
+
+				   Los datos registrados son: el asunto, la fecha y hora, el cliente, etc.
+			   </p>
+		   </field>
+	   </record>
+            <!-- <field name="view_id" ref="crm_mensaje.crm_case_mensaje_form_view"/>
+
+
+
+	<record id="action_view_mensaje_id" model="ir.actions.act_window">
+            <field name="name">Mensaje</field>
+            <field name="res_model">crm.mensaje</field>
+            <field name="view_mode">tree,form</field>
+             <field name="domain">[('lead_id', '=', active_id)]</field>
+            <field name="context">{'search_default_lead_id': active_id, 'default_lead_id': active_id}</field>
+            <field name="help" type="html">
+                <p>
+                    Odoo's project management allows you to manage the pipeline of your tasks efficiently. You can track progress, discuss on tasks, attach documents, etc.
+                </p>
+            </field>
+        </record> -->
+
+
+		<record id="crm_mensaje_inherit_form" model="ir.ui.view">
+			<field name="name">Crm Lead</field>
+			<field name="model">crm.lead</field>
+			<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
+			<field name="arch" type="xml">
+			<div class="oe_right oe_button_box" position="inside">
+				<button class="oe_stat_button" type="action" name="%(bi_crm_mensaje.action_view_crm_mensaje_form)d"
+                        context="{'default_partner_id': partner_id }"
+                        icon="fa-tasks">
+                        <field  string="Mensaje" name="mensaje_number" widget="statinfo"/>
+                </button>
+            </div>
+				<button name="%(crm.action_crm_lead2opportunity_partner)d" position="after">
+					<button name="%(bi_crm_mensaje.action_view_crm_mensaje_form)d" string="Crear Mensaje" type="action"/>
+				</button>
+			</field>
+		</record>
+	</data>
+</openerp>