diff --git a/lead_products/__init__.py b/lead_products/__init__.py new file mode 100644 index 000000000..e9e195e50 --- /dev/null +++ b/lead_products/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## +from . import models + diff --git a/lead_products/__manifest__.py b/lead_products/__manifest__.py new file mode 100644 index 000000000..e145ebfc1 --- /dev/null +++ b/lead_products/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## +{ + '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, +} diff --git a/lead_products/models/__init__.py b/lead_products/models/__init__.py new file mode 100644 index 000000000..c9d6778cb --- /dev/null +++ b/lead_products/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## +from . import lead_product + + diff --git a/lead_products/models/lead_product.py b/lead_products/models/lead_product.py new file mode 100644 index 000000000..179007781 --- /dev/null +++ b/lead_products/models/lead_product.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +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 diff --git a/lead_products/security/ir.model.access.csv b/lead_products/security/ir.model.access.csv new file mode 100644 index 000000000..5a6bd1aca --- /dev/null +++ b/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 diff --git a/lead_products/static/description/banner.jpg b/lead_products/static/description/banner.jpg new file mode 100644 index 000000000..9798678af Binary files /dev/null and b/lead_products/static/description/banner.jpg differ diff --git a/lead_products/static/description/icon.png b/lead_products/static/description/icon.png new file mode 100644 index 000000000..fd8ee32b4 Binary files /dev/null and b/lead_products/static/description/icon.png differ diff --git a/lead_products/static/description/index.html b/lead_products/static/description/index.html new file mode 100644 index 000000000..773af87a8 --- /dev/null +++ b/lead_products/static/description/index.html @@ -0,0 +1,90 @@ +
+
+

Products In Leads And Opportunity

+

Cybrosys Technologies

+
+

Major Features:

+
    +
  •   Products In Lead And Opportunity.
  • +
  •   Quotation From Opportunity Based On Products.
  • +
  •   Quantity On Hand Of Each Products On Product Line
  • +
+
+
+
+ +
+
+
+

Overview

+

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.

+
+
+
+ +
+
+

Products In Leads And Opportunity

+
+

+

Product Line In Lead And Opportunity

+

+

+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+

+

Quotation From Opportunity

+

+

+
+
+ +
+
+
+
+
+ +
+

Need Any Help?

+ +
+ + + diff --git a/lead_products/static/description/lead.png b/lead_products/static/description/lead.png new file mode 100644 index 000000000..9039ce2b5 Binary files /dev/null and b/lead_products/static/description/lead.png differ diff --git a/lead_products/static/description/opportunity.png b/lead_products/static/description/opportunity.png new file mode 100644 index 000000000..60a764bd7 Binary files /dev/null and b/lead_products/static/description/opportunity.png differ diff --git a/lead_products/static/description/sale_order.png b/lead_products/static/description/sale_order.png new file mode 100644 index 000000000..7295523ce Binary files /dev/null and b/lead_products/static/description/sale_order.png differ diff --git a/lead_products/views/lead_product_view.xml b/lead_products/views/lead_product_view.xml new file mode 100644 index 000000000..2a9cef0f5 --- /dev/null +++ b/lead_products/views/lead_product_view.xml @@ -0,0 +1,27 @@ + + + + + CRM Lead + crm.lead + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lead_products/views/opportunity_pdt_views.xml b/lead_products/views/opportunity_pdt_views.xml new file mode 100644 index 000000000..75e2ff1d5 --- /dev/null +++ b/lead_products/views/opportunity_pdt_views.xml @@ -0,0 +1,39 @@ + + + + + CRM Lead + crm.lead + + + + + + + + CRM Lead + crm.lead + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file