You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1019 B
37 lines
1019 B
# Copyright 2014 Guewen Baconnier (Camptocamp SA)
|
|
# Copyright 2013-2014 Nicolas Bessi (Camptocamp SA)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
class BaseCommentTemplate(models.Model):
|
|
_name = "base.comment.template"
|
|
_description = "Base comment template"
|
|
|
|
name = fields.Char(
|
|
string='Comment summary',
|
|
required=True
|
|
)
|
|
position = fields.Selection(
|
|
selection=[
|
|
('before_lines', 'Before lines'),
|
|
('after_lines', 'After lines')
|
|
],
|
|
required=True,
|
|
default='before_lines',
|
|
help="Position on document"
|
|
)
|
|
text = fields.Html(
|
|
string='Comment',
|
|
translate=True,
|
|
required=True
|
|
)
|
|
|
|
@api.multi
|
|
def get_value(self, partner_id=False):
|
|
self.ensure_one()
|
|
lang = None
|
|
if partner_id:
|
|
lang = self.env['res.partner'].browse(partner_id).lang
|
|
return self.with_context({'lang': lang}).text
|