diff --git a/sos_inside_sales/models/__pycache__/sos_inside_sales_leads.cpython-310.pyc b/sos_inside_sales/models/__pycache__/sos_inside_sales_leads.cpython-310.pyc index 434cacd..b37697b 100644 Binary files a/sos_inside_sales/models/__pycache__/sos_inside_sales_leads.cpython-310.pyc and b/sos_inside_sales/models/__pycache__/sos_inside_sales_leads.cpython-310.pyc differ diff --git a/sos_inside_sales/models/sos_inside_sales_leads.py b/sos_inside_sales/models/sos_inside_sales_leads.py index f73eb95..e750849 100755 --- a/sos_inside_sales/models/sos_inside_sales_leads.py +++ b/sos_inside_sales/models/sos_inside_sales_leads.py @@ -22,8 +22,6 @@ class sos_inside_sales_leads(models.Model): website_url = fields.Char(string="Website URL") vertical_domain = fields.Many2many('sos_vertical_domain',string="Domain / Industry", ondelete="cascade") line_ids_contacts = fields.One2many('sos_leads_contact_lines', 'ref_id', string="Contact Details",copy=True) - remarks=fields.Text(string="Remarks") - linkedin_profile = fields.Char(string="Linkedin profile") # products = fields.Selection( # [ # ('BHMS 1.2V', 'BHMS 1.2V'), @@ -148,7 +146,6 @@ class sos_inside_sales_leads(models.Model): 'location':self.location, 'website_url':self.website_url, 'vertical_domain': [(6, 0, self.vertical_domain.ids)], - 'linkedin_profile':self.linkedin_profile, 'products_interested':[(6, 0,self.products_interested.ids)], 'source':'inside_sales', 'expo_name':self.expo_name, diff --git a/sos_inside_sales/views/sos_inside_sales_leads_view.xml b/sos_inside_sales/views/sos_inside_sales_leads_view.xml index 04c6dc6..0e8622e 100755 --- a/sos_inside_sales/views/sos_inside_sales_leads_view.xml +++ b/sos_inside_sales/views/sos_inside_sales_leads_view.xml @@ -66,7 +66,6 @@ - -

diff --git a/sos_inventory/security/security.xml b/sos_inventory/security/security.xml index a0b8b63..067310f 100755 --- a/sos_inventory/security/security.xml +++ b/sos_inventory/security/security.xml @@ -115,5 +115,12 @@ + + + Marketing User + + + diff --git a/sos_marketing/__init__.py b/sos_marketing/__init__.py new file mode 100755 index 0000000..aa4d0fd --- /dev/null +++ b/sos_marketing/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import controllers +from . import models diff --git a/sos_marketing/__manifest__.py b/sos_marketing/__manifest__.py new file mode 100755 index 0000000..f11cfee --- /dev/null +++ b/sos_marketing/__manifest__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +{ + 'name': "SOS Marketing", + + 'summary': "Marketing", + + 'description': """ +Long description of module's purpose + """, + + 'author': "Deena", + 'website': "https://sosaley.com", + + 'category': 'Inventory', + 'version': '17.0.1.0.0', + # any module necessary for this one to work correctly + 'depends': ['base','web','mail','sos_inventory','sos_sales'], + + # always loaded + 'data': [ + 'security/ir.model.access.csv', + 'views/menu.xml', + 'views/sos_marketing_leads_view.xml' + ], + # only loaded in demonstration mode + 'demo': [ + 'demo/demo.xml', + ], + 'installable': True, + 'application': True, + 'license': 'LGPL-3' +} + diff --git a/sos_marketing/controllers/__init__.py b/sos_marketing/controllers/__init__.py new file mode 100755 index 0000000..b0f26a9 --- /dev/null +++ b/sos_marketing/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import controllers diff --git a/sos_marketing/controllers/controllers.py b/sos_marketing/controllers/controllers.py new file mode 100755 index 0000000..2d78fa6 --- /dev/null +++ b/sos_marketing/controllers/controllers.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# from odoo import http + + +# class SosMarketing(http.Controller): +# @http.route('/sos_marketing/sos_marketing', auth='public') +# def index(self, **kw): +# return "Hello, world" + +# @http.route('/sos_marketing/sos_marketing/objects', auth='public') +# def list(self, **kw): +# return http.request.render('sos_marketing.listing', { +# 'root': '/sos_marketing/sos_marketing', +# 'objects': http.request.env['sos_marketing.sos_marketing'].search([]), +# }) + +# @http.route('/sos_marketing/sos_marketing/objects/', auth='public') +# def object(self, obj, **kw): +# return http.request.render('sos_marketing.object', { +# 'object': obj +# }) + diff --git a/sos_marketing/demo/demo.xml b/sos_marketing/demo/demo.xml new file mode 100755 index 0000000..f4dc83d --- /dev/null +++ b/sos_marketing/demo/demo.xml @@ -0,0 +1,30 @@ + + + + + diff --git a/sos_marketing/models/__init__.py b/sos_marketing/models/__init__.py new file mode 100755 index 0000000..87c4fbc --- /dev/null +++ b/sos_marketing/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import sos_marketing_leads diff --git a/sos_marketing/models/sos_marketing_leads.py b/sos_marketing/models/sos_marketing_leads.py new file mode 100755 index 0000000..f09f16d --- /dev/null +++ b/sos_marketing/models/sos_marketing_leads.py @@ -0,0 +1,155 @@ + +from odoo import models, fields, api + + +class sos_marketing(models.Model): + _name = 'sos_marketing_leads' + _description = 'Marketing Leads' + _rec_name = 'company_name' + + company_name = fields.Char(string="Company Name") + website_url = fields.Char(string="Website URL") + country = fields.Many2one( + 'res.country', + string='Country', + default=lambda self: self.env['res.country'].search([('code', '=', 'IN')], limit=1) +) + location = fields.Char(string="City/State") + expo_option=fields.Boolean(string="Expo",default="True") + conference_option=fields.Boolean(string="Conference") + linkedin_groups_option=fields.Boolean(string="LinkedIn Groups") + linkedin_poll_option=fields.Boolean(string="LinkedIn Poll") + direct_company=fields.Boolean(string="Direct Company") + expo_participated_option=fields.Boolean(string="Expo [Paricipated]") + #Expo + expo_name = fields.Char(string="Expo Name") + expo_date_from = fields.Date(string="Expo Date From") + expo_date_to = fields.Date(string="Expo Date To") + expo_Location = fields.Char(string="Expo Location") + #Conference + conference_name = fields.Char(string="Conference Name") + conference_date_from = fields.Date(string="Conference Date From") + conference_date_to = fields.Date(string="Conference Date To") + conference_Location = fields.Char(string="Conference Location") + #Linkedin Group + linkedin_group_name = fields.Char(string="LinkedIn Group Name") + #Linkedin poll + linkedin_post_url = fields.Char(string="LinkedIn Post URL") + vertical_domain = fields.Many2many('sos_vertical_domain',string="Vertical/Domain", ondelete="cascade") + line_ids_contacts = fields.One2many('sos_marketing_leads_contact_lines', 'ref_id', string="Contact Details",copy=True) + move_to_inside_sales = fields.Many2many('res.users',string="Move Lead to", domain=lambda self: [('groups_id', 'in', self.env.ref('sos_inventory.sos_inside_sales_user').ids + self.env.ref('sos_inventory.sos_sales_user').ids)]) + cc_mail = fields.Many2one('res.users',string="CC to", domain=lambda self: [('groups_id', 'in', self.env.ref('sos_inventory.sos_sales_user').ids + self.env.ref('sos_inventory.sos_inside_sales_user').ids)]) + move_div_display = fields.Boolean(default=False,string="Moved to Sales") + moved_on = fields.Date(string="Moved On") + @api.onchange('expo_option') + def _onchange_expo(self): + if self.expo_option: + self.conference_option = False + self.linkedin_groups_option = False + self.linkedin_poll_option = False + self.direct_company = False + self.expo_participated_option = False + + @api.onchange('conference_option') + def _onchange_conference(self): + if self.conference_option: + self.expo_option = False + self.linkedin_groups_option = False + self.linkedin_poll_option = False + self.direct_company = False + self.expo_participated_option = False + + @api.onchange('linkedin_groups_option') + def _onchange_linkedin_groups(self): + if self.linkedin_groups_option: + self.expo_option = False + self.conference_option = False + self.linkedin_poll_option = False + self.direct_company = False + self.expo_participated_option = False + + @api.onchange('linkedin_poll_option') + def _onchange_linkedin_poll(self): + if self.linkedin_poll_option: + self.expo_option = False + self.conference_option = False + self.linkedin_groups_option = False + self.direct_company = False + self.expo_participated_option = False + + @api.onchange('direct_company') + def _onchange_direct_company(self): + if self.direct_company: + self.expo_option = False + self.conference_option = False + self.linkedin_groups_option = False + self.linkedin_poll_option = False + self.expo_participated_option = False + + @api.onchange('expo_participated_option') + def _onchange_expo_participated(self): + if self.expo_participated_option: + self.expo_option = False + self.conference_option = False + self.linkedin_groups_option = False + self.linkedin_poll_option = False + self.direct_company = False + def action_move_to_inside_sales(self): + if self.move_to_inside_sales: + for user in self.move_to_inside_sales: + body_html = f""" +

Below Lead is moved to Inside-Sales

+ """ + subject = f"New Lead Received - {self.company_name}" + send_email = self.env['sos_common_scripts'] + send_email.send_direct_email(self.env,"sos_marketing_leads",self.id,user.login,subject,body_html,self.cc_mail.login) + new_record = self.env['sos_inside_sales_leads'].create({ + 'company_name': self.company_name, + 'location':self.location, + 'website_url':self.website_url, + 'vertical_domain': [(6, 0, self.vertical_domain.ids)] + }) + if new_record: + if self.line_ids_contacts: + for contact in self.line_ids_contacts: + self.env['sos_leads_contact_lines'].create({ + 'ref_id': new_record.id, + 'name': contact.name, + 'dept': contact.dept, + 'email': contact.email, + 'mobile_number': contact.mobile_number, + 'set_as_primary': contact.set_as_primary, + 'linkedin_profile': contact.linkedin_profile, + 'remarks': contact.remarks + }) + self.move_div_display = True + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': "Moved Successfully", + 'type': 'success', + 'sticky': False + } + } +class SOS__Marketing_Leads_Line(models.Model): + _name = 'sos_marketing_leads_contact_lines' + _description = 'Marketing Leads Contact Lines' + + ref_id = fields.Many2one('sos_marketing_leads', string="Marketing Leads", ondelete="cascade") + name = fields.Char(string="Name") + dept = fields.Char(string="Designation") + email = fields.Char(string="Email Id") + mobile_number = fields.Char(string="Contact No") + set_as_primary = fields.Boolean(string="Set Primary") + linkedin_profile = fields.Char(string="LinkedIn Profile") + linkedin_invited_on = fields.Char(string="LinkedIn Conn Invited On") + linkedin_invitation_status = fields.Selection( + [ + ('Yet To Accept', 'Yet To Accept'), + ('Accepted', 'Accepted'), + ('No Match', 'No Match'), + ('No Requirement', 'No Requirement') + ], + string="LinkedIn Conn Invitation Status") + remarks = fields.Text(string="Remarks") \ No newline at end of file diff --git a/sos_marketing/security/ir.model.access.csv b/sos_marketing/security/ir.model.access.csv new file mode 100755 index 0000000..8248802 --- /dev/null +++ b/sos_marketing/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_sos_marketing_leads,sos_marketing_leads access for all,model_sos_marketing_leads,base.group_user,1,1,1,1 +access_sos_marketing_leads_contact_lines,sos_marketing_leads_contact_lines access for all,model_sos_marketing_leads_contact_lines,base.group_user,1,1,1,1 + diff --git a/sos_marketing/views/menu.xml b/sos_marketing/views/menu.xml new file mode 100755 index 0000000..3f31a98 --- /dev/null +++ b/sos_marketing/views/menu.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sos_marketing/views/sos_marketing_leads_view.xml b/sos_marketing/views/sos_marketing_leads_view.xml new file mode 100755 index 0000000..f0b55b7 --- /dev/null +++ b/sos_marketing/views/sos_marketing_leads_view.xml @@ -0,0 +1,180 @@ + + + + Marketing Leads + ir.actions.act_window + sos_marketing_leads + tree,form,kanban + + + + + + sos_marketing_leads.view.tree + sos_marketing_leads + + + + + + + + + + + + + + Form + sos_marketing_leads + +
+ + +

Marketing Leads




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





+

Company Info

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

+ +
+ +

Expo Details

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

Conference Details

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

LinkedIn Group Details

+ + + + + +
+ +
+

LinkedIn Poll Details

+ + + + + +
+ +
+ +

Expo[Participated] Details

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

+ +

Contact Details

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

+
+
+ +
+ + + + +
Move Lead To
Cc To
+
+
+
+
+ +
+ + + +
Moved To
Moved On
+
+
+
+
+
+
+ + + +