Prospect modules (different approch than the OCA module partner_prospect in sale-workflow)
This commit is contained in:
3
crm_partner_prospect/__init__.py
Normal file
3
crm_partner_prospect/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import crm
|
||||
29
crm_partner_prospect/__manifest__.py
Normal file
29
crm_partner_prospect/__manifest__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'CRM Partner Prospect',
|
||||
'version': '10.0.1.0.0',
|
||||
'category': 'Sales',
|
||||
'license': 'AGPL-3',
|
||||
'summary': "Glue module between base_partner_prospect and crm modules",
|
||||
'description': """
|
||||
CRM Partner Prospect
|
||||
=====================
|
||||
|
||||
This is a glue module between *base_partner_prospect* and *crm* modules.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['crm', 'base_partner_prospect'],
|
||||
'data': [
|
||||
'crm_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
}
|
||||
16
crm_partner_prospect/crm.py
Normal file
16
crm_partner_prospect/crm.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class CrmLead(models.Model):
|
||||
_inherit = 'crm.lead'
|
||||
|
||||
@api.multi
|
||||
def _lead_create_contact(self, name, is_company, parent_id=False):
|
||||
partner = super(CrmLead, self)._lead_create_contact(
|
||||
name, is_company, parent_id=parent_id)
|
||||
partner.write({'prospect': True, 'customer': False})
|
||||
return partner
|
||||
40
crm_partner_prospect/crm_view.xml
Normal file
40
crm_partner_prospect/crm_view.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2017 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="crm_case_form_view_oppor" model="ir.ui.view">
|
||||
<field name="name">crm_partner_prospect.crm.opportunity.form</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="attributes">
|
||||
<attribute name="domain">['|', ('prospect', '=', True), ('customer', '=', True)]</attribute>
|
||||
<attribute name="context">{'default_customer': 0, 'default_prospect': 1,
|
||||
'default_name': partner_name, 'default_street': street,
|
||||
'default_street2': street2, 'default_city': city,
|
||||
'default_state_id': state_id, 'default_zip': zip,
|
||||
'default_country_id': country_id, 'default_function': function,
|
||||
'default_phone': phone, 'default_mobile': mobile,
|
||||
'default_fax': fax, 'default_email': email_from,
|
||||
'default_user_id': user_id, 'default_team_id': team_id}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_lead2opportunity_partner" model="ir.ui.view">
|
||||
<field name="name">crm_partner_prospect.crm.lead2opportunity.partner.form</field>
|
||||
<field name="model">crm.lead2opportunity.partner</field>
|
||||
<field name="inherit_id" ref="crm.view_crm_lead2opportunity_partner"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="attributes">
|
||||
<attribute name="domain">['|', ('prospect', '=', True), ('customer', '=', True)]}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user