Files
Yamen Ahmad 3e83d8d7d5 feat: add complete EnCoach backend — Odoo 19 + all addons
Includes:
- Odoo 19 framework (odoo/)
- 27 custom EnCoach addons (new_project/custom_addons/)
  - encoach_core, encoach_api, encoach_lms_api, encoach_adaptive_api
  - encoach_exam, encoach_taxonomy, encoach_adaptive, encoach_assignment
  - encoach_ai, encoach_ai_grading, encoach_ai_generation, encoach_ai_media
  - encoach_courseware, encoach_communication, encoach_subscription
  - encoach_notification, encoach_approval, encoach_branding
  - encoach_classroom, encoach_registration, encoach_stats
  - encoach_faq, encoach_ticket, encoach_training, encoach_resources
  - encoach_adaptive_ai, encoach_sis
- 21 OpenEduCat Enterprise modules (new_project/enterprise-19/)
- 14 OpenEduCat Community modules (new_project/openeducat_erp-19.0/)
- Configuration: odoo.conf, requirements.txt, scripts
- 200+ REST API endpoints with JWT authentication
- SRS and test documentation

Made-with: Cursor
2026-04-01 17:10:04 +04:00

65 lines
2.4 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class ResCompany(models.Model):
_inherit = 'res.company'
_check_company_auto = True
_check_quotation_validity_days = models.Constraint(
'CHECK(quotation_validity_days >= 0)',
'You cannot set a negative number for the default quotation validity. Leave empty (or 0) to disable the automatic expiration of quotations.',
)
portal_confirmation_sign = fields.Boolean(string="Online Signature", default=True)
portal_confirmation_pay = fields.Boolean(string="Online Payment")
prepayment_percent = fields.Float(
string="Prepayment percentage",
default=1.0,
help="The percentage of the amount needed to be paid to confirm quotations.")
quotation_validity_days = fields.Integer(
string="Default Quotation Validity",
default=30,
help="Days between quotation proposal and expiration."
" 0 days means automatic expiration is disabled",
)
sale_discount_product_id = fields.Many2one(
comodel_name='product.product',
string="Discount Product",
domain=[
('type', '=', 'service'),
('invoice_policy', '=', 'order'),
],
help="Default product used for discounts",
check_company=True,
)
# sale onboarding
sale_onboarding_payment_method = fields.Selection(
selection=[
('digital_signature', "Sign online"),
('paypal', "PayPal"),
('stripe', "Stripe"),
('other', "Pay with another payment provider"),
('manual', "Manual Payment"),
],
string="Sale onboarding selected payment method")
downpayment_account_id = fields.Many2one(
comodel_name='account.account',
string="Downpayment Account",
domain=[
('account_type', 'in', ('income', 'income_other', 'liability_current')),
],
help="This account will be used on Downpayment invoices.",
tracking=True,
)
@api.constrains('prepayment_percent')
def _check_prepayment_percent(self):
for company in self:
if company.portal_confirmation_pay and not (0 < company.prepayment_percent <= 1.0):
raise ValidationError(_("Prepayment percentage must be a valid percentage."))