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 @@ + +