mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[10.0][ADD] Add website_portal_contract (#62)
* [ADD] Add website_portal_contract * [ADD] website_portal_contract: Add url test, usage video. * [FIX] website_portal_contract: Fix controller test. * [FIX] website_portal_contract: Change all tests to HttpCase.
This commit is contained in:
24
website_portal_contract/models/account_analytic_contract.py
Normal file
24
website_portal_contract/models/account_analytic_contract.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountAnalyticContract(models.Model):
|
||||
|
||||
_inherit = 'account.analytic.contract'
|
||||
|
||||
website_template_id = fields.Many2one(
|
||||
string='Website Template',
|
||||
comodel_name='account.analytic.contract.template',
|
||||
help='Website layout for contract',
|
||||
default=lambda s: s._get_default_template(),
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _get_default_template(self):
|
||||
return self.env.ref(
|
||||
'website_portal_contract.website_contract_template_default',
|
||||
raise_if_not_found=False,
|
||||
)
|
||||
Reference in New Issue
Block a user