Browse Source

[ADD] Initial Commit

pull/30/merge
SHEREEF PT 8 years ago
parent
commit
5a9b913859
  1. 24
      lead_products/__init__.py
  2. 42
      lead_products/__manifest__.py
  3. 25
      lead_products/models/__init__.py
  4. 80
      lead_products/models/lead_product.py
  5. 2
      lead_products/security/ir.model.access.csv
  6. BIN
      lead_products/static/description/banner.jpg
  7. BIN
      lead_products/static/description/icon.png
  8. 90
      lead_products/static/description/index.html
  9. BIN
      lead_products/static/description/lead.png
  10. BIN
      lead_products/static/description/opportunity.png
  11. BIN
      lead_products/static/description/sale_order.png
  12. 27
      lead_products/views/lead_product_view.xml
  13. 39
      lead_products/views/opportunity_pdt_views.xml

24
lead_products/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
from . import models

42
lead_products/__manifest__.py

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "Products In Lead And Opportunity",
'version': '10.0.1.0.0',
'summary': """Product Detail In Lead And Opportunity Form""",
'description': """Product Detail In Lead And Opportunity Form""",
'author': "Cybrosys Techno Solutions",
'website': "https://www.cybrosys.com",
'category': 'CRM',
'depends': ['base', 'crm', 'product', 'sale', 'sale_crm'],
'data': [
'security/ir.model.access.csv',
'views/lead_product_view.xml',
'views/opportunity_pdt_views.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

25
lead_products/models/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
from . import lead_product

80
lead_products/models/lead_product.py

@ -0,0 +1,80 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields, api
class LeadProduct(models.Model):
_inherit = 'crm.lead'
pdt_line = fields.One2many('crm.product_line', 'pdt_crm', string="Product")
def sale_action_quotations_new(self):
vals = {'partner_id': self.partner_id.id,
'user_id': self.user_id.id,
}
sale_order = self.env['sale.order'].create(vals)
order_line = self.env['sale.order.line']
for data in self.pdt_line:
pdt_value = {
'order_id': sale_order.id,
'product_id': data.product_id.id,
'name': data.name,
'product_uom_qty': data.product_uom_qty,
'uom_id': data.uom_id.id
}
order_line.create(pdt_value)
view_id = self.env.ref('sale.view_order_form')
return {
'type': 'ir.actions.act_window',
'res_model': 'sale.order',
'view_type': 'form',
'view_mode': 'form',
'target': 'current',
'res_id': sale_order.id,
'view_id': view_id.id,
}
class LeadProductLine(models.Model):
_name = 'crm.product_line'
product_id = fields.Many2one('product.product', string="Product",
change_default=True, ondelete='restrict', required=True)
name = fields.Text(string='Description')
pdt_crm = fields.Many2one('crm.lead')
product_uom_qty = fields.Float(string='Quantity', default=1.0)
price_unit = fields.Float(string='Cost Price')
market_price = fields.Float(string='Sale Price')
qty_hand = fields.Integer(string='Quantity On Hand')
uom_id = fields.Many2one('product.uom', 'Unit of Measure')
@api.onchange('product_id')
def product_data(self):
data = self.env['product.template'].search([('name', '=', self.product_id.name)])
self.name = data.name
self.price_unit = data.list_price
self.uom_id = data.uom_id
self.market_price = data.standard_price
self.qty_hand = data.qty_available

2
lead_products/security/ir.model.access.csv

@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_lead_product_crm_product_line,lead_product_crm_product_line,model_crm_product_line,,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_lead_product_crm_product_line lead_product_crm_product_line model_crm_product_line 1 1 1 1

BIN
lead_products/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
lead_products/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

90
lead_products/static/description/index.html

@ -0,0 +1,90 @@
<section class="oe_container">
<div class="oe_spaced">
<h2 class="oe_slogan">Products In Leads And Opportunity</h2>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
<div>
<h4><p>Major Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Products In Lead And Opportunity.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Quotation From Opportunity Based On Products.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Quantity On Hand Of Each Products On Product Line</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p>Add extra an option to select products in Leads and Opportunity form.It allows the sales team to enter
product lines on opportunity and create quotation based on that information.It also show
'Quantity on hand' on product line so that sales team can have idea about stock.</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Products In Leads And Opportunity</h3>
<div class="" style="text-align: center">
<p>
<h4>Product Line In Lead And Opportunity</h4>
<p>
</div>
<div class="oe_row oe_padded">
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="opportunity.png">
</div>
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="lead.png">
</div>
</div>
<br>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="" style="text-align: center">
<p>
<h4>Quotation From Opportunity</h4>
<p>
</div>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="sale_order.png">
</div>
</div>
<br>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
lead_products/static/description/lead.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
lead_products/static/description/opportunity.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
lead_products/static/description/sale_order.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

27
lead_products/views/lead_product_view.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="lead_product_form_view" 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">
<xpath expr="//page[@name='extra']" position="after">
<page name="Products" string="Products">
<field name="pdt_line">
<tree editable="bottom">
<field name="product_id"/>
<field name="name"/>
<field name="product_uom_qty"/>
<field name="price_unit"/>
<field name="market_price"/>
<field name="qty_hand"/>
<field name="uom_id"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>
</data>
</odoo>

39
lead_products/views/opportunity_pdt_views.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="opportunity_product_form1_view" model="ir.ui.view">
<field name="name">CRM Lead</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="sale_crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<button name='%(sale_crm.sale_action_quotations_new)d' position="replace">
<button string="New Quotation" name='sale_action_quotations_new' type="object" class="oe_highlight"/>
</button>
</field>
</record>
<record id="opportunity_product_form_view" 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_oppor"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='lead']" position="after">
<page name="Products" string="Products">
<field name="pdt_line">
<tree editable="bottom">
<field name="product_id"/>
<field name="name"/>
<field name="product_uom_qty"/>
<field name="price_unit" />
<field name="market_price"/>
<field name="qty_hand"/>
<field name="uom_id"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save