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
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
from odoo import models, fields
|
|
|
|
|
|
class EncoachAIJob(models.Model):
|
|
_name = "encoach.ai.job"
|
|
_description = "EnCoach AI Background Job"
|
|
|
|
job_type = fields.Selection(
|
|
[
|
|
("writing_grading", "Writing Grading"),
|
|
("speaking_grading", "Speaking Grading"),
|
|
("video_generation", "Video Generation"),
|
|
],
|
|
string="Job Type",
|
|
)
|
|
status = fields.Selection(
|
|
[
|
|
("pending", "Pending"),
|
|
("in_progress", "In Progress"),
|
|
("completed", "Completed"),
|
|
("error", "Error"),
|
|
],
|
|
default="pending",
|
|
)
|
|
user_id = fields.Many2one("res.users", string="User", ondelete="set null")
|
|
evaluation_id = fields.Many2one(
|
|
"encoach.evaluation", string="Evaluation", ondelete="cascade",
|
|
)
|
|
input_data = fields.Json()
|
|
result_data = fields.Json()
|
|
error_message = fields.Text()
|
|
created_at = fields.Datetime(default=fields.Datetime.now)
|
|
completed_at = fields.Datetime()
|
|
retry_count = fields.Integer(default=0)
|