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:
20
encoach_core/models/role.py
Normal file
20
encoach_core/models/role.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class EncoachRole(models.Model):
|
||||
_name = "encoach.role"
|
||||
_description = "EnCoach Role"
|
||||
|
||||
name = fields.Char(required=True)
|
||||
entity_id = fields.Many2one("encoach.entity", required=True, ondelete="cascade")
|
||||
permission_ids = fields.Many2many("encoach.permission", string="Permissions")
|
||||
legacy_id = fields.Char(index=True)
|
||||
|
||||
def to_encoach_dict(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
"id": self.id,
|
||||
"name": self.name,
|
||||
"entity": self.entity_id.id,
|
||||
"permissions": [p.to_encoach_dict() for p in self.permission_ids],
|
||||
}
|
||||
Reference in New Issue
Block a user