Fix model-controller mismatches and routing issues

- ticket: add user_id, priority, category fields; fix _serialize_ticket -> _serialize
- package: fix is_active -> active (Odoo auto-filter), remove invalid entity_id filter
- walkthrough: add sequence field; fix controller to use name/content instead of title/steps
- users: fix encoach_user_type -> encoach_type, encoach_entity_id -> entity_rel_ids.entity_id
- generation: use EncoachGenerationService class instead of nonexistent ORM model,
  fix /api/exam/level/ route conflict (separate GET and POST URLs)

Made-with: Cursor
This commit is contained in:
Talal Sharabi
2026-03-15 01:08:36 +04:00
parent f5b627256f
commit bf3981028b
7 changed files with 62 additions and 48 deletions

View File

@@ -105,10 +105,10 @@ class TrainingController(EncoachMixin, http.Controller):
data = [{
'_id': str(w.id),
'id': w.id,
'title': getattr(w, 'title', ''),
'description': getattr(w, 'description', ''),
'steps': json.loads(w.steps) if getattr(w, 'steps', None) else [],
'module': getattr(w, 'module', ''),
'title': w.name or '',
'description': '',
'steps': w.content if isinstance(w.content, list) else (json.loads(w.content) if isinstance(w.content, str) else []),
'module': w.module or '',
} for w in records]
return self._json_response(data)