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
26 lines
726 B
Python
26 lines
726 B
Python
from odoo import models, fields
|
|
|
|
|
|
class EncoachPackage(models.Model):
|
|
_name = "encoach.package"
|
|
_description = "EnCoach Subscription Package"
|
|
|
|
name = fields.Char(required=True)
|
|
price = fields.Float(digits=(12, 2))
|
|
currency = fields.Char(default="USD")
|
|
duration_days = fields.Integer()
|
|
features = fields.Json()
|
|
active = fields.Boolean(default=True)
|
|
|
|
def to_encoach_dict(self):
|
|
self.ensure_one()
|
|
return {
|
|
"id": self.id,
|
|
"name": self.name,
|
|
"price": self.price,
|
|
"currency": self.currency or "USD",
|
|
"durationDays": self.duration_days,
|
|
"features": self.features,
|
|
"active": self.active,
|
|
}
|