EnCoach Odoo 19 custom modules
Full backend implementation with custom Odoo modules: - encoach_api: Core API, user management, JWT auth - encoach_exam: Exam generation (reading, writing, listening, speaking) - encoach_evaluate: AI-powered evaluation (writing, speaking) - encoach_training: Training tips and walkthrough - encoach_storage: File storage management - encoach_payment: Stripe, PayPal, Paymob integration - encoach_mail: Email notifications Made-with: Cursor
This commit is contained in:
3
encoach_training/models/__init__.py
Normal file
3
encoach_training/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from . import training
|
||||
from . import training_tip
|
||||
from . import walkthrough
|
||||
28
encoach_training/models/training.py
Normal file
28
encoach_training/models/training.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class EncoachTraining(models.Model):
|
||||
_name = "encoach.training"
|
||||
_description = "EnCoach Training Record"
|
||||
|
||||
user_id = fields.Many2one(
|
||||
"res.users", string="User", required=True, ondelete="cascade",
|
||||
)
|
||||
exams = fields.Json()
|
||||
tips = fields.Json()
|
||||
weak_areas = fields.Json()
|
||||
created_at = fields.Datetime(default=fields.Datetime.now)
|
||||
legacy_id = fields.Char(index=True)
|
||||
|
||||
def to_encoach_dict(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
"id": self.id,
|
||||
"userId": self.user_id.id if self.user_id else None,
|
||||
"exams": self.exams,
|
||||
"tips": self.tips,
|
||||
"weakAreas": self.weak_areas,
|
||||
"createdAt": (
|
||||
self.created_at.isoformat() if self.created_at else None
|
||||
),
|
||||
}
|
||||
22
encoach_training/models/training_tip.py
Normal file
22
encoach_training/models/training_tip.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class EncoachTrainingTip(models.Model):
|
||||
_name = "encoach.training.tip"
|
||||
_description = "EnCoach Training Tip"
|
||||
|
||||
tip_id = fields.Char(required=True, index=True)
|
||||
category = fields.Selection(
|
||||
[
|
||||
("ct_focus", "CT Focus"),
|
||||
("language_for_writing", "Language for Writing"),
|
||||
("reading_skill", "Reading Skill"),
|
||||
("strategy", "Strategy"),
|
||||
("writing_skill", "Writing Skill"),
|
||||
("word_link", "Word Link"),
|
||||
("word_partners", "Word Partners"),
|
||||
],
|
||||
string="Category",
|
||||
)
|
||||
content = fields.Text(required=True)
|
||||
embedding = fields.Binary(string="FAISS Embedding Vector")
|
||||
19
encoach_training/models/walkthrough.py
Normal file
19
encoach_training/models/walkthrough.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class EncoachWalkthrough(models.Model):
|
||||
_name = "encoach.walkthrough"
|
||||
_description = "EnCoach Walkthrough"
|
||||
|
||||
name = fields.Char()
|
||||
content = fields.Json()
|
||||
module = fields.Selection(
|
||||
[
|
||||
("reading", "Reading"),
|
||||
("listening", "Listening"),
|
||||
("writing", "Writing"),
|
||||
("speaking", "Speaking"),
|
||||
("level", "Level"),
|
||||
],
|
||||
string="Module",
|
||||
)
|
||||
Reference in New Issue
Block a user