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:
53
encoach_ticket/models/ticket.py
Normal file
53
encoach_ticket/models/ticket.py
Normal file
@@ -0,0 +1,53 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class EncoachTicket(models.Model):
|
||||
_name = "encoach.ticket"
|
||||
_description = "EnCoach Support Ticket"
|
||||
|
||||
reporter_name = fields.Char()
|
||||
reporter_email = fields.Char()
|
||||
subject = fields.Char(required=True)
|
||||
description = fields.Text()
|
||||
ticket_type = fields.Selection(
|
||||
[
|
||||
("feedback", "Feedback"),
|
||||
("bug", "Bug Report"),
|
||||
("help", "Help Request"),
|
||||
],
|
||||
string="Type",
|
||||
)
|
||||
status = fields.Selection(
|
||||
[
|
||||
("open", "Open"),
|
||||
("in_progress", "In Progress"),
|
||||
("resolved", "Resolved"),
|
||||
("closed", "Closed"),
|
||||
],
|
||||
default="open",
|
||||
)
|
||||
exam_information = fields.Json()
|
||||
assigned_to_id = fields.Many2one(
|
||||
"res.users", string="Assigned To", ondelete="set null",
|
||||
)
|
||||
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,
|
||||
"reporterName": self.reporter_name or "",
|
||||
"reporterEmail": self.reporter_email or "",
|
||||
"subject": self.subject or "",
|
||||
"description": self.description or "",
|
||||
"type": self.ticket_type or "",
|
||||
"status": self.status,
|
||||
"examInformation": self.exam_information,
|
||||
"assignedTo": (
|
||||
self.assigned_to_id.name if self.assigned_to_id else None
|
||||
),
|
||||
"createdAt": (
|
||||
self.created_at.isoformat() if self.created_at else None
|
||||
),
|
||||
}
|
||||
Reference in New Issue
Block a user