Files
encoach_be_odoo19/encoach_subscription/models/subscription_payment.py
Talal Sharabi f5b627256f 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
2026-03-14 16:46:46 +04:00

36 lines
1.0 KiB
Python

from odoo import models, fields
class EncoachSubscriptionPayment(models.Model):
_name = "encoach.subscription.payment"
_description = "EnCoach Subscription Payment"
user_id = fields.Many2one("res.users", string="User", ondelete="set null")
package_id = fields.Many2one(
"encoach.package", string="Package", ondelete="set null",
)
provider = fields.Selection(
[
("stripe", "Stripe"),
("paypal", "PayPal"),
("paymob", "Paymob"),
],
string="Payment Provider",
)
status = fields.Selection(
[
("pending", "Pending"),
("completed", "Completed"),
("failed", "Failed"),
],
default="pending",
)
amount = fields.Float(digits=(12, 2))
currency = fields.Char()
transaction_id = fields.Char(index=True)
created_at = fields.Datetime(default=fields.Datetime.now)
entity_id = fields.Many2one(
"encoach.entity", string="Entity", ondelete="set null",
)
legacy_id = fields.Char(index=True)