feat: Initialize project and Phase 1 MyMach Social Next-Gen module structure
This commit is contained in:
1
extra-addons/mymach_social_nextgen/__init__.py
Normal file
1
extra-addons/mymach_social_nextgen/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
33
extra-addons/mymach_social_nextgen/__manifest__.py
Normal file
33
extra-addons/mymach_social_nextgen/__manifest__.py
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
'name': 'MyMach Next-Gen Social Engine',
|
||||
'version': '1.0.0',
|
||||
'category': 'Marketing',
|
||||
'summary': 'Advanced Social Media Management, AI Assistant, and CRM Integration',
|
||||
'description': """
|
||||
MyMach Next-Gen Social Engine
|
||||
==============================
|
||||
A complete social media automation tool that does not require Enterprise licenses.
|
||||
|
||||
Features:
|
||||
- Multi-Platform API & OAuth2 Connection (Meta, LinkedIn, X, YouTube)
|
||||
- Drag-and-Drop Scheduler & Calendar
|
||||
- AI-Based Text and Trend Hashtag Assistant
|
||||
- Dynamic Templates & Auto Watermarking
|
||||
- Vertical Video Render Engine
|
||||
- Otonom Trend Analytics
|
||||
- Competitor Social Media Tracking
|
||||
- Social Listening & CRM Lead Generation
|
||||
- Approval Workflow
|
||||
- n8n Webhook & External Service Triggering
|
||||
""",
|
||||
'author': 'MyMach',
|
||||
'website': 'https://www.mymach.com',
|
||||
'depends': ['base', 'web', 'crm', 'mail'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False,
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
4
extra-addons/mymach_social_nextgen/models/__init__.py
Normal file
4
extra-addons/mymach_social_nextgen/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from . import social_account
|
||||
from . import social_post
|
||||
from . import social_media
|
||||
from . import social_competitor
|
||||
31
extra-addons/mymach_social_nextgen/models/social_account.py
Normal file
31
extra-addons/mymach_social_nextgen/models/social_account.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
class SocialAccount(models.Model):
|
||||
_name = 'social.account'
|
||||
_description = 'Social Media Account'
|
||||
|
||||
name = fields.Char(string='Account Name', required=True)
|
||||
platform = fields.Selection([
|
||||
('facebook', 'Facebook'),
|
||||
('instagram', 'Instagram'),
|
||||
('linkedin', 'LinkedIn'),
|
||||
('x', 'X (Twitter)'),
|
||||
('youtube', 'YouTube')
|
||||
], string='Platform', required=True)
|
||||
|
||||
active = fields.Boolean(default=True)
|
||||
access_token = fields.Char(string='Access Token', groups="base.group_system")
|
||||
refresh_token = fields.Char(string='Refresh Token', groups="base.group_system")
|
||||
token_expiration = fields.Datetime(string='Token Expiration Date')
|
||||
|
||||
# Optional fields for user info
|
||||
platform_account_id = fields.Char(string='Platform Account ID')
|
||||
profile_image_url = fields.Char(string='Profile Image URL')
|
||||
|
||||
def action_authenticate(self):
|
||||
# Placeholder for OAuth2 authentication flow
|
||||
pass
|
||||
|
||||
def action_refresh_token(self):
|
||||
# Placeholder for refreshing the OAuth2 token
|
||||
pass
|
||||
@@ -0,0 +1,26 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
class SocialCompetitor(models.Model):
|
||||
_name = 'social.competitor'
|
||||
_description = 'Social Media Competitor Analysis'
|
||||
|
||||
name = fields.Char(string='Competitor Name', required=True)
|
||||
platform = fields.Selection([
|
||||
('facebook', 'Facebook'),
|
||||
('instagram', 'Instagram'),
|
||||
('linkedin', 'LinkedIn'),
|
||||
('x', 'X (Twitter)'),
|
||||
('youtube', 'YouTube')
|
||||
], string='Platform', required=True)
|
||||
|
||||
profile_url = fields.Char(string='Profile URL', required=True)
|
||||
followers_count = fields.Integer(string='Followers Count', readonly=True)
|
||||
engagement_rate = fields.Float(string='Engagement Rate (%)', readonly=True)
|
||||
|
||||
last_scraped = fields.Datetime(string='Last Scraped Date', readonly=True)
|
||||
|
||||
notes = fields.Text(string='Analysis Notes')
|
||||
|
||||
def action_scrape_data(self):
|
||||
# Placeholder for BeautifulSoup / Scrapy scraping logic
|
||||
pass
|
||||
27
extra-addons/mymach_social_nextgen/models/social_media.py
Normal file
27
extra-addons/mymach_social_nextgen/models/social_media.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
class SocialMedia(models.Model):
|
||||
_name = 'social.media'
|
||||
_description = 'Social Media Library'
|
||||
|
||||
name = fields.Char(string='File Name', required=True)
|
||||
media_type = fields.Selection([
|
||||
('image', 'Image'),
|
||||
('video', 'Video'),
|
||||
('template', 'Dynamic Template')
|
||||
], string='Media Type', required=True)
|
||||
|
||||
file_data = fields.Binary(string='File', required=True)
|
||||
mimetype = fields.Char(string='Mime Type')
|
||||
|
||||
# AI/Dynamic generation specific fields
|
||||
is_ai_generated = fields.Boolean(string='AI Generated', default=False)
|
||||
template_id = fields.Many2one('social.media', string='Source Template', domain=[('media_type', '=', 'template')])
|
||||
|
||||
def action_generate_watermark(self):
|
||||
# Placeholder for PIL watermark logic
|
||||
pass
|
||||
|
||||
def action_generate_video(self):
|
||||
# Placeholder for MoviePy video generation
|
||||
pass
|
||||
42
extra-addons/mymach_social_nextgen/models/social_post.py
Normal file
42
extra-addons/mymach_social_nextgen/models/social_post.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
class SocialPost(models.Model):
|
||||
_name = 'social.post'
|
||||
_description = 'Social Media Post'
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
name = fields.Char(string='Post Title', required=True, tracking=True)
|
||||
content = fields.Text(string='Content', tracking=True)
|
||||
|
||||
state = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('approval', 'Waiting for Approval'),
|
||||
('scheduled', 'Scheduled'),
|
||||
('published', 'Published'),
|
||||
('failed', 'Failed')
|
||||
], string='Status', default='draft', tracking=True)
|
||||
|
||||
scheduled_date = fields.Datetime(string='Scheduled Date', tracking=True)
|
||||
published_date = fields.Datetime(string='Published Date', readonly=True)
|
||||
|
||||
account_ids = fields.Many2many('social.account', string='Social Accounts', required=True)
|
||||
media_ids = fields.Many2many('social.media', string='Media Files')
|
||||
|
||||
error_message = fields.Text(string='Error Message', readonly=True)
|
||||
|
||||
def action_submit_for_approval(self):
|
||||
for record in self:
|
||||
record.state = 'approval'
|
||||
|
||||
def action_approve(self):
|
||||
for record in self:
|
||||
if record.scheduled_date:
|
||||
record.state = 'scheduled'
|
||||
else:
|
||||
record.action_publish()
|
||||
|
||||
def action_publish(self):
|
||||
for record in self:
|
||||
# Placeholder for publishing logic
|
||||
record.state = 'published'
|
||||
record.published_date = fields.Datetime.now()
|
||||
@@ -0,0 +1,9 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_social_account_user,social.account.user,model_social_account,base.group_user,1,1,1,0
|
||||
access_social_account_manager,social.account.manager,model_social_account,base.group_system,1,1,1,1
|
||||
access_social_post_user,social.post.user,model_social_post,base.group_user,1,1,1,0
|
||||
access_social_post_manager,social.post.manager,model_social_post,base.group_system,1,1,1,1
|
||||
access_social_media_user,social.media.user,model_social_media,base.group_user,1,1,1,0
|
||||
access_social_media_manager,social.media.manager,model_social_media,base.group_system,1,1,1,1
|
||||
access_social_competitor_user,social.competitor.user,model_social_competitor,base.group_user,1,1,1,0
|
||||
access_social_competitor_manager,social.competitor.manager,model_social_competitor,base.group_system,1,1,1,1
|
||||
|
Reference in New Issue
Block a user