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:
@@ -0,0 +1,40 @@
|
||||
# -*- 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
|
||||
from odoo.tools.translate import html_translate
|
||||
|
||||
|
||||
class AccountAnalyticContractTemplate(models.Model):
|
||||
|
||||
_name = 'account.analytic.contract.template'
|
||||
_description = 'Contract Website Templates'
|
||||
|
||||
name = fields.Char(
|
||||
help='Template name',
|
||||
)
|
||||
website_description = fields.Html(
|
||||
string='Description',
|
||||
translate=html_translate,
|
||||
sanitize_attributes=False,
|
||||
)
|
||||
analytic_account_id = fields.One2many(
|
||||
string='Analytic Account',
|
||||
comodel_name='account.analytic.account',
|
||||
inverse_name='website_template_id',
|
||||
)
|
||||
analytic_contract_id = fields.One2many(
|
||||
string='Contract Template',
|
||||
comodel_name='account.analytic.account',
|
||||
inverse_name='website_template_id',
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def open_template(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'target': 'self',
|
||||
'url': '/contract/template/%d' % self.id
|
||||
}
|
||||
Reference in New Issue
Block a user